Bug 1310766 - Part 1: Close inactive frameloaders when destroying frameloader rather than when closing tab, r=ehsan

MozReview-Commit-ID: FHKRe9dFDYt

--HG--
extra : rebase_source : 7e8748198b96085a1f3e9561ae6bc1d51271f6ff
This commit is contained in:
Michael Layzell 2016-12-15 13:17:16 +08:00
parent 714e747215
commit 79e5a00cd7
2 changed files with 5 additions and 7 deletions

View File

@ -2527,13 +2527,6 @@
var browser = this.getBrowserForTab(aTab);
// Start closing the FrameLoaderOwners which are inactive, so that
// they are cleaned up as well.
let frameLoader = browser.frameLoader;
if (frameLoader && frameLoader.groupedSessionHistory) {
frameLoader.groupedSessionHistory.closeInactiveFrameLoaderOwners();
}
if (!aTab._pendingPermitUnload && !aAdoptedByTab && !aSkipPermitUnload) {
// We need to block while calling permitUnload() because it
// processes the event queue and may lead to another removeTab()

View File

@ -1988,6 +1988,11 @@ nsFrameLoader::StartDestroy()
}
}
// Destroy the other frame loader owners now that we are being destroyed.
if (mGroupedSessionHistory) {
mGroupedSessionHistory->CloseInactiveFrameLoaderOwners();
}
nsCOMPtr<nsIRunnable> destroyRunnable = new nsFrameLoaderDestroyRunnable(this);
if (mNeedsAsyncDestroy || !doc ||
NS_FAILED(doc->FinalizeFrameLoader(this, destroyRunnable))) {