Bug 844211 - Only check the XBL bit if XBL scopes are disabled. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Tue, 05 Mar 2013 15:16:37 -0800
changeset 123874 c5a4010013edbf182b428442d3d114370806264a
parent 123873 06b6880a8241ab6c05f93ad422c23f2d5d5a5d8f
child 123875 23a1dd29471f8336e18677141667de4625052ab0
push id1401
push userpastithas@mozilla.com
push dateThu, 07 Mar 2013 07:26:45 +0000
treeherderfx-team@ee4879719f78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs844211
milestone22.0a1
Bug 844211 - Only check the XBL bit if XBL scopes are disabled. r=bz
content/base/src/nsContentUtils.cpp
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -1756,19 +1756,21 @@ nsContentUtils::IsCallerChrome()
 
 bool
 nsContentUtils::IsCallerXBL()
 {
     JSScript *script;
     JSContext *cx = GetCurrentJSContext();
     if (!cx)
         return false;
+
     // New Hotness.
-    if (xpc::IsXBLScope(js::GetContextCompartment(cx)))
-        return true;
+    if (XPCJSRuntime::Get()->XBLScopesEnabled())
+        return xpc::IsXBLScope(js::GetContextCompartment(cx));
+
     // XBL scopes are behind a pref, so check the XBL bit as well.
     if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script)
         return false;
     return JS_GetScriptUserBit(script);
 }
 
 
 bool