Bug 1597493 - Remove nsIDocShellTreeItem from GetLoadContextInfo. r=smaug
authorTom Schuster <evilpies@gmail.com>
Mon, 16 Dec 2019 11:27:23 +0000
changeset 507080 57ee8e8fa11b3df04fd7a42169d0808a4100b23b
parent 507079 c0c22dbdd5b8d9cd13d58e7a1894655404911801
child 507081 aa40b800b2ce6a854058523ff419f78750e3fcd1
push id36922
push userncsoregi@mozilla.com
push dateMon, 16 Dec 2019 17:21:47 +0000
treeherdermozilla-central@27d0d6cc2131 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1597493, 1604040
milestone73.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 1597493 - Remove nsIDocShellTreeItem from GetLoadContextInfo. r=smaug It is not quite clear to me if GetBrowsingContext can ever be null that is why I opened Bug 1604040. Differential Revision: https://phabricator.services.mozilla.com/D57247
netwerk/base/LoadContextInfo.cpp
--- a/netwerk/base/LoadContextInfo.cpp
+++ b/netwerk/base/LoadContextInfo.cpp
@@ -131,18 +131,19 @@ LoadContextInfo* GetLoadContextInfo(nsIL
   if (!aLoadContext) {
     return new LoadContextInfo(aIsAnonymous, OriginAttributes());
   }
 
   OriginAttributes oa;
   aLoadContext->GetOriginAttributes(oa);
 
 #ifdef DEBUG
-  nsCOMPtr<nsIDocShellTreeItem> docShell = do_QueryInterface(aLoadContext);
-  if (!docShell || docShell->ItemType() != nsIDocShellTreeItem::typeChrome) {
+  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(aLoadContext);
+  if (!docShell ||
+      nsDocShell::Cast(docShell)->GetBrowsingContext()->IsContent()) {
     MOZ_ASSERT(aLoadContext->UsePrivateBrowsing() ==
                (oa.mPrivateBrowsingId > 0));
   }
 #endif
 
   return new LoadContextInfo(aIsAnonymous, oa);
 }