Bug 1540839 - Add ability to preserve browsing contexts between FrameLoaders; r=nika

When changing processes and therefore destroying/rebuilding
frameloaders, add ability to keep the browsing context around and add
it to the new frameloader.

Differential Revision: https://phabricator.services.mozilla.com/D26267
This commit is contained in:
Kyle Machulis
2019-04-03 15:40:28 -07:00
parent 0a2f35d5bc
commit d29c67c357
14 changed files with 87 additions and 13 deletions

View File

@@ -385,7 +385,8 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext)
mHasLoadedNonBlankURI(false),
mBlankTiming(false),
mTitleValidForCurrentURI(false),
mIsFrame(false) {
mIsFrame(false),
mSkipBrowsingContextDetachOnDestroy(false) {
mHistoryID.m0 = 0;
mHistoryID.m1 = 0;
mHistoryID.m2 = 0;
@@ -5036,7 +5037,11 @@ nsDocShell::Destroy() {
mSessionHistory = nullptr;
}
mBrowsingContext->Detach();
// This will be skipped in cases where we want to preserve the browsing
// context between loads.
if (!mSkipBrowsingContextDetachOnDestroy) {
mBrowsingContext->Detach();
}
SetTreeOwner(nullptr);