Backed out changeset 2f2511d69d2e (bug 1337543)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 13 Feb 2017 19:00:01 +0100
changeset 342534 f1dbf0447becd4026c2372322056bda6faf5eef6
parent 342533 7223c6e6425f77423d9ab13281fd4d7c7827567e
child 342535 b7e8623021571bb3ad198c77a1ca88df7a2de46e
push id86897
push userarchaeopteryx@coole-files.de
push dateMon, 13 Feb 2017 18:01:23 +0000
treeherdermozilla-inbound@b7e862302157 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1337543
milestone54.0a1
backs out2f2511d69d2e833082f934e0c015861a0ec1ce6d
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
Backed out changeset 2f2511d69d2e (bug 1337543)
dom/workers/ScriptLoader.cpp
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -1205,17 +1205,16 @@ private:
   {
     AssertIsOnMainThread();
     MOZ_ASSERT(aIndex < mLoadInfos.Length());
     ScriptLoadInfo& loadInfo = mLoadInfos[aIndex];
     MOZ_ASSERT(loadInfo.mCacheStatus == ScriptLoadInfo::Cached);
 
     nsCOMPtr<nsIPrincipal> responsePrincipal =
       PrincipalInfoToPrincipal(*aPrincipalInfo);
-    MOZ_DIAGNOSTIC_ASSERT(responsePrincipal);
 
     nsIPrincipal* principal = mWorkerPrivate->GetPrincipal();
     if (!principal) {
       WorkerPrivate* parentWorker = mWorkerPrivate->GetParent();
       MOZ_ASSERT(parentWorker, "Must have a parent!");
       principal = parentWorker->GetPrincipal();
     }
 
@@ -1233,31 +1232,24 @@ private:
                                      loadInfo.mScriptTextLength);
     if (NS_SUCCEEDED(rv) && IsMainWorkerScript()) {
       nsCOMPtr<nsIURI> finalURI;
       rv = NS_NewURI(getter_AddRefs(finalURI), loadInfo.mFullURL, nullptr, nullptr);
       if (NS_SUCCEEDED(rv)) {
         mWorkerPrivate->SetBaseURI(finalURI);
       }
 
+      mozilla::DebugOnly<nsIPrincipal*> principal = mWorkerPrivate->GetPrincipal();
+      MOZ_ASSERT(principal);
       nsILoadGroup* loadGroup = mWorkerPrivate->GetLoadGroup();
-      MOZ_DIAGNOSTIC_ASSERT(loadGroup);
-
-#if defined(DEBUG) || !defined(RELEASE_OR_BETA)
-      nsIPrincipal* principal = mWorkerPrivate->GetPrincipal();
-      MOZ_DIAGNOSTIC_ASSERT(principal);
+      MOZ_ASSERT(loadGroup);
 
-      bool equal = false;
-      MOZ_ALWAYS_SUCCEEDS(responsePrincipal->Equals(principal, &equal));
-      MOZ_DIAGNOSTIC_ASSERT(equal);
-
-      nsCOMPtr<nsIContentSecurityPolicy> csp;
-      MOZ_ALWAYS_SUCCEEDS(responsePrincipal->GetCsp(getter_AddRefs(csp)));
-      MOZ_DIAGNOSTIC_ASSERT(!csp);
-#endif
+      mozilla::DebugOnly<bool> equal = false;
+      MOZ_ASSERT(responsePrincipal && NS_SUCCEEDED(responsePrincipal->Equals(principal, &equal)));
+      MOZ_ASSERT(equal);
 
       mWorkerPrivate->InitChannelInfo(aChannelInfo);
       rv = mWorkerPrivate->SetPrincipalOnMainThread(responsePrincipal, loadGroup);
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
     }
 
     if (NS_SUCCEEDED(rv)) {
       DataReceived();