Bug 1597420 - Remove nsIDocShellTreeItem from nsDOMNavigationTiming. r=kmag
authorTom Schuster <evilpies@gmail.com>
Mon, 16 Dec 2019 21:15:05 +0000
changeset 507320 bb5a4bc0cbb4a64445e0170f1cafcc52c9209833
parent 507319 925283bff9408dd5c5de28a242990247aababb67
child 507321 12b52bc98c6f7be3fe8ec888ec05fc8bd7cf983f
push id103357
push userevilpies@gmail.com
push dateMon, 16 Dec 2019 22:09:09 +0000
treeherderautoland@bb5a4bc0cbb4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1597420
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 1597420 - Remove nsIDocShellTreeItem from nsDOMNavigationTiming. r=kmag Differential Revision: https://phabricator.services.mozilla.com/D57372
dom/base/nsDOMNavigationTiming.cpp
--- a/dom/base/nsDOMNavigationTiming.cpp
+++ b/dom/base/nsDOMNavigationTiming.cpp
@@ -6,17 +6,16 @@
 
 #include "nsDOMNavigationTiming.h"
 
 #include "GeckoProfiler.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsDocShell.h"
 #include "nsHttp.h"
-#include "nsIDocShellTreeItem.h"
 #include "nsIScriptSecurityManager.h"
 #include "prtime.h"
 #include "nsIURI.h"
 #include "nsPrintfCString.h"
 #include "mozilla/dom/PerformanceNavigation.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Telemetry.h"
 #ifdef MOZ_GECKO_PROFILER
@@ -528,16 +527,10 @@ mozilla::TimeStamp nsDOMNavigationTiming
 
 bool nsDOMNavigationTiming::IsTopLevelContentDocumentInContentProcess() const {
   if (!mDocShell) {
     return false;
   }
   if (!XRE_IsContentProcess()) {
     return false;
   }
-  nsCOMPtr<nsIDocShellTreeItem> rootItem;
-  Unused << mDocShell->GetInProcessSameTypeRootTreeItem(
-      getter_AddRefs(rootItem));
-  if (rootItem.get() != static_cast<nsIDocShellTreeItem*>(mDocShell.get())) {
-    return false;
-  }
-  return rootItem->ItemType() == nsIDocShellTreeItem::typeContent;
+  return mDocShell->GetBrowsingContext()->IsTopContent();
 }