Bug 1334875 - Temporarily remove assertion that history loads pass a valid triggeringprincipal. r=jwatt, a=ritu
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Wed, 08 Mar 2017 13:08:59 +0100
changeset 395087 a719817d7347c16974ca8cc1226afcc10ea6dee4
parent 395086 be7a2a07bda72f207306b3d7a9af3189876fb050
child 395088 7dfb1fe34ea5be93b23e8a6c077948ee84955c74
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, ritu
bugs1334875
milestone54.0a2
Bug 1334875 - Temporarily remove assertion that history loads pass a valid triggeringprincipal. r=jwatt, a=ritu
docshell/base/nsDocShell.cpp
docshell/shistory/nsSHEntry.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -12585,19 +12585,16 @@ nsDocShell::LoadHistoryEntry(nsISHEntry*
   if (isSrcdoc) {
     aEntry->GetSrcdocData(srcdoc);
     aEntry->GetBaseURI(getter_AddRefs(baseURI));
     flags |= INTERNAL_LOAD_FLAGS_IS_SRCDOC;
   } else {
     srcdoc = NullString();
   }
 
-  // If there is no valid triggeringPrincipal, we deny the load
-  MOZ_ASSERT(triggeringPrincipal,
-             "need a valid triggeringPrincipal to load from history");
   if (!triggeringPrincipal) {
     triggeringPrincipal = nsContentUtils::GetSystemPrincipal();
   }
 
   // Passing nullptr as aSourceDocShell gives the same behaviour as before
   // aSourceDocShell was introduced. According to spec we should be passing
   // the source browsing context that was used when the history entry was
   // first created. bug 947716 has been created to address this issue.
--- a/docshell/shistory/nsSHEntry.cpp
+++ b/docshell/shistory/nsSHEntry.cpp
@@ -508,20 +508,16 @@ nsSHEntry::GetTriggeringPrincipal(nsIPri
 {
   NS_IF_ADDREF(*aTriggeringPrincipal = mShared->mTriggeringPrincipal);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::SetTriggeringPrincipal(nsIPrincipal* aTriggeringPrincipal)
 {
-  MOZ_ASSERT(aTriggeringPrincipal, "need a valid triggeringPrincipal");
-  if (!aTriggeringPrincipal) {
-    return NS_ERROR_FAILURE;
-  }
   mShared->mTriggeringPrincipal = aTriggeringPrincipal;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetPrincipalToInherit(nsIPrincipal** aPrincipalToInherit)
 {
   NS_IF_ADDREF(*aPrincipalToInherit = mShared->mPrincipalToInherit);