Bug 1663487 - Set loading history entry for loads in the parent. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D89420
This commit is contained in:
Peter Van der Beken 2020-09-09 00:40:38 +00:00
parent fe3f64a907
commit 709c5edefe
3 changed files with 14 additions and 0 deletions

View File

@ -13001,5 +13001,7 @@ bool nsDocShell::GetIsAttemptingToNavigate() {
void nsDocShell::SetLoadingSessionHistoryInfo(
const mozilla::dom::LoadingSessionHistoryInfo& aLoadingInfo) {
// FIXME Would like to assert this, but can't yet.
// MOZ_ASSERT(!mLoadingEntry);
mLoadingEntry = MakeUnique<LoadingSessionHistoryInfo>(aLoadingInfo);
}

View File

@ -274,6 +274,12 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
uint64_t GetLoadIdentifier() const { return mLoadIdentifier; }
uint32_t GetLoadType() const { return mLoadStateLoadType; }
mozilla::dom::LoadingSessionHistoryInfo* GetLoadingSessionHistoryInfo() {
return mLoadingSessionHistoryInfo.get();
}
bool IsDocumentLoad() const { return mIsDocumentLoad; }
protected:
virtual ~DocumentLoadListener();

View File

@ -68,6 +68,12 @@ ParentProcessDocumentChannel::RedirectToRealChannel(
}
mStreamFilterEndpoints = std::move(aStreamFilterEndpoints);
if (mDocumentLoadListener->IsDocumentLoad() &&
StaticPrefs::fission_sessionHistoryInParent() && GetDocShell()) {
GetDocShell()->SetLoadingSessionHistoryInfo(
*mDocumentLoadListener->GetLoadingSessionHistoryInfo());
}
RefPtr<RedirectToRealChannelPromise> p = mPromise.Ensure(__func__);
// We make the promise use direct task dispatch in order to reduce the number
// of event loops iterations.