mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
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:
parent
01347cdb2b
commit
799cac3554
@ -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,
|
||||||
|
@ -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,
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user