Bug 1287776 - eliminate assignment from MOZ_ASSERT in EnsureContentXBLScope. r=bholley
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Tue, 19 Jul 2016 21:57:37 +0300
changeset 305508 2c04758cf3544a406711b01df129b04dd5376cf3
parent 305507 528caba5bd200398aeb8fc13bb3bf4b09f254afa
child 305509 67c98d7f2d47b5711cf1b90b1c4ceea64519e4fd
push id30695
push userbpostelnicu@mozilla.com
push dateTue, 19 Jul 2016 19:11:19 +0000
treeherderautoland@2c04758cf354 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1287776
milestone50.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 1287776 - eliminate assignment from MOZ_ASSERT in EnsureContentXBLScope. r=bholley MozReview-Commit-ID: 47a4XSAiQRP
js/xpconnect/src/XPCWrappedNativeScope.cpp
--- a/js/xpconnect/src/XPCWrappedNativeScope.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp
@@ -287,21 +287,20 @@ XPCWrappedNativeScope::EnsureContentXBLS
     SandboxOptions options;
     options.wantXrays = false;
     options.wantComponents = true;
     options.proto = global;
     options.sameZoneAs = global;
 
     // Use an nsExpandedPrincipal to create asymmetric security.
     nsIPrincipal* principal = GetPrincipal();
-    nsCOMPtr<nsIExpandedPrincipal> ep;
-    MOZ_ASSERT(!(ep = do_QueryInterface(principal)));
+    MOZ_ASSERT(!nsContentUtils::IsExpandedPrincipal(principal));
     nsTArray< nsCOMPtr<nsIPrincipal> > principalAsArray(1);
     principalAsArray.AppendElement(principal);
-    ep = new nsExpandedPrincipal(principalAsArray);
+    nsCOMPtr<nsIExpandedPrincipal> ep = new nsExpandedPrincipal(principalAsArray);
 
     // Create the sandbox.
     RootedValue v(cx);
     nsresult rv = CreateSandboxObject(cx, &v, ep, options);
     NS_ENSURE_SUCCESS(rv, nullptr);
     mContentXBLScope = &v.toObject();
 
     // Tag it.