Bug 1588491 - Associate session history entries with a session history object from creation. Continue to allow docshells to create session history entries even if the root docshell doesn't have a session history object. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D50574
This commit is contained in:
Peter Van der Beken
2019-10-24 09:17:19 +02:00
parent 2d52b5901a
commit 731f764552
16 changed files with 61 additions and 31 deletions

View File

@@ -11333,13 +11333,9 @@ nsresult nsDocShell::AddToSessionHistory(
NS_ENSURE_TRUE(webnav, NS_ERROR_FAILURE);
RefPtr<ChildSHistory> shistory = webnav->GetSessionHistory();
NS_ENSURE_TRUE(shistory, NS_ERROR_FAILURE);
shistory->LegacySHistory()->CreateEntry(getter_AddRefs(entry));
if (!entry) {
return NS_ERROR_OUT_OF_MEMORY;
}
entry = CreateSHEntryForDocShell(shistory ? shistory->LegacySHistory()
: nullptr);
NS_ENSURE_TRUE(entry, NS_ERROR_FAILURE);
}
// Get the post data & referrer