mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 921454 - Match the background-finalize-ity of the DeadObjectProxy with that of origobj in js_TransplantObjectWithWrapper. r=jonco
This commit is contained in:
parent
4a8a8167bd
commit
aef20e4335
@ -1282,7 +1282,11 @@ js_TransplantObjectWithWrapper(JSContext *cx,
|
||||
// a new unreachable dummy object and swap it with the reflector.
|
||||
// After the swap we have a possibly-live object that isn't dangerous,
|
||||
// and a possibly-dangerous object that isn't live.
|
||||
RootedObject reflectorGuts(cx, NewDeadProxyObject(cx, JS_GetGlobalForObject(cx, origobj)));
|
||||
ProxyOptions options;
|
||||
if (!IsBackgroundFinalized(origobj->tenuredGetAllocKind()))
|
||||
options.setForceForegroundFinalization(true);
|
||||
RootedObject reflectorGuts(cx, NewDeadProxyObject(cx, JS_GetGlobalForObject(cx, origobj),
|
||||
options));
|
||||
if (!reflectorGuts || !JSObject::swap(cx, origobj, reflectorGuts))
|
||||
MOZ_CRASH();
|
||||
|
||||
|
@ -837,10 +837,11 @@ DeadObjectProxy DeadObjectProxy::singleton;
|
||||
const char DeadObjectProxy::sDeadObjectFamily = 0;
|
||||
|
||||
JSObject *
|
||||
js::NewDeadProxyObject(JSContext *cx, JSObject *parent)
|
||||
js::NewDeadProxyObject(JSContext *cx, JSObject *parent,
|
||||
const ProxyOptions &options)
|
||||
{
|
||||
return NewProxyObject(cx, &DeadObjectProxy::singleton, JS::NullHandleValue,
|
||||
NULL, parent);
|
||||
NULL, parent, options);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -255,7 +255,8 @@ bool
|
||||
IsDeadProxyObject(JSObject *obj);
|
||||
|
||||
JSObject *
|
||||
NewDeadProxyObject(JSContext *cx, JSObject *parent);
|
||||
NewDeadProxyObject(JSContext *cx, JSObject *parent,
|
||||
const ProxyOptions &options = ProxyOptions());
|
||||
|
||||
void
|
||||
NukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper);
|
||||
|
Loading…
x
Reference in New Issue
Block a user