mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Make DEBUG_CC compile again (broken by the fix for bug 458099). r=bent, NPOTB.
This commit is contained in:
parent
e99a0fd85e
commit
1a76d6b1c6
@ -553,7 +553,7 @@ nsXPConnect::BeginCycleCollection(nsCycleCollectionTraversalCallback &cb)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
GetRuntime()->UnsetContextGlobals();
|
||||
GetRuntime()->UnrootContextGlobals();
|
||||
|
||||
PRBool alreadyCollecting = mCycleCollecting;
|
||||
mCycleCollecting = PR_TRUE;
|
||||
@ -600,7 +600,7 @@ nsXPConnect::FinishCycleCollection()
|
||||
mCycleCollectionContext = nsnull;
|
||||
mExplainCycleCollectionContext = nsnull;
|
||||
|
||||
GetRuntime()->RestoreContextGlobals();
|
||||
GetRuntime()->RootContextGlobals();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -461,6 +461,22 @@ void XPCJSRuntime::UnrootContextGlobals()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CC
|
||||
void XPCJSRuntime::RootContextGlobals()
|
||||
{
|
||||
JSContext *iter = nsnull, *acx;
|
||||
while((acx = JS_ContextIterator(GetJSRuntime(), &iter)))
|
||||
{
|
||||
if(JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL))
|
||||
{
|
||||
JS_ToggleOptions(acx, JSOPTION_UNROOTED_GLOBAL);
|
||||
--mUnrootedGlobalCount;
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(mUnrootedGlobalCount == 0, "bad state");
|
||||
}
|
||||
#endif
|
||||
|
||||
// static
|
||||
JSBool XPCJSRuntime::GCCallback(JSContext *cx, JSGCStatus status)
|
||||
{
|
||||
|
@ -728,6 +728,9 @@ public:
|
||||
nsresult RemoveJSHolder(void* aHolder);
|
||||
|
||||
void UnrootContextGlobals();
|
||||
#ifdef DEBUG_CC
|
||||
void RootContextGlobals();
|
||||
#endif
|
||||
|
||||
void DebugDump(PRInt16 depth);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user