Bug 1508644 - Remove systemPrincipal fallback from Docshell EndPageLoad. r=ckerschb
authorJonathan Kingston <jkt@mozilla.com>
Tue, 20 Nov 2018 18:06:59 +0000
changeset 447357 54005d7b0a86809d8ed4f8d0537681523f952859
parent 447356 50ebcb8ac1d8d42b4b65611e537a8c40eabd95d1
child 447358 453589993f45bd5ac46350916fb843de25745aa7
push id35075
push usershindli@mozilla.com
push dateWed, 21 Nov 2018 04:04:02 +0000
treeherdermozilla-central@8540104bb0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1508644
milestone65.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 1508644 - Remove systemPrincipal fallback from Docshell EndPageLoad. r=ckerschb Differential Revision: https://phabricator.services.mozilla.com/D12426
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -7299,19 +7299,18 @@ nsDocShell::EndPageLoad(nsIWebProgress* 
           newURI->GetSpec(newSpec);
           NS_ConvertUTF8toUTF16 newSpecW(newSpec);
 
           // This notification is meant for Firefox Health Report so it
           // can increment counts from the search engine
           MaybeNotifyKeywordSearchLoading(keywordProviderName, keywordAsSent);
 
           nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
-          nsCOMPtr<nsIPrincipal> triggeringPrincipal = loadInfo
-            ? loadInfo->TriggeringPrincipal()
-            : nsContentUtils::GetSystemPrincipal();
+          MOZ_ASSERT(loadInfo, "loadInfo is required on all channels");
+          nsCOMPtr<nsIPrincipal> triggeringPrincipal = loadInfo->TriggeringPrincipal();
           return LoadURI(newSpecW,             // URI string
                          LOAD_FLAGS_NONE,      // Load flags
                          nullptr,              // Referring URI
                          newPostData,          // Post data stream
                          nullptr,              // Headers stream
                          triggeringPrincipal); // TriggeringPrincipal
         }
       }