Backed out changeset 88337b6e4e3e (bug 1666881) for causing failures regarding the fission.autostart pref.

CLOSED TREE
This commit is contained in:
Mihai Alexandru Michis 2020-09-24 15:41:33 +03:00
Родитель d939231580
Коммит 8b9238686c
14 изменённых файлов: 90 добавлений и 103 удалений

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

@ -414,7 +414,7 @@ void BrowsingContext::CreateFromIPC(BrowsingContext::IPCInitializer&& aInit,
context->mCreatedDynamically = aInit.mCreatedDynamically;
if (context->GetHasSessionHistory()) {
context->CreateChildSHistory();
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
context->GetChildSessionHistory()->SetIndexAndLength(
aInit.mSessionHistoryIndex, aInit.mSessionHistoryCount, nsID());
}
@ -2084,8 +2084,7 @@ BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() {
init.mUseRemoteSubframes = mUseRemoteSubframes;
init.mCreatedDynamically = mCreatedDynamically;
init.mOriginAttributes = mOriginAttributes;
if (mChildSessionHistory &&
StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mChildSessionHistory && StaticPrefs::fission_sessionHistoryInParent()) {
init.mSessionHistoryIndex = mChildSessionHistory->Index();
init.mSessionHistoryCount = mChildSessionHistory->Count();
}
@ -2583,7 +2582,7 @@ void BrowsingContext::InitSessionHistory() {
}
ChildSHistory* BrowsingContext::GetChildSessionHistory() {
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
// For now we're checking that the session history object for the child
// process is available before returning the ChildSHistory object, because
// it is the actual implementation that ChildSHistory forwards to. This can
@ -2641,8 +2640,7 @@ bool BrowsingContext::CanSet(FieldIndex<IDX_PendingInitialization>,
void BrowsingContext::SessionHistoryChanged(int32_t aIndexDelta,
int32_t aLengthDelta) {
if (XRE_IsParentProcess() ||
StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (XRE_IsParentProcess() || StaticPrefs::fission_sessionHistoryInParent()) {
// This method is used to test index and length for the session history
// in child process only.
return;

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

@ -834,7 +834,7 @@ nsresult nsDocShell::LoadURI(nsDocShellLoadState* aLoadState,
MOZ_LOG(gSHLog, LogLevel::Debug,
("nsDocShell[%p]: loading from session history", this));
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
return LoadHistoryEntry(aLoadState->SHEntry(), aLoadState->LoadType());
}
@ -929,7 +929,7 @@ bool nsDocShell::MaybeHandleSubframeHistory(
parentDS->GetLoadType(&parentLoadType);
if (!aContinueHandlingSubframeHistory) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (nsDocShell::Cast(parentDS.get())->IsLoadingFromSessionHistory() &&
!GetCreatedDynamically()) {
if (XRE_IsContentProcess()) {
@ -1150,7 +1150,7 @@ void nsDocShell::FirePageHideNotificationInternal(
MOZ_LOG(
gSHLog, LogLevel::Debug,
("document %p unloading, remove dynamic subframe entries", this));
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (mActiveEntry) {
mBrowsingContext->RemoveDynEntriesFromActiveSessionHistoryEntry();
}
@ -1408,7 +1408,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 (StaticPrefs::fission_sessionHistoryInParent()) {
if (mLoadingEntry) {
isSubFrame = mLoadingEntry->mInfo.IsSubFrame();
MOZ_LOG(gSHLog, LogLevel::Debug,
@ -2724,7 +2724,7 @@ void nsDocShell::StoreWindowNameToSHEntries() {
mOSHE, [&](nsISHEntry* aEntry) { aEntry->SetName(name); });
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (XRE_IsParentProcess()) {
SessionHistoryEntry* entry =
mBrowsingContext->Canonical()->GetActiveSessionHistoryEntry();
@ -3055,7 +3055,7 @@ nsresult nsDocShell::AddChildSHEntry(nsISHEntry* aCloneRef,
nsISHEntry* aNewEntry,
int32_t aChildOffset, uint32_t aLoadType,
bool aCloneChildren) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent());
nsresult rv = NS_OK;
if (mLSHE && aLoadType != LOAD_PUSHSTATE) {
@ -3083,7 +3083,7 @@ nsresult nsDocShell::AddChildSHEntry(nsISHEntry* aCloneRef,
nsresult nsDocShell::AddChildSHEntryToParent(nsISHEntry* aNewEntry,
int32_t aChildOffset,
bool aCloneChildren) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!StaticPrefs::fission_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
@ -3244,7 +3244,7 @@ nsDocShell::GetDeviceSizeIsPageSize(bool* aValue) {
}
void nsDocShell::ClearFrameHistory(nsISHEntry* aEntry) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent());
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
if (!rootSH || !aEntry) {
return;
@ -3984,7 +3984,7 @@ nsresult nsDocShell::LoadErrorPage(nsIURI* aErrorURI, nsIURI* aFailedURI,
// identifier, the error page won't persist.
mLSHE->AbandonBFCacheEntry();
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_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
@ -4020,7 +4020,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 (StaticPrefs::fission_sessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug, ("document %p Reload", this));
bool forceReload = IsForceReloadType(loadType);
if (!XRE_IsParentProcess()) {
@ -4286,7 +4286,7 @@ nsDocShell::LoadPageAsViewSource(nsIDocShell* aOtherDocShell,
RefPtr<nsDocShellLoadState> loadState;
uint32_t cacheKey;
auto* otherDocShell = nsDocShell::Cast(aOtherDocShell);
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
loadState = new nsDocShellLoadState(newURI);
if (!otherDocShell->FillLoadStateFromCurrentEntry(*loadState)) {
return NS_ERROR_INVALID_POINTER;
@ -4344,7 +4344,7 @@ nsDocShell::GetCurrentDescriptor(nsISupports** aPageDescriptor) {
already_AddRefed<nsIInputStream> nsDocShell::GetPostDataFromCurrentEntry()
const {
nsCOMPtr<nsIInputStream> postData;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (mActiveEntry) {
postData = mActiveEntry->GetPostData();
} else if (mLoadingEntry) {
@ -4362,7 +4362,7 @@ already_AddRefed<nsIInputStream> nsDocShell::GetPostDataFromCurrentEntry()
}
Maybe<uint32_t> nsDocShell::GetCacheKeyFromCurrentEntry() const {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (mActiveEntry) {
return Some(mActiveEntry->GetCacheKey());
}
@ -5685,8 +5685,8 @@ nsresult nsDocShell::Embed(nsIContentViewer* aContentViewer,
NS_ENSURE_SUCCESS(rv, rv);
// XXX What if SetupNewViewer fails?
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mLoadingEntry
: !!mLSHE) {
if (StaticPrefs::fission_sessionHistoryInParent() ? !!mLoadingEntry
: !!mLSHE) {
// Set history.state
SetDocCurrentStateObj(mLSHE,
mLoadingEntry ? &mLoadingEntry->mInfo : nullptr);
@ -5702,7 +5702,7 @@ nsresult nsDocShell::Embed(nsIContentViewer* aContentViewer,
}
if (!aIsTransientAboutBlank &&
StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
StaticPrefs::fission_sessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug, ("document %p Embed", this));
MoveLoadingToActiveEntry(mLoadType != LOAD_ERROR_PAGE);
}
@ -7005,7 +7005,7 @@ nsresult nsDocShell::CaptureState() {
if (MOZ_UNLIKELY(MOZ_LOG_TEST(gPageCacheLog, LogLevel::Debug))) {
nsAutoCString spec;
nsCOMPtr<nsIURI> uri;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
uri = mActiveEntry->GetURI();
} else {
uri = mOSHE->GetURI();
@ -7327,7 +7327,7 @@ nsresult nsDocShell::RestoreFromHistory() {
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
if (rootSH) {
mPreviousEntryIndex = rootSH->Index();
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
rootSH->LegacySHistory()->UpdateIndex();
}
mLoadedEntryIndex = rootSH->Index();
@ -7856,8 +7856,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 (!StaticPrefs::fission_sessionHistoryInParent() && shistory && !mLSHE) {
int32_t idx = shistory->LegacySHistory()->GetRequestedIndex();
if (idx == -1) {
idx = shistory->Index();
@ -8197,7 +8196,7 @@ void nsDocShell::SetDocCurrentStateObj(nsISHEntry* aShEntry,
NS_ENSURE_TRUE_VOID(document);
nsCOMPtr<nsIStructuredCloneContainer> scContainer;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
// If aInfo is null, just set the document's state object to null.
if (aInfo) {
scContainer = aInfo->GetStateData();
@ -8625,7 +8624,7 @@ bool nsDocShell::IsSameDocumentNavigation(nsDocShellLoadState* aLoadState,
}
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (mActiveEntry && aLoadState->LoadIsFromSessionHistory()) {
aState.mHistoryNavBetweenSameDoc = mActiveEntry->SharesDocumentWith(
aLoadState->GetLoadingSessionHistoryInfo()->mInfo);
@ -8645,7 +8644,7 @@ bool nsDocShell::IsSameDocumentNavigation(nsDocShellLoadState* aLoadState,
#ifdef DEBUG
if (aState.mHistoryNavBetweenSameDoc) {
nsCOMPtr<nsIInputStream> currentPostData;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
currentPostData = mActiveEntry->GetPostData();
} else {
currentPostData = mOSHE->GetPostData();
@ -8669,7 +8668,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 (!StaticPrefs::fission_sessionHistoryInParent()) {
bool doSameDocumentNavigation =
(aState.mHistoryNavBetweenSameDoc && mOSHE != aLoadState->SHEntry()) ||
(!aLoadState->SHEntry() && !aLoadState->PostDataStream() &&
@ -8746,9 +8745,9 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
nsCOMPtr<nsIPrincipal> newURITriggeringPrincipal, newURIPrincipalToInherit,
newURIPartitionedPrincipalToInherit;
nsCOMPtr<nsIContentSecurityPolicy> newCsp;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent() ? !!mActiveEntry
: !!mOSHE) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
newURITriggeringPrincipal = mActiveEntry->GetTriggeringPrincipal();
newURIPrincipalToInherit = mActiveEntry->GetPrincipalToInherit();
newURIPartitionedPrincipalToInherit =
@ -8783,9 +8782,9 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
uint32_t cacheKey = 0;
bool scrollRestorationIsManual = false;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent() ? !!mActiveEntry
: !!mOSHE) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
// FIXME Need to set scroll position on mActiveEntry.
scrollRestorationIsManual = mActiveEntry->GetScrollRestorationIsManual();
} else {
@ -8800,7 +8799,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 (StaticPrefs::fission_sessionHistoryInParent()) {
postData = mActiveEntry->GetPostData();
cacheKey = mActiveEntry->GetCacheKey();
} else {
@ -8833,7 +8832,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 (StaticPrefs::fission_sessionHistoryInParent()) {
scrollRestorationIsManual = aLoadState->GetLoadingSessionHistoryInfo()
->mInfo.GetScrollRestorationIsManual();
} else {
@ -8864,8 +8863,7 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
SetCacheKeyOnHistoryEntry(mOSHE, cacheKey);
}
}
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() &&
mLoadingEntry) {
if (StaticPrefs::fission_sessionHistoryInParent() && mLoadingEntry) {
MOZ_LOG(
gSHLog, LogLevel::Debug,
("Moving the loading entry to the active entry on nsDocShell %p to %s",
@ -8935,13 +8933,13 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
nscoord bx = 0;
nscoord by = 0;
bool needsScrollPosUpdate = false;
if ((StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) &&
if ((StaticPrefs::fission_sessionHistoryInParent() ? !!mActiveEntry
: !!mOSHE) &&
(aLoadState->LoadType() == LOAD_HISTORY ||
aLoadState->LoadType() == LOAD_RELOAD_NORMAL) &&
!scrollRestorationIsManual) {
needsScrollPosUpdate = true;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
mActiveEntry->GetScrollPosition(&bx, &by);
} else {
mOSHE->GetScrollPosition(&bx, &by);
@ -9259,7 +9257,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
SetHistoryEntryAndUpdateBC(Some<nsISHEntry*>(aLoadState->SHEntry()),
Nothing());
if (aLoadState->LoadIsFromSessionHistory() &&
!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
!StaticPrefs::fission_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 = {};
@ -9285,7 +9283,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
if (shistory) {
shistory->RemovePendingHistoryNavigations();
}
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_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
@ -10087,7 +10085,7 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
uint32_t cacheKey = 0;
if (aCacheKey) {
cacheKey = *aCacheKey;
} else if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
} else if (StaticPrefs::fission_sessionHistoryInParent()) {
if (mLoadingEntry) {
cacheKey = mLoadingEntry->mInfo.GetCacheKey();
} else if (mActiveEntry) { // for reload cases
@ -10658,8 +10656,8 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
* Hopefully I don't have to do that.
*/
if (equalUri &&
(StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) &&
(StaticPrefs::fission_sessionHistoryInParent() ? !!mActiveEntry
: !!mOSHE) &&
(mLoadType == LOAD_NORMAL || mLoadType == LOAD_LINK ||
mLoadType == LOAD_STOP_CONTENT) &&
!inputStream) {
@ -10693,14 +10691,14 @@ bool nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
SetCacheKeyOnHistoryEntry(mLSHE ? mLSHE : mOSHE, cacheKey);
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
// Since we're force-reloading, clear all the sub frame history.
ClearFrameHistory(mLSHE);
ClearFrameHistory(mOSHE);
}
}
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_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.
@ -10750,11 +10748,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 (!StaticPrefs::fission_sessionHistoryInParent() && rootSH &&
((mLoadType & (LOAD_CMD_HISTORY | LOAD_CMD_RELOAD)) ||
mLoadType == LOAD_NORMAL_REPLACE)) {
mPreviousEntryIndex = rootSH->Index();
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
rootSH->LegacySHistory()->UpdateIndex();
}
mLoadedEntryIndex = rootSH->Index();
@ -11000,7 +10998,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
aNewURI->EqualsExceptRef(aCurrentURI, &sameExceptHashes);
bool uriWasModified;
if (sameExceptHashes) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
uriWasModified = mActiveEntry && mActiveEntry->GetURIWasModified();
} else {
uriWasModified = oldOSHE && oldOSHE->GetURIWasModified();
@ -11025,7 +11023,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
nsPoint scrollPos = GetCurScrollPos();
bool scrollRestorationIsManual;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
// FIXME Need to save the current scroll position on mActiveEntry.
scrollRestorationIsManual = mActiveEntry->GetScrollRestorationIsManual();
} else {
@ -11037,7 +11035,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
nsCOMPtr<nsIContentSecurityPolicy> csp = aDocument->GetCsp();
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug,
("document %p UpdateActiveEntry replace", this));
nsString title(mActiveEntry->GetTitle());
@ -11077,7 +11075,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
// we'll just set mOSHE here.
mOSHE = newSHEntry;
}
} else if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
} else if (StaticPrefs::fission_sessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug,
("document %p UpdateActiveEntry non-replace", this));
UpdateActiveEntry(
@ -11110,7 +11108,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
newSHEntry->SetLoadReplace(false);
}
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
// Step 2.4 and 3: Modify new/original session history entry and clear its
// POST data, if there is any.
newSHEntry->SetStateData(aData);
@ -11177,7 +11175,7 @@ nsresult nsDocShell::UpdateURLAndHistory(Document* aDocument, nsIURI* aNewURI,
NS_IMETHODIMP
nsDocShell::GetCurrentScrollRestorationIsManual(bool* aIsManual) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
*aIsManual = mActiveEntry && mActiveEntry->GetScrollRestorationIsManual();
return NS_OK;
}
@ -11285,8 +11283,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(!StaticPrefs::fission_sessionHistoryInParent());
#if defined(DEBUG)
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
@ -11504,7 +11501,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(StaticPrefs::fission_sessionHistoryInParent());
MOZ_ASSERT(aURI, "uri is null");
MOZ_ASSERT(mLoadType == LOAD_PUSHSTATE,
"This code only deals with pushState");
@ -11650,10 +11647,10 @@ NS_IMETHODIMP
nsDocShell::PersistLayoutHistoryState() {
nsresult rv = NS_OK;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ? !!mActiveEntry
: !!mOSHE) {
if (StaticPrefs::fission_sessionHistoryInParent() ? !!mActiveEntry
: !!mOSHE) {
bool scrollRestorationIsManual;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
scrollRestorationIsManual = mActiveEntry->GetScrollRestorationIsManual();
} else {
scrollRestorationIsManual = mOSHE->GetScrollRestorationIsManual();
@ -12101,7 +12098,7 @@ nsDocShell::GetIsExecutingOnLoadHandler(bool* aResult) {
NS_IMETHODIMP
nsDocShell::GetLayoutHistoryState(nsILayoutHistoryState** aLayoutHistoryState) {
nsCOMPtr<nsILayoutHistoryState> state;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (mActiveEntry) {
state = mActiveEntry->GetLayoutHistoryState();
}
@ -12804,7 +12801,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()) {
!StaticPrefs::fission_sessionHistoryInParent()) {
nsCOMPtr<nsISHistory> legacySHistory =
self->GetSessionHistory()->LegacySHistory();
@ -13197,7 +13194,7 @@ void nsDocShell::SetLoadingSessionHistoryInfo(
}
void nsDocShell::MoveLoadingToActiveEntry(bool aCommit) {
MOZ_ASSERT(StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(StaticPrefs::fission_sessionHistoryInParent());
MOZ_LOG(gSHLog, LogLevel::Debug,
("nsDocShell %p MoveLoadingToActiveEntry", this));

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

@ -33,7 +33,7 @@ void ChildSHistory::SetIsInProcess(bool aIsInProcess) {
return;
}
if (mHistory || StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (mHistory || StaticPrefs::fission_sessionHistoryInParent()) {
return;
}
@ -41,15 +41,14 @@ void ChildSHistory::SetIsInProcess(bool aIsInProcess) {
}
int32_t ChildSHistory::Count() {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ||
mAsyncHistoryLength) {
if (StaticPrefs::fission_sessionHistoryInParent() || mAsyncHistoryLength) {
uint32_t length = mLength;
for (uint32_t i = 0; i < mPendingSHistoryChanges.Length(); ++i) {
length += mPendingSHistoryChanges[i].mLengthDelta;
}
if (mAsyncHistoryLength) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent());
// XXX The assertion may be too strong here, but it fires only
// when the pref is enabled.
MOZ_ASSERT(mHistory->GetCount() == int32_t(length));
@ -60,15 +59,14 @@ int32_t ChildSHistory::Count() {
}
int32_t ChildSHistory::Index() {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() ||
mAsyncHistoryLength) {
if (StaticPrefs::fission_sessionHistoryInParent() || mAsyncHistoryLength) {
uint32_t index = mIndex;
for (uint32_t i = 0; i < mPendingSHistoryChanges.Length(); ++i) {
index += mPendingSHistoryChanges[i].mIndexDelta;
}
if (mAsyncHistoryLength) {
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_ASSERT(!StaticPrefs::fission_sessionHistoryInParent());
int32_t realIndex;
mHistory->GetIndex(&realIndex);
// XXX The assertion may be too strong here, but it fires only
@ -108,7 +106,7 @@ void ChildSHistory::SetIndexAndLength(uint32_t aIndex, uint32_t aLength,
}
void ChildSHistory::Reload(uint32_t aReloadFlags, ErrorResult& aRv) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (XRE_IsParentProcess()) {
nsISHistory* shistory =
mBrowsingContext->Canonical()->GetSessionHistory();
@ -152,7 +150,7 @@ void ChildSHistory::Go(int32_t aOffset, bool aRequireUserInteraction,
}
// See Bug 1650095.
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
break;
}
@ -190,7 +188,7 @@ void ChildSHistory::AsyncGo(int32_t aOffset, bool aRequireUserInteraction,
}
void ChildSHistory::GotoIndex(int32_t aIndex, ErrorResult& aRv) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
nsCOMPtr<nsISHistory> shistory = mHistory;
mBrowsingContext->HistoryGo(aIndex, [shistory](int32_t&& aRequestedIndex) {
// FIXME Should probably only do this for non-fission.
@ -208,13 +206,13 @@ void ChildSHistory::RemovePendingHistoryNavigations() {
}
void ChildSHistory::EvictLocalContentViewers() {
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
mHistory->EvictAllContentViewers();
}
}
nsISHistory* ChildSHistory::GetLegacySHistory(ErrorResult& aError) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
aError.ThrowTypeError(
"legacySHistory is not available with session history in the parent.");
return nullptr;
@ -251,7 +249,7 @@ nsISupports* ChildSHistory::GetParentObject() const {
}
void ChildSHistory::SetAsyncHistoryLength(bool aEnable, ErrorResult& aRv) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() || !mHistory) {
if (StaticPrefs::fission_sessionHistoryInParent() || !mHistory) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}

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

@ -329,7 +329,7 @@ uint32_t nsSHistory::CalcMaxTotalViewers() {
// static
void nsSHistory::UpdatePrefs() {
Preferences::GetInt(PREF_SHISTORY_SIZE, &gHistoryMaxSize);
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
sHistoryMaxTotalViewers = 0;
return;
}
@ -430,7 +430,7 @@ nsresult nsSHistory::WalkHistoryEntries(nsISHEntry* aRootEntry,
// If the SH pref is on and we are in the parent process, update
// canonical BC directly
bool foundChild = false;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup() &&
if (StaticPrefs::fission_sessionHistoryInParent() &&
XRE_IsParentProcess()) {
if (child->Canonical()->HasHistoryEntry(childEntry)) {
childBC = child;
@ -681,7 +681,7 @@ nsresult nsSHistory::SetChildHistoryEntry(nsISHEntry* aEntry,
void nsSHistory::HandleEntriesToSwapInDocShell(
mozilla::dom::BrowsingContext* aBC, nsISHEntry* aOldEntry,
nsISHEntry* aNewEntry) {
bool shPref = StaticPrefs::fission_sessionHistoryInParent_AtStartup();
bool shPref = StaticPrefs::fission_sessionHistoryInParent();
if (aBC->IsInProcess() || !shPref) {
nsDocShell* docshell = static_cast<nsDocShell*>(aBC->GetDocShell());
if (docshell) {
@ -1825,7 +1825,7 @@ void nsSHistory::InitiateLoad(nsISHEntry* aFrameEntry,
// a same-document navigation (see nsDocShell::IsSameDocumentNavigation), so
// record that here in the LoadingSessionHistoryEntry.
bool loadingFromActiveEntry;
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
loadingFromActiveEntry =
aFrameBC->Canonical()->GetActiveSessionHistoryEntry() == aFrameEntry;
} else {
@ -1836,7 +1836,7 @@ void nsSHistory::InitiateLoad(nsISHEntry* aFrameEntry,
loadState->SetLoadIsFromSessionHistory(mRequestedIndex, Length(),
loadingFromActiveEntry);
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
nsCOMPtr<SessionHistoryEntry> she = do_QueryInterface(aFrameEntry);
aFrameBC->Canonical()->AddLoadingSessionHistoryEntry(
loadState->GetLoadingSessionHistoryInfo()->mLoadId, she);
@ -1861,8 +1861,7 @@ void nsSHistory::InitiateLoad(nsISHEntry* aFrameEntry,
NS_IMETHODIMP
nsSHistory::CreateEntry(nsISHEntry** aEntry) {
nsCOMPtr<nsISHEntry> entry;
if (XRE_IsParentProcess() &&
StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (XRE_IsParentProcess() && StaticPrefs::fission_sessionHistoryInParent()) {
entry = new SessionHistoryEntry();
} else {
entry = new nsSHEntry();

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

@ -251,8 +251,7 @@ void MarkDocShell(nsIDocShellTreeItem* aNode, bool aCleanupJS) {
nsISHistory* legacyHistory =
history ? history->GetLegacySHistory(ignore) : nullptr;
if (legacyHistory) {
MOZ_DIAGNOSTIC_ASSERT(
!StaticPrefs::fission_sessionHistoryInParent_AtStartup());
MOZ_DIAGNOSTIC_ASSERT(!StaticPrefs::fission_sessionHistoryInParent());
int32_t historyCount = history->Count();
for (int32_t i = 0; i < historyCount; ++i) {
nsCOMPtr<nsISHEntry> shEntry;

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

@ -1873,7 +1873,7 @@ void nsFrameLoader::StartDestroy(bool aForProcessSwitch) {
RefPtr<ChildSHistory> childSHistory =
browsingContext->Top()->GetChildSessionHistory();
if (childSHistory) {
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
browsingContext->RemoveFromSessionHistory();
} else {
AutoTArray<nsID, 16> ids({browsingContext->GetHistoryID()});

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

@ -6348,7 +6348,7 @@ bool nsGlobalWindowOuter::IsOnlyTopLevelDocumentInSHistory() {
// Disabled since IsFrame() is buggy in Fission
// MOZ_ASSERT(mBrowsingContext->IsTop());
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
return mBrowsingContext->GetIsSingleToplevelInHistory();
}

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

@ -3450,7 +3450,7 @@ nsresult BrowserChild::CanCancelContentJS(
// If we have session history in the parent we've already performed
// the checks following, so we can return early.
if (StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (StaticPrefs::fission_sessionHistoryInParent()) {
*aCanCancel = true;
return NS_OK;
}

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

@ -3519,7 +3519,7 @@ bool BrowserParent::CanCancelContentJS(
nsIURI* aNavigationURI) const {
// Pre-checking if we can cancel content js in the parent is only
// supported when session history in the parent is enabled.
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (!StaticPrefs::fission_sessionHistoryInParent()) {
// If session history in the parent isn't enabled, this check will
// be fully done in BrowserChild::CanCancelContentJS
return true;

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

@ -2060,7 +2060,7 @@ nsDocumentViewer::Show(void) {
treeItem->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(root);
RefPtr<ChildSHistory> history = webNav->GetSessionHistory();
if (!StaticPrefs::fission_sessionHistoryInParent_AtStartup() && history) {
if (!StaticPrefs::fission_sessionHistoryInParent() && history) {
int32_t prevIndex, loadedIndex;
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(treeItem);
docShell->GetPreviousEntryIndex(&prevIndex);

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

@ -3590,7 +3590,7 @@
- name: fission.sessionHistoryInParent
type: bool
value: false
mirror: once
mirror: always
# Allow renaming of process names to the origin on nightly
# Setting this pref creates a privacy leak, but helps greatly with

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

@ -626,8 +626,7 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState,
mSrcdocData = aLoadState->SrcdocData();
mBaseURI = aLoadState->BaseURI();
mOriginalUriString = aLoadState->GetOriginalURIString();
if (documentContext &&
StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
if (documentContext && StaticPrefs::fission_sessionHistoryInParent()) {
// It's hard to know at this point whether session history will be enabled
// in the browsing context, so we always create an entry for a load here.
mLoadingSessionHistoryInfo =

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

@ -69,8 +69,7 @@ ParentProcessDocumentChannel::RedirectToRealChannel(
mStreamFilterEndpoints = std::move(aStreamFilterEndpoints);
if (mDocumentLoadListener->IsDocumentLoad() &&
StaticPrefs::fission_sessionHistoryInParent_AtStartup() &&
GetDocShell()) {
StaticPrefs::fission_sessionHistoryInParent() && GetDocShell()) {
GetDocShell()->SetLoadingSessionHistoryInfo(
*mDocumentLoadListener->GetLoadingSessionHistoryInfo());
}

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

@ -46,8 +46,7 @@ ContentSessionStore::ContentSessionStore(nsIDocShell* aDocShell)
mFormDataChanged(NO_CHANGE),
mStorageStatus(NO_STORAGE),
mDocCapChanged(false),
mSHistoryInParent(
StaticPrefs::fission_sessionHistoryInParent_AtStartup()),
mSHistoryInParent(StaticPrefs::fission_sessionHistoryInParent()),
mSHistoryChanged(false),
mSHistoryChangedFromParent(false) {
MOZ_ASSERT(mDocShell);
@ -170,8 +169,7 @@ TabListener::TabListener(nsIDocShell* aDocShell, Element* aElement)
mTimeoutDisabled(false),
mUpdateInterval(15000),
mEpoch(0),
mSHistoryInParent(
StaticPrefs::fission_sessionHistoryInParent_AtStartup()) {
mSHistoryInParent(StaticPrefs::fission_sessionHistoryInParent()) {
MOZ_ASSERT(mDocShell);
}