Bug 1596077 - Use browsingContext to do LoadURI() in nsSHistory r=smaug
authorAlphan Chen <alchen@mozilla.com>
Thu, 14 Nov 2019 08:08:21 +0000
changeset 501900 f6157616c912a8b911b7e17961304d117d843f39
parent 501899 ab5f80e64f5811672a39001dce060d2d6854c236
child 501901 509f74c50ad975a89e2bbb3497095abbf9237546
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1596077
milestone72.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 1596077 - Use browsingContext to do LoadURI() in nsSHistory r=smaug Differential Revision: https://phabricator.services.mozilla.com/D52841
docshell/shistory/nsSHistory.cpp
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -826,20 +826,18 @@ nsSHistory::EvictAllContentViewers() {
   for (int32_t i = 0; i < Length(); i++) {
     EvictContentViewerForEntry(mEntries[i]);
   }
 
   return NS_OK;
 }
 
 static nsresult LoadURI(nsSHistory::LoadEntryResult& aLoadResult) {
-  nsCOMPtr<nsIDocShell> docShell = aLoadResult.mBrowsingContext->GetDocShell();
-  NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
-
-  return docShell->LoadURI(aLoadResult.mLoadState, false);
+  return aLoadResult.mBrowsingContext->LoadURI(nullptr, aLoadResult.mLoadState,
+                                               false);
 }
 
 NS_IMETHODIMP
 nsSHistory::Reload(uint32_t aReloadFlags) {
   LoadEntryResult loadResult;
   nsresult rv = Reload(aReloadFlags, loadResult);
   NS_ENSURE_SUCCESS(rv, rv);