зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1597482 - Replace nsIDocShellTreeItem with BrowsingContext in GetProfileTimelineSubDocShells. r=mstange
`GetProfileTimelineSubDocShells` was using nsIDocShellTreeItem to walk the DocShells that are visible and recording profile markers. This change switches to using `BrowsingContext` for the walk, and ignores OOP iframes as they aren't painting in the current process. Differential Revision: https://phabricator.services.mozilla.com/D63960 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d25deeb630
Коммит
e2d402b50d
|
@ -1592,29 +1592,27 @@ static void GetProfileTimelineSubDocShells(nsDocShell* aRootDocShell,
|
|||
return;
|
||||
}
|
||||
|
||||
nsTArray<RefPtr<nsIDocShell>> docShells;
|
||||
nsresult rv = aRootDocShell->GetAllDocShellsInSubtree(
|
||||
nsIDocShellTreeItem::typeAll, nsIDocShell::ENUMERATE_BACKWARDS,
|
||||
docShells);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
RefPtr<BrowsingContext> bc = aRootDocShell->GetBrowsingContext();
|
||||
if (!bc) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& curItem : docShells) {
|
||||
if (!curItem->GetRecordProfileTimelineMarkers()) {
|
||||
continue;
|
||||
bc->PostOrderWalk([&](BrowsingContext* aContext) {
|
||||
nsDocShell* shell = nsDocShell::Cast(aContext->GetDocShell());
|
||||
if (!shell || !shell->GetRecordProfileTimelineMarkers()) {
|
||||
// This process isn't painting OOP iframes so we ignore
|
||||
// docshells that are OOP.
|
||||
return;
|
||||
}
|
||||
|
||||
nsDocShell* shell = static_cast<nsDocShell*>(curItem.get());
|
||||
bool isVisible = false;
|
||||
shell->GetVisibility(&isVisible);
|
||||
if (!isVisible) {
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
aShells.AppendElement(shell);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void TakeFrameRequestCallbacksFrom(
|
||||
|
|
Загрузка…
Ссылка в новой задаче