Bug 1666465 - Pass the correct value as the 'persist' parameter in CanonicalBrowsingContext::SessionHistoryCommit, r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D90995
This commit is contained in:
Olli Pettay 2020-09-22 16:27:14 +00:00
Родитель 5ea0bbd246
Коммит b6a8ca7795
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -356,6 +356,11 @@ CanonicalBrowsingContext::CreateLoadingSessionHistoryEntryForLoad(
entry = SessionHistoryEntry::GetByLoadId(existingLoadingInfo->mLoadId);
} else {
entry = new SessionHistoryEntry(aLoadState, aChannel);
if (IsTop()) {
// Only top level pages care about Get/SetPersist.
entry->SetPersist(
nsDocShell::ShouldAddToSessionHistory(aLoadState->URI(), aChannel));
}
entry->SetDocshellID(GetHistoryID());
entry->SetIsDynamicallyAdded(GetCreatedDynamically());
entry->SetForInitialLoad(true);
@ -427,8 +432,7 @@ void CanonicalBrowsingContext::SessionHistoryCommit(uint64_t aLoadId,
}
if (addEntry) {
shistory->AddEntry(mActiveEntry,
/* FIXME aPersist = */ true);
shistory->AddEntry(mActiveEntry, mActiveEntry->GetPersist());
}
}
} else {

Просмотреть файл

@ -140,7 +140,7 @@ class SessionHistoryInfo {
bool mURIWasModified = false;
bool mIsSrcdocEntry = false;
bool mScrollRestorationIsManual = false;
bool mPersist = false;
bool mPersist = true;
union SharedState {
SharedState();