Bug 1649131 - Stop checking for an nsISHEntry in nsDocShellLoadState as a sign of a load from history. r=smaug
Checking for an nsISHEntry doesn't work anymore with session history in the parent. For that we can check that the loading session history info's mIsLoadFromSessionHistory is true. If there is no loading session history info we can fall back to the old way of checking for a non-null nsISHEntry (which will only ever be true if session history in the parent is turned off). Differential Revision: https://phabricator.services.mozilla.com/D87037
This commit is contained in:
@@ -530,12 +530,25 @@ nsDocShellLoadState::GetLoadingSessionHistoryInfo() const {
|
||||
void nsDocShellLoadState::SetLoadIsFromSessionHistory(
|
||||
int32_t aRequestedIndex, int32_t aSessionHistoryLength) {
|
||||
if (mLoadingSessionHistoryInfo) {
|
||||
mLoadingSessionHistoryInfo->mIsLoadFromSessionHistory = true;
|
||||
mLoadingSessionHistoryInfo->mLoadIsFromSessionHistory = true;
|
||||
mLoadingSessionHistoryInfo->mRequestedIndex = aRequestedIndex;
|
||||
mLoadingSessionHistoryInfo->mSessionHistoryLength = aSessionHistoryLength;
|
||||
}
|
||||
}
|
||||
|
||||
void nsDocShellLoadState::ClearLoadIsFromSessionHistory() {
|
||||
if (mLoadingSessionHistoryInfo) {
|
||||
mLoadingSessionHistoryInfo->mLoadIsFromSessionHistory = false;
|
||||
}
|
||||
mSHEntry = nullptr;
|
||||
}
|
||||
|
||||
bool nsDocShellLoadState::LoadIsFromSessionHistory() const {
|
||||
return mLoadingSessionHistoryInfo
|
||||
? mLoadingSessionHistoryInfo->mLoadIsFromSessionHistory
|
||||
: !!mSHEntry;
|
||||
}
|
||||
|
||||
const nsString& nsDocShellLoadState::Target() const { return mTarget; }
|
||||
|
||||
void nsDocShellLoadState::SetTarget(const nsAString& aTarget) {
|
||||
|
||||
Reference in New Issue
Block a user