vendor/tracemonkey/xpconnect/loader/mozJSComponentLoader.cpp in johnson-2.0.0.pre0 vs vendor/tracemonkey/xpconnect/loader/mozJSComponentLoader.cpp in johnson-2.0.0.pre1
- old
+ new
@@ -81,11 +81,11 @@
#include "nsIScriptError.h"
#include "nsIConsoleService.h"
#include "prmem.h"
#include "plbase64.h"
-#if defined(MOZ_SHARK) || defined(MOZ_CALLGRIND) || defined(MOZ_VTUNE)
+#if defined(MOZ_SHARK) || defined(MOZ_CALLGRIND) || defined(MOZ_VTUNE) || defined(MOZ_TRACEVIS)
#include "jsdbgapi.h"
#endif
static const char kJSRuntimeServiceContractID[] = "@mozilla.org/js/xpc/RuntimeService;1";
static const char kXPConnectServiceContractID[] = "@mozilla.org/js/xpc/XPConnect;1";
@@ -290,10 +290,14 @@
{"startVtune", js_StartVtune, 1,0,0},
{"stopVtune", js_StopVtune, 0,0,0},
{"pauseVtune", js_PauseVtune, 0,0,0},
{"resumeVtune", js_ResumeVtune, 0,0,0},
#endif
+#ifdef MOZ_TRACEVIS
+ {"initEthogram", js_InitEthogram, 0,0,0},
+ {"shutdownEthogram", js_ShutdownEthogram, 0,0,0},
+#endif
{nsnull,nsnull,0,0,0}
};
class JSCLContextHelper
{
@@ -775,11 +779,12 @@
fprintf(stderr, "mJCL: %s::NSGetModule returned %s\n",
registryLocation, JS_GetStringBytes(s));
#endif
JSObject *jsModuleObj;
- if (!JS_ValueToObject(cx, retval, &jsModuleObj)) {
+ if (!JS_ValueToObject(cx, retval, &jsModuleObj) ||
+ !jsModuleObj) {
/* XXX report error properly */
return NS_ERROR_FAILURE;
}
rv = xpc->WrapJS(cx, jsModuleObj,
@@ -948,27 +953,10 @@
if (NS_SUCCEEDED(rv)) {
LOG(("opened fastload file for reading\n"));
nsCOMPtr<nsIFastLoadReadControl>
readControl(do_QueryInterface(mFastLoadInput));
- if (readControl) {
- // Verify checksum, using the FastLoadService's
- // checksum cache to avoid computing more than once
- // per session.
- PRUint32 checksum;
- rv = readControl->GetChecksum(&checksum);
- if (NS_SUCCEEDED(rv)) {
- PRUint32 verified;
- rv = flSvc->ComputeChecksum(mFastLoadFile,
- readControl, &verified);
- if (NS_SUCCEEDED(rv) && verified != checksum) {
- LOG(("Incorrect checksum detected"));
- rv = NS_ERROR_FAILURE;
- }
- }
- }
-
if (NS_SUCCEEDED(rv)) {
/* Get the JS bytecode version number and validate it. */
PRUint32 version;
rv = mFastLoadInput->Read32(&version);
if (NS_SUCCEEDED(rv) && version != JSXDR_BYTECODE_VERSION) {
@@ -1034,10 +1022,12 @@
rv = mFastLoadTimer->InitWithFuncCallback(&mozJSComponentLoader::CloseFastLoad,
this,
kFastLoadWriteDelay,
nsITimer::TYPE_ONE_SHOT);
} else {
+ // Note, that since CloseFastLoad nulls out mFastLoadTimer,
+ // SetDelay() will only be called on a timer that hasn't fired.
rv = mFastLoadTimer->SetDelay(kFastLoadWriteDelay);
}
return rv;
}
@@ -1177,10 +1167,10 @@
// XPCONNECT_STANDALONE case - but at least it builds and runs otherwise.
// See: http://bugzilla.mozilla.org/show_bug.cgi?id=121438
#ifdef XPCONNECT_STANDALONE
localFile->GetNativePath(nativePath);
#else
- NS_GetURLSpecFromFile(aComponent, nativePath);
+ NS_GetURLSpecFromActualFile(aComponent, nativePath);
#endif
// Before compiling the script, first check to see if we have it in
// the fastload file. Note: as a rule, fastload errors are not fatal
// to loading the script, since we can always slow-load.