Bug 1667449 - Hide fission.sessionHistoryInParent pref getter behind a function r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D91462
This commit is contained in:
Olli Pettay
2020-09-28 12:01:12 +00:00
parent 5e1d0cbcd2
commit 517a59e62b
50 changed files with 169 additions and 212 deletions

View File

@@ -163,6 +163,7 @@
#include "nsIWindowWatcher.h"
#include "nsIWritablePropertyBag2.h"
#include "nsIX509Cert.h"
#include "nsIXULRuntime.h"
#include "nsCommandManager.h"
#include "nsPIDOMWindow.h"
@@ -830,7 +831,7 @@ nsresult nsDocShell::LoadURI(nsDocShellLoadState* aLoadState,
MOZ_LOG(gSHLog, LogLevel::Debug,
("nsDocShell[%p]: loading from session history", this));
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
return LoadHistoryEntry(aLoadState->SHEntry(), aLoadState->LoadType());
}
@@ -925,7 +926,7 @@ bool nsDocShell::MaybeHandleSubframeHistory(
parentDS->GetLoadType(&parentLoadType);
if (!aContinueHandlingSubframeHistory) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (nsDocShell::Cast(parentDS.get())->IsLoadingFromSessionHistory() &&
!GetCreatedDynamically()) {
if (XRE_IsContentProcess()) {
@@ -1146,7 +1147,7 @@ void nsDocShell::FirePageHideNotificationInternal(
MOZ_LOG(
gSHLog, LogLevel::Debug,
("nsDocShell %p unloading, remove dynamic subframe entries", this));
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (mActiveEntry) {
mBrowsingContext->RemoveDynEntriesFromActiveSessionHistoryEntry();
}
@@ -1404,7 +1405,7 @@ bool nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
bool isRoot = mBrowsingContext->IsTop();
bool isSubFrame = false; // Is this a subframe navigation?
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (mLoadingEntry) {
isSubFrame = mLoadingEntry->mInfo.IsSubFrame();
MOZ_LOG(gSHLog, LogLevel::Debug,
@@ -2720,7 +2721,7 @@ void nsDocShell::StoreWindowNameToSHEntries() {
mOSHE, [&](nsISHEntry* aEntry) { aEntry->SetName(name); });
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (XRE_IsParentProcess()) {
SessionHistoryEntry* entry =
mBrowsingContext->Canonical()->GetActiveSessionHistoryEntry();
@@ -3051,7 +3052,7 @@ nsresult nsDocShell::AddChildSHEntry(nsISHEntry* aCloneRef,
nsISHEntry* aNewEntry,
int32_t aChildOffset, uint32_t aLoadType,
bool aCloneChildren) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!mozilla::SessionHistoryInParent());
nsresult rv = NS_OK;
if (mLSHE && aLoadType != LOAD_PUSHSTATE) {
@@ -3079,7 +3080,7 @@ nsresult nsDocShell::AddChildSHEntry(nsISHEntry* aCloneRef,
nsresult nsDocShell::AddChildSHEntryToParent(nsISHEntry* aNewEntry,
int32_t aChildOffset,
bool aCloneChildren) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!mozilla::SessionHistoryInParent());
/* You will get here when you are in a subframe and
* a new url has been loaded on you.
* The mOSHE in this subframe will be the previous url's
@@ -3240,7 +3241,7 @@ nsDocShell::GetDeviceSizeIsPageSize(bool* aValue) {
}
void nsDocShell::ClearFrameHistory(nsISHEntry* aEntry) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!mozilla::SessionHistoryInParent());
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
if (!rootSH || !aEntry) {
return;
@@ -3982,7 +3983,7 @@ nsresult nsDocShell::LoadErrorPage(nsIURI* aErrorURI, nsIURI* aFailedURI,
// identifier, the error page won't persist.
mLSHE->AbandonBFCacheEntry();
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
// Commit the loading entry for the real load here, Embed will not commit
// the loading entry for the error page. History will then contain an entry
// for the real load, and the error page won't persist if we try loading
@@ -4018,7 +4019,7 @@ nsDocShell::Reload(uint32_t aReloadFlags) {
// Send notifications to the HistoryListener if any, about the impending
// reload
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug, ("nsDocShell %p Reload", this));
bool forceReload = IsForceReloadType(loadType);
if (!XRE_IsParentProcess()) {
@@ -4284,7 +4285,7 @@ nsDocShell::LoadPageAsViewSource(nsIDocShell* aOtherDocShell,
RefPtr<nsDocShellLoadState> loadState;
uint32_t cacheKey;
auto* otherDocShell = nsDocShell::Cast(aOtherDocShell);
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
loadState = new nsDocShellLoadState(newURI);
if (!otherDocShell->FillLoadStateFromCurrentEntry(*loadState)) {
return NS_ERROR_INVALID_POINTER;
@@ -4342,7 +4343,7 @@ nsDocShell::GetCurrentDescriptor(nsISupports** aPageDescriptor) {
already_AddRefed<nsIInputStream> nsDocShell::GetPostDataFromCurrentEntry()
const {
nsCOMPtr<nsIInputStream> postData;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (mActiveEntry) {
postData = mActiveEntry->GetPostData();
} else if (mLoadingEntry) {
@@ -4360,7 +4361,7 @@ already_AddRefed<nsIInputStream> nsDocShell::GetPostDataFromCurrentEntry()
}
Maybe<uint32_t> nsDocShell::GetCacheKeyFromCurrentEntry() const {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (mActiveEntry) {
return Some(mActiveEntry->GetCacheKey());
}
@@ -5683,8 +5684,7 @@ nsresult nsDocShell::Embed(nsIContentViewer* aContentViewer,
NS_ENSURE_SUCCESS(rv, rv);
// XXX What if SetupNewViewer fails?
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mLoadingEntry
: !!mLSHE) {
if (mozilla::SessionHistoryInParent() ? !!mLoadingEntry : !!mLSHE) {
// Set history.state
SetDocCurrentStateObj(mLSHE,
mLoadingEntry ? &mLoadingEntry->mInfo : nullptr);
@@ -5699,8 +5699,7 @@ nsresult nsDocShell::Embed(nsIContentViewer* aContentViewer,
SetHistoryEntryAndUpdateBC(Nothing(), Some<nsISHEntry*>(mLSHE));
}
if (!aIsTransientAboutBlank &&
StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!aIsTransientAboutBlank && mozilla::SessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug, ("document %p Embed", this));
MoveLoadingToActiveEntry(mLoadType != LOAD_ERROR_PAGE);
}
@@ -7003,7 +7002,7 @@ nsresult nsDocShell::CaptureState() {
if (MOZ_UNLIKELY(MOZ_LOG_TEST(gPageCacheLog, LogLevel::Debug))) {
nsAutoCString spec;
nsCOMPtr<nsIURI> uri;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
uri = mActiveEntry->GetURI();
} else {
uri = mOSHE->GetURI();
@@ -7325,7 +7324,7 @@ nsresult nsDocShell::RestoreFromHistory() {
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
if (rootSH) {
mPreviousEntryIndex = rootSH->Index();
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
rootSH->LegacySHistory()->UpdateIndex();
}
mLoadedEntryIndex = rootSH->Index();
@@ -7854,8 +7853,7 @@ nsresult nsDocShell::CreateContentViewer(const nsACString& aContentType,
// Be sure to have a correct mLSHE, it may have been cleared by
// EndPageLoad. See bug 302115.
ChildSHistory* shistory = GetSessionHistory();
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup() && shistory &&
!mLSHE) {
if (!mozilla::SessionHistoryInParent() && shistory && !mLSHE) {
int32_t idx = shistory->LegacySHistory()->GetRequestedIndex();
if (idx == -1) {
idx = shistory->Index();
@@ -8195,7 +8193,7 @@ void nsDocShell::SetDocCurrentStateObj(nsISHEntry* aShEntry,
NS_ENSURE_TRUE_VOID(document);
nsCOMPtr<nsIStructuredCloneContainer> scContainer;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
// If aInfo is null, just set the document's state object to null.
if (aInfo) {
scContainer = aInfo->GetStateData();
@@ -8623,7 +8621,7 @@ bool nsDocShell::IsSameDocumentNavigation(nsDocShellLoadState* aLoadState,
}
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (mActiveEntry && aLoadState->LoadIsFromSessionHistory()) {
aState.mHistoryNavBetweenSameDoc = mActiveEntry->SharesDocumentWith(
aLoadState->GetLoadingSessionHistoryInfo()->mInfo);
@@ -8643,7 +8641,7 @@ bool nsDocShell::IsSameDocumentNavigation(nsDocShellLoadState* aLoadState,
#ifdef DEBUG
if (aState.mHistoryNavBetweenSameDoc) {
nsCOMPtr<nsIInputStream> currentPostData;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
currentPostData = mActiveEntry->GetPostData();
} else {
currentPostData = mOSHE->GetPostData();
@@ -8667,7 +8665,7 @@ bool nsDocShell::IsSameDocumentNavigation(nsDocShellLoadState* aLoadState,
// The restriction that the SHEntries in (a) must be different ensures
// that history.go(0) and the like trigger full refreshes, rather than
// same document navigations.
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
bool doSameDocumentNavigation =
(aState.mHistoryNavBetweenSameDoc && mOSHE != aLoadState->SHEntry()) ||
(!aLoadState->SHEntry() && !aLoadState->PostDataStream() &&
@@ -8744,9 +8742,8 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
nsCOMPtr<nsIPrincipal> newURITriggeringPrincipal, newURIPrincipalToInherit,
newURIPartitionedPrincipalToInherit;
nsCOMPtr<nsIContentSecurityPolicy> newCsp;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent() ? !!mActiveEntry : !!mOSHE) {
if (mozilla::SessionHistoryInParent()) {
newURITriggeringPrincipal = mActiveEntry->GetTriggeringPrincipal();
newURIPrincipalToInherit = mActiveEntry->GetPrincipalToInherit();
newURIPartitionedPrincipalToInherit =
@@ -8781,9 +8778,8 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
uint32_t cacheKey = 0;
bool scrollRestorationIsManual = false;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent() ? !!mActiveEntry : !!mOSHE) {
if (mozilla::SessionHistoryInParent()) {
// FIXME Need to set scroll position on mActiveEntry.
scrollRestorationIsManual = mActiveEntry->GetScrollRestorationIsManual();
} else {
@@ -8798,7 +8794,7 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
// above -- it filters out some LOAD_CMD_NORMAL cases that we
// wouldn't want here.
if (aLoadState->LoadType() & LOAD_CMD_NORMAL) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
postData = mActiveEntry->GetPostData();
cacheKey = mActiveEntry->GetCacheKey();
} else {
@@ -8831,7 +8827,7 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
// If we're doing a history load, use its scroll restoration state.
if (aLoadState->LoadIsFromSessionHistory()) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
scrollRestorationIsManual = aLoadState->GetLoadingSessionHistoryInfo()
->mInfo.GetScrollRestorationIsManual();
} else {
@@ -8862,8 +8858,7 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
SetCacheKeyOnHistoryEntry(mOSHE, cacheKey);
}
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() &&
mLoadingEntry) {
if (mozilla::SessionHistoryInParent() && mLoadingEntry) {
MOZ_LOG(
gSHLog, LogLevel::Debug,
("Moving the loading entry to the active entry on nsDocShell %p to %s",
@@ -8933,13 +8928,12 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
nscoord bx = 0;
nscoord by = 0;
bool needsScrollPosUpdate = false;
if ((StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) &&
if ((mozilla::SessionHistoryInParent() ? !!mActiveEntry : !!mOSHE) &&
(aLoadState->LoadType() == LOAD_HISTORY ||
aLoadState->LoadType() == LOAD_RELOAD_NORMAL) &&
!scrollRestorationIsManual) {
needsScrollPosUpdate = true;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
mActiveEntry->GetScrollPosition(&bx, &by);
} else {
mOSHE->GetScrollPosition(&bx, &by);
@@ -9257,7 +9251,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
SetHistoryEntryAndUpdateBC(Some<nsISHEntry*>(aLoadState->SHEntry()),
Nothing());
if (aLoadState->LoadIsFromSessionHistory() &&
!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
!mozilla::SessionHistoryInParent()) {
// We're making history navigation or a reload. Make sure our history ID
// points to the same ID as SHEntry's docshell ID.
nsID historyID = {};
@@ -9283,7 +9277,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
if (shistory) {
shistory->RemovePendingHistoryNavigations();
}
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
// It's possible that the previous viewer of mContentViewer is the
// viewer that will end up in aLoadState->SHEntry() when it gets closed.
// If that's the case, we need to go ahead and force it into its shentry
@@ -10085,7 +10079,7 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
uint32_t cacheKey = 0;
if (aCacheKey) {
cacheKey = *aCacheKey;
} else if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
} else if (mozilla::SessionHistoryInParent()) {
if (mLoadingEntry) {
cacheKey = mLoadingEntry->mInfo.GetCacheKey();
} else if (mActiveEntry) { // for reload cases
@@ -10656,8 +10650,7 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
* Hopefully I don't have to do that.
*/
if (equalUri &&
(StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) &&
(mozilla::SessionHistoryInParent() ? !!mActiveEntry : !!mOSHE) &&
(mLoadType == LOAD_NORMAL || mLoadType == LOAD_LINK ||
mLoadType == LOAD_STOP_CONTENT) &&
!inputStream) {
@@ -10691,14 +10684,14 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
SetCacheKeyOnHistoryEntry(mLSHE ? mLSHE : mOSHE, cacheKey);
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
// Since we're force-reloading, clear all the sub frame history.
ClearFrameHistory(mLSHE);
ClearFrameHistory(mOSHE);
}
}
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
// Clear subframe history on refresh.
// XXX: history.go(0) won't go this path as aLoadType is LOAD_HISTORY in
// this case. One should re-validate after bug 1331865 fixed.
@@ -10748,11 +10741,11 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
// If this was a history load or a refresh, or it was a history load but
// later changed to LOAD_NORMAL_REPLACE due to redirection, update the index
// in session history.
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup() && rootSH &&
if (!mozilla::SessionHistoryInParent() && rootSH &&
((mLoadType & (LOAD_CMD_HISTORY | LOAD_CMD_RELOAD)) ||
mLoadType == LOAD_NORMAL_REPLACE)) {
mPreviousEntryIndex = rootSH->Index();
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
rootSH->LegacySHistory()->UpdateIndex();
}
mLoadedEntryIndex = rootSH->Index();
@@ -10998,7 +10991,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
aNewURI->EqualsExceptRef(aCurrentURI, &sameExceptHashes);
bool uriWasModified;
if (sameExceptHashes) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
uriWasModified = mActiveEntry && mActiveEntry->GetURIWasModified();
} else {
uriWasModified = oldOSHE && oldOSHE->GetURIWasModified();
@@ -11023,7 +11016,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
nsPoint scrollPos = GetCurScrollPos();
bool scrollRestorationIsManual;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
// FIXME Need to save the current scroll position on mActiveEntry.
scrollRestorationIsManual = mActiveEntry->GetScrollRestorationIsManual();
} else {
@@ -11035,7 +11028,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
nsCOMPtr<nsIContentSecurityPolicy> csp = aDocument->GetCsp();
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug,
("nsDocShell %p UpdateActiveEntry (not replacing)", this));
nsString title(mActiveEntry->GetTitle());
@@ -11075,7 +11068,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
// we'll just set mOSHE here.
mOSHE = newSHEntry;
}
} else if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
} else if (mozilla::SessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug,
("nsDocShell %p UpdateActiveEntry (replacing)", this));
// Setting the resultPrincipalURI to nullptr is fine here: it will cause
@@ -11111,7 +11104,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
newSHEntry->SetLoadReplace(false);
}
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!mozilla::SessionHistoryInParent()) {
// Step 2.4 and 3: Modify new/original session history entry and clear its
// POST data, if there is any.
newSHEntry->SetStateData(aData);
@@ -11178,7 +11171,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
NS_IMETHODIMP
nsDocShell::GetCurrentScrollRestorationIsManual(bool* aIsManual) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
*aIsManual = mActiveEntry && mActiveEntry->GetScrollRestorationIsManual();
return NS_OK;
}
@@ -11286,8 +11279,7 @@ nsresult nsDocShell::AddToSessionHistory(
nsISHEntry** aNewEntry) {
MOZ_ASSERT(aURI, "uri is null");
MOZ_ASSERT(!aChannel || !aTriggeringPrincipal, "Shouldn't have both set");
MOZ_DIAGNOSTIC_ASSERT(
!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_DIAGNOSTIC_ASSERT(!mozilla::SessionHistoryInParent());
#if defined(DEBUG)
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
@@ -11505,7 +11497,7 @@ void nsDocShell::UpdateActiveEntry(
nsIContentSecurityPolicy* aCsp, const nsAString& aTitle,
const Maybe<bool>& aScrollRestorationIsManual,
nsIStructuredCloneContainer* aData, bool aURIWasModified) {
MOZ_ASSERT(StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(mozilla::SessionHistoryInParent());
MOZ_ASSERT(aURI, "uri is null");
MOZ_ASSERT(mLoadType == LOAD_PUSHSTATE,
"This code only deals with pushState");
@@ -11651,10 +11643,9 @@ NS_IMETHODIMP
nsDocShell::PersistLayoutHistoryState() {
nsresult rv = NS_OK;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) {
if (mozilla::SessionHistoryInParent() ? !!mActiveEntry : !!mOSHE) {
bool scrollRestorationIsManual;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
scrollRestorationIsManual = mActiveEntry->GetScrollRestorationIsManual();
} else {
scrollRestorationIsManual = mOSHE->GetScrollRestorationIsManual();
@@ -12102,7 +12093,7 @@ nsDocShell::GetIsExecutingOnLoadHandler(bool* aResult) {
NS_IMETHODIMP
nsDocShell::GetLayoutHistoryState(nsILayoutHistoryState** aLayoutHistoryState) {
nsCOMPtr<nsILayoutHistoryState> state;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mozilla::SessionHistoryInParent()) {
if (mActiveEntry) {
state = mActiveEntry->GetLayoutHistoryState();
}
@@ -12801,7 +12792,7 @@ nsDocShell::ResumeRedirectedLoad(uint64_t aIdentifier, int32_t aHistoryIndex) {
// If we're performing a history load, locate the correct history entry,
// and set the relevant bits on our loadState.
if (aHistoryIndex >= 0 && self->GetSessionHistory() &&
!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
!mozilla::SessionHistoryInParent()) {
nsCOMPtr<nsISHistory> legacySHistory =
self->GetSessionHistory()->LegacySHistory();
@@ -13194,7 +13185,7 @@ void nsDocShell::SetLoadingSessionHistoryInfo(
}
void nsDocShell::MoveLoadingToActiveEntry(bool aCommit) {
MOZ_ASSERT(StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(mozilla::SessionHistoryInParent());
MOZ_LOG(gSHLog, LogLevel::Debug,
("nsDocShell %p MoveLoadingToActiveEntry", this));