Bug 1757458, replace loading session history entry only right before redirecting load to real channel r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D140559
This commit is contained in:
Olli Pettay
2022-03-10 10:41:20 +00:00
parent e894c9f62e
commit d4a2bb0a3e
8 changed files with 71 additions and 20 deletions

View File

@@ -576,13 +576,12 @@ CanonicalBrowsingContext::CreateLoadingSessionHistoryEntryForLoad(
UniquePtr<LoadingSessionHistoryInfo>
CanonicalBrowsingContext::ReplaceLoadingSessionHistoryEntryForLoad(
LoadingSessionHistoryInfo* aInfo, nsIChannel* aOldChannel,
nsIChannel* aNewChannel) {
LoadingSessionHistoryInfo* aInfo, nsIChannel* aNewChannel) {
MOZ_ASSERT(aInfo);
MOZ_ASSERT(aNewChannel);
SessionHistoryInfo newInfo = SessionHistoryInfo(
aOldChannel, aNewChannel, aInfo->mInfo.LoadType(),
aNewChannel, aInfo->mInfo.LoadType(),
aInfo->mInfo.GetPartitionedPrincipalToInherit(), aInfo->mInfo.GetCsp());
for (size_t i = 0; i < mLoadingEntries.Length(); ++i) {