Backed out changeset 2f2511d69d2e (bug 1337543) draft
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 13 Feb 2017 19:00:01 +0100
changeset 485880 01cd5119e25cb41c81f608afb0a34c32e86620dd
parent 485879 27a4a904f6a75955ff77d95d9f8b3ec9bffd26bd
child 485881 558c361c937aaca034f7d10f12a7e48b41b2d793
push id45870
push userbmo:kechen@mozilla.com
push dateFri, 17 Feb 2017 09:36:54 +0000
bugs1337543
milestone54.0a1
backs out2f2511d69d2e833082f934e0c015861a0ec1ce6d
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();