From 484d62d1fbd9d29a638b3cac957119208412a124 Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Fri, 8 Mar 2013 18:49:36 -0800 Subject: [PATCH] Bug 846890 - Avoid check for native anonymous content when possible (r=bholley) --- js/xpconnect/wrappers/WrapperFactory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/xpconnect/wrappers/WrapperFactory.cpp b/js/xpconnect/wrappers/WrapperFactory.cpp index 2f01d9d7958c..057953ed553b 100644 --- a/js/xpconnect/wrappers/WrapperFactory.cpp +++ b/js/xpconnect/wrappers/WrapperFactory.cpp @@ -361,8 +361,6 @@ WrapperFactory::Rewrap(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *wrapper; CompartmentPrivate *targetdata = EnsureCompartmentPrivate(target); - bool canAccessNAC = targetIsChrome || - (targetSubsumesOrigin && nsContentUtils::IsCallerXBL()); // // First, handle the special cases. @@ -383,7 +381,9 @@ WrapperFactory::Rewrap(JSContext *cx, JSObject *existing, JSObject *obj, } else if (IsComponentsObject(obj) && !AccessCheck::isChrome(target)) { wrapper = &FilteringWrapper::singleton; - } else if (AccessCheck::needsSystemOnlyWrapper(obj) && !canAccessNAC) { + } else if (AccessCheck::needsSystemOnlyWrapper(obj) && + !(targetIsChrome || (targetSubsumesOrigin && nsContentUtils::IsCallerXBL()))) + { wrapper = &FilteringWrapper::singleton; }