Bug 1597499 - Make Session Restore work in Fission, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D107883
This commit is contained in:
@@ -6555,6 +6555,12 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
|
||||
//
|
||||
nsCOMPtr<nsIDocShell> kungFuDeathGrip(this);
|
||||
|
||||
// We'll never need to restore data into an about:blank document, so we can
|
||||
// ignore those here.
|
||||
if (!NS_IsAboutBlank(url)) {
|
||||
MaybeRestoreTabContent();
|
||||
}
|
||||
|
||||
// Notify the ContentViewer that the Document has finished loading. This
|
||||
// will cause any OnLoad(...) and PopState(...) handlers to fire.
|
||||
if (!mEODForCurrentDocument && mContentViewer) {
|
||||
@@ -13304,6 +13310,23 @@ void nsDocShell::NotifyJSRunToCompletionStop() {
|
||||
}
|
||||
}
|
||||
|
||||
void nsDocShell::MaybeRestoreTabContent() {
|
||||
BrowsingContext* bc = mBrowsingContext;
|
||||
if (bc && bc->Top()->GetHasRestoreData()) {
|
||||
if (XRE_IsParentProcess()) {
|
||||
if (WindowGlobalParent* wgp = bc->Canonical()->GetCurrentWindowGlobal()) {
|
||||
bc->Canonical()->RequestRestoreTabContent(wgp);
|
||||
}
|
||||
} else {
|
||||
if (WindowContext* windowContext = bc->GetCurrentWindowContext()) {
|
||||
if (WindowGlobalChild* wgc = windowContext->GetWindowGlobalChild()) {
|
||||
wgc->SendRequestRestoreTabContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
void nsDocShell::MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
|
||||
const nsString& aKeyword) {
|
||||
|
||||
Reference in New Issue
Block a user