зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1597442 - Remove the usage of nsIDocShellTreeItem from nsJSContext::MaybeRunNextCollectorSlice(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63609 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
841aeea2ab
Коммит
19cfb39679
|
@ -52,6 +52,7 @@
|
|||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/StaticPrefs_javascript.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/dom/BrowsingContext.h"
|
||||
#include "mozilla/dom/DOMException.h"
|
||||
#include "mozilla/dom/DOMExceptionBinding.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
@ -2012,14 +2013,23 @@ void nsJSContext::MaybeRunNextCollectorSlice(nsIDocShell* aDocShell,
|
|||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
aDocShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
|
||||
if (root == aDocShell) {
|
||||
BrowsingContext* bc = aDocShell->GetBrowsingContext();
|
||||
if (!bc) {
|
||||
return;
|
||||
}
|
||||
|
||||
BrowsingContext* root = bc->Top();
|
||||
if (bc == root) {
|
||||
// We don't want to run collectors when loading the top level page.
|
||||
return;
|
||||
}
|
||||
|
||||
Document* rootDocument = root->GetDocument();
|
||||
nsIDocShell* rootDocShell = root->GetDocShell();
|
||||
if (!rootDocShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
Document* rootDocument = rootDocShell->GetDocument();
|
||||
if (!rootDocument ||
|
||||
rootDocument->GetReadyStateEnum() != Document::READYSTATE_COMPLETE ||
|
||||
rootDocument->IsInBackgroundWindow()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче