mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1700719 - Discard-check all ancestors before restoring, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D109722
This commit is contained in:
parent
76329096fd
commit
5c37b3d6b9
@ -1745,6 +1745,8 @@ void CanonicalBrowsingContext::SetRestoreData(SessionStoreRestoreData* aData) {
|
||||
|
||||
void CanonicalBrowsingContext::RequestRestoreTabContent(
|
||||
WindowGlobalParent* aWindow) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(IsTop());
|
||||
|
||||
if (IsDiscarded() || !mRestoreData || mRestoreData->IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
@ -1301,9 +1301,9 @@ mozilla::ipc::IPCResult WindowGlobalParent::RecvResetSessionStore(
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult WindowGlobalParent::RecvRequestRestoreTabContent() {
|
||||
CanonicalBrowsingContext* bc = BrowsingContext()->Top();
|
||||
if (bc && !bc->IsDiscarded()) {
|
||||
bc->RequestRestoreTabContent(this);
|
||||
CanonicalBrowsingContext* bc = BrowsingContext();
|
||||
if (bc && bc->AncestorsAreCurrent()) {
|
||||
bc->Top()->RequestRestoreTabContent(this);
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ RestoreTabContentObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
}
|
||||
if (XRE_IsParentProcess()) {
|
||||
if (WindowGlobalParent* wgp = bc->Canonical()->GetCurrentWindowGlobal()) {
|
||||
bc->Canonical()->RequestRestoreTabContent(wgp);
|
||||
bc->Canonical()->Top()->RequestRestoreTabContent(wgp);
|
||||
}
|
||||
} else if (WindowContext* windowContext = bc->GetCurrentWindowContext()) {
|
||||
if (WindowGlobalChild* wgc = windowContext->GetWindowGlobalChild()) {
|
||||
|
Loading…
Reference in New Issue
Block a user