Bug 1481229 part 1 - Remove unnecessary realm entering in JavaScriptShared::findObjectById. r=evilpie
ToWindowProxyIfWindow does not rely on the current realm in any way.
This commit is contained in:
@@ -538,11 +538,8 @@ JavaScriptShared::findObjectById(JSContext* cx, const ObjectId& objId)
|
|||||||
// wrappers.
|
// wrappers.
|
||||||
JSAutoRealm ar(cx, scopeForTargetObjects());
|
JSAutoRealm ar(cx, scopeForTargetObjects());
|
||||||
if (objId.hasXrayWaiver()) {
|
if (objId.hasXrayWaiver()) {
|
||||||
{
|
obj = js::ToWindowProxyIfWindow(obj);
|
||||||
JSAutoRealmAllowCCW ar2(cx, obj);
|
MOZ_ASSERT(obj);
|
||||||
obj = js::ToWindowProxyIfWindow(obj);
|
|
||||||
MOZ_ASSERT(obj);
|
|
||||||
}
|
|
||||||
if (!xpc::WrapperFactory::WaiveXrayAndWrap(cx, &obj))
|
if (!xpc::WrapperFactory::WaiveXrayAndWrap(cx, &obj))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user