Bug 1303167 P2 Use new window suspend and freeze methods. r=smaug

* * *
Bug 1303167 P2 interdiff 0001 Review feedback
This commit is contained in:
Ben Kelly
2016-10-26 10:20:15 -07:00
parent 45fce3ebba
commit cfc08923aa
12 changed files with 88 additions and 86 deletions

View File

@@ -8764,7 +8764,6 @@ nsDocShell::RestoreFromHistory()
}
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDoc);
uint32_t parentSuspendCount = 0;
if (document) {
RefPtr<nsDocShell> parent = GetParentDocshell();
if (parent) {
@@ -8780,10 +8779,6 @@ nsDocShell::RestoreFromHistory()
document->SuppressEventHandling(nsIDocument::eAnimationsOnly,
d->AnimationsPaused());
}
if (nsCOMPtr<nsPIDOMWindowOuter> parentWindow = d->GetWindow()) {
parentSuspendCount = parentWindow->TimeoutSuspendCount();
}
}
}
@@ -8920,16 +8915,16 @@ nsDocShell::RestoreFromHistory()
}
}
nsCOMPtr<nsPIDOMWindowInner> privWinInner = privWin->GetCurrentInnerWindow();
// If parent is suspended, increase suspension count.
// This can't be done as early as event suppression since this
// depends on docshell tree.
if (parentSuspendCount) {
privWin->SuspendTimeouts(parentSuspendCount, false);
}
privWinInner->NewSyncStateFromParentWindow();
// Now that all of the child docshells have been put into place, we can
// restart the timers for the window and all of the child frames.
privWin->ResumeTimeouts();
privWinInner->NewResume();
// Restore the refresh URI list. The refresh timers will be restarted
// when EndPageLoad() is called.