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 330589 2c04758cf3544a406711b01df129b04dd5376cf3
parent 330588 528caba5bd200398aeb8fc13bb3bf4b09f254afa
child 330590 67c98d7f2d47b5711cf1b90b1c4ceea64519e4fd
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1287776
milestone50.0a1
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.