Bug 1032317 - Get rid of JSD early return in RemoteXULForbidsXBLScope. r=gabor
authorBobby Holley <bobbyholley@gmail.com>
Thu, 03 Jul 2014 09:40:52 -0700
changeset 213020 346675a0cfa045d55cee88f7f69d97221861c79c
parent 213019 a30f01152c58b8482e4465a0cb1326e926c611e1
child 213021 b3e6f92dca28fc802d975cffc47ec7174b476a05
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor
bugs1032317
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1032317 - Get rid of JSD early return in RemoteXULForbidsXBLScope. r=gabor
js/xpconnect/src/XPCWrappedNativeScope.cpp
--- a/js/xpconnect/src/XPCWrappedNativeScope.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp
@@ -23,19 +23,17 @@ using namespace JS;
 /***************************************************************************/
 
 XPCWrappedNativeScope* XPCWrappedNativeScope::gScopes = nullptr;
 XPCWrappedNativeScope* XPCWrappedNativeScope::gDyingScopes = nullptr;
 
 static bool
 RemoteXULForbidsXBLScope(nsIPrincipal *aPrincipal, HandleObject aGlobal)
 {
-  // Check for random JSD scopes that don't have a principal.
-  if (!aPrincipal)
-      return false;
+  MOZ_ASSERT(aPrincipal);
 
   // The SafeJSContext is lazily created, and tends to be created at really
   // weird times, at least for xpcshell (often very early in startup or late
   // in shutdown). Its scope isn't system principal, so if we proceeded we'd
   // end up calling into AllowXULXBLForPrincipal, which depends on all kinds
   // of persistent storage and permission machinery that may or not be running.
   // We know the answer to the question here, so just short-circuit.
   if (JS_GetClass(aGlobal) == &SafeJSContextGlobalClass)