From 57f5c11f9ae73c56d279e20417a00cc94c29319c Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Tue, 7 Aug 2018 14:06:45 +0200 Subject: [PATCH] Bug 1481229 part 1 - Remove unnecessary realm entering in JavaScriptShared::findObjectById. r=evilpie ToWindowProxyIfWindow does not rely on the current realm in any way. --- js/ipc/JavaScriptShared.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/js/ipc/JavaScriptShared.cpp b/js/ipc/JavaScriptShared.cpp index af72b815f2f4..3bcb46318d28 100644 --- a/js/ipc/JavaScriptShared.cpp +++ b/js/ipc/JavaScriptShared.cpp @@ -538,11 +538,8 @@ JavaScriptShared::findObjectById(JSContext* cx, const ObjectId& objId) // wrappers. JSAutoRealm ar(cx, scopeForTargetObjects()); if (objId.hasXrayWaiver()) { - { - JSAutoRealmAllowCCW ar2(cx, obj); - obj = js::ToWindowProxyIfWindow(obj); - MOZ_ASSERT(obj); - } + obj = js::ToWindowProxyIfWindow(obj); + MOZ_ASSERT(obj); if (!xpc::WrapperFactory::WaiveXrayAndWrap(cx, &obj)) return nullptr; } else {