зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1001198 - Stop firing onNewGlobalObject for the SafeJSContext global. r=gabor
This commit is contained in:
Родитель
2513cf740a
Коммит
4c5f7a4d5b
|
@ -173,6 +173,13 @@ XPCJSContextStack::InitSafeJSContext()
|
||||||
|
|
||||||
JS_SetErrorReporter(mSafeJSContext, xpc::SystemErrorReporter);
|
JS_SetErrorReporter(mSafeJSContext, xpc::SystemErrorReporter);
|
||||||
|
|
||||||
|
// Note - We intentionally avoid firing OnNewGlobalObject while
|
||||||
|
// simultaneously skipping the call to setInvisibleToDebugger(true) here.
|
||||||
|
// This lets us piggy-back on the assertions in the JS engine (which make
|
||||||
|
// sure that, for non-invisible globals, we always fire onNewGlobalObject
|
||||||
|
// before creating scripts), to assert that we never create scripts with
|
||||||
|
// the SafeJSContextGlobal. This is all happening way before anyone could be
|
||||||
|
// listening for debugger notifications anyway.
|
||||||
JS::CompartmentOptions options;
|
JS::CompartmentOptions options;
|
||||||
options.setZone(JS::SystemZone)
|
options.setZone(JS::SystemZone)
|
||||||
.setTrace(TraceXPCGlobal);
|
.setTrace(TraceXPCGlobal);
|
||||||
|
@ -194,8 +201,5 @@ XPCJSContextStack::InitSafeJSContext()
|
||||||
if (NS_FAILED(xpc->InitClasses(mSafeJSContext, mSafeJSContextGlobal)))
|
if (NS_FAILED(xpc->InitClasses(mSafeJSContext, mSafeJSContextGlobal)))
|
||||||
MOZ_CRASH();
|
MOZ_CRASH();
|
||||||
|
|
||||||
JS::RootedObject glob(mSafeJSContext, mSafeJSContextGlobal);
|
|
||||||
JS_FireOnNewGlobalObject(mSafeJSContext, glob);
|
|
||||||
|
|
||||||
return mSafeJSContext;
|
return mSafeJSContext;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче