Bug 1033157. Move the setup of the JSRuntime DOM callbacks into the CycleCollectedJSRuntime constructor, so we don't have to separatedly do it for workers, windows, and xpcshell. r=khuey

This commit is contained in:
Boris Zbarsky 2014-07-02 15:16:42 -04:00
parent 01347cdb2b
commit 799cac3554
3 changed files with 5 additions and 11 deletions

View File

@ -2951,11 +2951,6 @@ nsJSContext::EnsureStatics()
}; };
JS_SetStructuredCloneCallbacks(sRuntime, &cloneCallbacks); JS_SetStructuredCloneCallbacks(sRuntime, &cloneCallbacks);
static js::DOMCallbacks DOMcallbacks = {
InstanceClassHasProtoAtDepth
};
SetDOMCallbacks(sRuntime, &DOMcallbacks);
// Set up the asm.js cache callbacks // Set up the asm.js cache callbacks
static JS::AsmJSCacheOps asmJSCacheOps = { static JS::AsmJSCacheOps asmJSCacheOps = {
AsmJSCacheOpenEntryForRead, AsmJSCacheOpenEntryForRead,

View File

@ -802,12 +802,6 @@ CreateJSContextForWorker(WorkerPrivate* aWorkerPrivate, JSRuntime* aRuntime)
}; };
JS_SetSecurityCallbacks(aRuntime, &securityCallbacks); JS_SetSecurityCallbacks(aRuntime, &securityCallbacks);
// DOM helpers:
static js::DOMCallbacks DOMCallbacks = {
InstanceClassHasProtoAtDepth
};
SetDOMCallbacks(aRuntime, &DOMCallbacks);
// Set up the asm.js cache callbacks // Set up the asm.js cache callbacks
static JS::AsmJSCacheOps asmJSCacheOps = { static JS::AsmJSCacheOps asmJSCacheOps = {
AsmJSCacheOpenEntryForRead, AsmJSCacheOpenEntryForRead,

View File

@ -492,6 +492,11 @@ CycleCollectedJSRuntime::CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
JS_SetDestroyZoneCallback(mJSRuntime, XPCStringConvert::FreeZoneCache); JS_SetDestroyZoneCallback(mJSRuntime, XPCStringConvert::FreeZoneCache);
JS_SetSweepZoneCallback(mJSRuntime, XPCStringConvert::ClearZoneCache); JS_SetSweepZoneCallback(mJSRuntime, XPCStringConvert::ClearZoneCache);
static js::DOMCallbacks DOMcallbacks = {
InstanceClassHasProtoAtDepth
};
SetDOMCallbacks(mJSRuntime, &DOMcallbacks);
nsCycleCollector_registerJSRuntime(this); nsCycleCollector_registerJSRuntime(this);
} }