Bug 999239: Copy session history when recreating browser element for the remote -> non-remote transition. r=bz, r=felipe, sr=gavin

This commit is contained in:
Dave Townsend
2014-09-25 11:35:45 -07:00
parent 1861cd1bc0
commit 5482e7f73a
15 changed files with 313 additions and 77 deletions

View File

@@ -9838,7 +9838,18 @@ nsDocShell::InternalLoad(nsIURI * aURI,
return NS_OK;
}
}
// Check if the webbrowser chrome wants the load to proceed; this can be
// used to cancel attempts to load URIs in the wrong process.
nsCOMPtr<nsIWebBrowserChrome3> browserChrome3 = do_GetInterface(mTreeOwner);
if (browserChrome3) {
bool shouldLoad;
rv = browserChrome3->ShouldLoadURI(this, aURI, aReferrer, &shouldLoad);
if (NS_SUCCEEDED(rv) && !shouldLoad) {
return NS_OK;
}
}
// mContentViewer->PermitUnload can destroy |this| docShell, which
// causes the next call of CanSavePresentation to crash.
// Hold onto |this| until we return, to prevent a crash from happening.