Bug 882162: Part 11 - Push the final uses of mJSHolders down into mozilla::CycleCollectedJSRuntime and make it private. r=mccr8

This commit is contained in:
Kyle Huey
2013-06-18 12:02:16 -07:00
parent 5a226322a4
commit 31c48a7e13
3 changed files with 32 additions and 15 deletions

View File

@@ -479,6 +479,31 @@ CycleCollectedJSRuntime::~CycleCollectedJSRuntime()
mJSRuntime = nullptr;
}
size_t
CycleCollectedJSRuntime::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
{
size_t n = 0;
// NULL for the second arg; we're not measuring anything hanging off the
// entries in mJSHolders.
n += mJSHolders.SizeOfExcludingThis(nullptr, aMallocSizeOf);
return n;
}
static PLDHashOperator
UnmarkJSHolder(void* holder, nsScriptObjectTracer*& tracer, void* arg)
{
tracer->CanSkip(holder, true);
return PL_DHASH_NEXT;
}
void
CycleCollectedJSRuntime::UnmarkSkippableJSHolders()
{
mJSHolders.Enumerate(UnmarkJSHolder, nullptr);
}
void
CycleCollectedJSRuntime::MaybeTraceGlobals(JSTracer* aTracer) const
{