mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1044205 - Invoke XPCWrappedNativeScope::TraceSelf from TraceXPCGlobal. r=billm
This commit is contained in:
parent
85a6735f8c
commit
5bfdc1a8eb
@ -2504,15 +2504,7 @@ ConvertExceptionToPromise(JSContext* cx,
|
||||
void
|
||||
CreateGlobalOptions<nsGlobalWindow>::TraceGlobal(JSTracer* aTrc, JSObject* aObj)
|
||||
{
|
||||
mozilla::dom::TraceProtoAndIfaceCache(aTrc, aObj);
|
||||
|
||||
// We might be called from a GC during the creation of a global, before we've
|
||||
// been able to set up the compartment private or the XPCWrappedNativeScope,
|
||||
// so we need to null-check those.
|
||||
xpc::CompartmentPrivate* compartmentPrivate = xpc::CompartmentPrivate::Get(aObj);
|
||||
if (compartmentPrivate && compartmentPrivate->scope) {
|
||||
compartmentPrivate->scope->TraceSelf(aTrc);
|
||||
}
|
||||
xpc::TraceXPCGlobal(aTrc, aObj);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -298,10 +298,17 @@ static inline T UnexpectedFailure(T rv)
|
||||
}
|
||||
|
||||
void
|
||||
TraceXPCGlobal(JSTracer *trc, JSObject *obj)
|
||||
xpc::TraceXPCGlobal(JSTracer *trc, JSObject *obj)
|
||||
{
|
||||
if (js::GetObjectClass(obj)->flags & JSCLASS_DOM_GLOBAL)
|
||||
mozilla::dom::TraceProtoAndIfaceCache(trc, obj);
|
||||
|
||||
// We might be called from a GC during the creation of a global, before we've
|
||||
// been able to set up the compartment private or the XPCWrappedNativeScope,
|
||||
// so we need to null-check those.
|
||||
xpc::CompartmentPrivate* compartmentPrivate = xpc::CompartmentPrivate::Get(obj);
|
||||
if (compartmentPrivate && compartmentPrivate->scope)
|
||||
compartmentPrivate->scope->TraceSelf(trc);
|
||||
}
|
||||
|
||||
namespace xpc {
|
||||
|
@ -1987,9 +1987,6 @@ private:
|
||||
|
||||
void *xpc_GetJSPrivate(JSObject *obj);
|
||||
|
||||
void
|
||||
TraceXPCGlobal(JSTracer *trc, JSObject *obj);
|
||||
|
||||
/***************************************************************************/
|
||||
// XPCWrappedNative the wrapper around one instance of a native xpcom object
|
||||
// to be used from JavaScript.
|
||||
@ -2180,7 +2177,7 @@ public:
|
||||
GetScope()->TraceSelf(trc);
|
||||
if (mFlatJSObject && JS_IsGlobalObject(mFlatJSObject))
|
||||
{
|
||||
TraceXPCGlobal(trc, mFlatJSObject);
|
||||
xpc::TraceXPCGlobal(trc, mFlatJSObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,6 +139,9 @@ IsXrayWrapper(JSObject *obj);
|
||||
JSObject *
|
||||
XrayAwareCalleeGlobal(JSObject *fun);
|
||||
|
||||
void
|
||||
TraceXPCGlobal(JSTracer *trc, JSObject *obj);
|
||||
|
||||
} /* namespace xpc */
|
||||
|
||||
namespace JS {
|
||||
|
Loading…
Reference in New Issue
Block a user