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:
Jan de Mooij
2018-08-07 14:06:45 +02:00
parent 2dceea12d4
commit 57f5c11f9a

View File

@@ -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 {