Bug 1725680, requested index should be used only by the nsSHistory (and related code in CanonicalBrowsingContext), r=peterv

Using requestedIndex on the child side is hard, because there are race conditions when a session history load is triggered
and at the same time a non-session history load commits a new active entry.

Differential Revision: https://phabricator.services.mozilla.com/D126619
This commit is contained in:
Olli Pettay
2021-09-29 13:22:34 +00:00
parent 1af8c5c2f6
commit 7ecc9afd1d
18 changed files with 150 additions and 71 deletions

View File

@@ -3426,10 +3426,8 @@ void BrowsingContext::SessionHistoryCommit(
changeID = rootSH->AddPendingHistoryChange();
}
} else {
// This is a load from session history, so we can update
// index and length immediately.
rootSH->SetIndexAndLength(aInfo.mRequestedIndex,
aInfo.mSessionHistoryLength, changeID);
// History load doesn't change the length, only index.
changeID = rootSH->AddPendingHistoryChange(aInfo.mOffset, 0);
}
}
ContentChild* cc = ContentChild::GetSingleton();