mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1597453 - Fix uses of nsIDocShellTreeItem in mozilla::dom::PerformanceTiming::IsTopLevelContentDocument. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D59454 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
1968353c48
commit
e8ac806cd3
@ -11,6 +11,7 @@
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "mozilla/dom/BrowsingContext.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsITimedChannel.h"
|
||||
|
||||
@ -616,17 +617,11 @@ bool PerformanceTiming::IsTopLevelContentDocument() const {
|
||||
if (!document) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIDocShell> docShell = document->GetDocShell();
|
||||
if (!docShell) {
|
||||
return false;
|
||||
|
||||
if (BrowsingContext* bc = document->GetBrowsingContext()) {
|
||||
return bc->IsTopContent();
|
||||
}
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootItem;
|
||||
Unused << docShell->GetInProcessSameTypeRootTreeItem(
|
||||
getter_AddRefs(rootItem));
|
||||
if (rootItem.get() != static_cast<nsIDocShellTreeItem*>(docShell.get())) {
|
||||
return false;
|
||||
}
|
||||
return rootItem->ItemType() == nsIDocShellTreeItem::typeContent;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsTArray<nsCOMPtr<nsIServerTiming>> PerformanceTimingData::GetServerTiming() {
|
||||
|
Loading…
Reference in New Issue
Block a user