Bug 650161 - Don't trace contents of wrapped native scope in wrapped native proto's trace hook, just the scope's global r=billm

This commit is contained in:
Jon Coppeard 2015-01-21 09:25:13 +00:00
parent 03377550a4
commit 90c9dbbc91

View File

@ -1065,9 +1065,12 @@ public:
static void static void
TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntime* rt); TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntime* rt);
void TraceInside(JSTracer *trc) { void TraceSelf(JSTracer *trc) {
MOZ_ASSERT(mGlobalJSObject); MOZ_ASSERT(mGlobalJSObject);
mGlobalJSObject.trace(trc, "XPCWrappedNativeScope::mGlobalJSObject"); mGlobalJSObject.trace(trc, "XPCWrappedNativeScope::mGlobalJSObject");
}
void TraceInside(JSTracer *trc) {
if (mContentXBLScope) if (mContentXBLScope)
mContentXBLScope.trace(trc, "XPCWrappedNativeScope::mXBLScope"); mContentXBLScope.trace(trc, "XPCWrappedNativeScope::mXBLScope");
for (size_t i = 0; i < mAddonScopes.Length(); i++) for (size_t i = 0; i < mAddonScopes.Length(); i++)
@ -1847,7 +1850,7 @@ public:
mScriptableInfo->Mark(); mScriptableInfo->Mark();
} }
GetScope()->TraceInside(trc); GetScope()->TraceSelf(trc);
} }
void TraceJS(JSTracer *trc) { void TraceJS(JSTracer *trc) {
@ -2162,7 +2165,7 @@ public:
if (HasProto()) if (HasProto())
GetProto()->TraceSelf(trc); GetProto()->TraceSelf(trc);
else else
GetScope()->TraceInside(trc); GetScope()->TraceSelf(trc);
if (mFlatJSObject && JS_IsGlobalObject(mFlatJSObject)) if (mFlatJSObject && JS_IsGlobalObject(mFlatJSObject))
{ {
xpc::TraceXPCGlobal(trc, mFlatJSObject); xpc::TraceXPCGlobal(trc, mFlatJSObject);