Bug 1665710: don't update session history for about:blank transient pages r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D90589
This commit is contained in:
Randell Jesup
2020-09-22 16:54:56 +00:00
parent e229b4ac03
commit 9f980bafd3
4 changed files with 18 additions and 5 deletions

View File

@@ -280,7 +280,7 @@ static mozilla::LazyLogModule gDocShellAndDOMWindowLeakLogging(
#endif
static mozilla::LazyLogModule gDocShellLeakLog("nsDocShellLeak");
extern mozilla::LazyLogModule gPageCacheLog;
static mozilla::LazyLogModule gSHLog("SessionHistory");
mozilla::LazyLogModule gSHLog("SessionHistory");
const char kBrandBundleURL[] = "chrome://branding/locale/brand.properties";
const char kAppstringsBundleURL[] =
@@ -5689,7 +5689,8 @@ nsresult nsDocShell::RefreshURIFromQueue() {
}
nsresult nsDocShell::Embed(nsIContentViewer* aContentViewer,
WindowGlobalChild* aWindowActor) {
WindowGlobalChild* aWindowActor,
bool aIsTransientAboutBlank) {
// Save the LayoutHistoryState of the previous document, before
// setting up new document
PersistLayoutHistoryState();
@@ -5714,7 +5715,8 @@ nsresult nsDocShell::Embed(nsIContentViewer* aContentViewer,
SetHistoryEntryAndUpdateBC(Nothing(), Some<nsISHEntry*>(mLSHE));
}
if (StaticPrefs::fission_sessionHistoryInParent()) {
if (!aIsTransientAboutBlank &&
StaticPrefs::fission_sessionHistoryInParent()) {
MOZ_LOG(gSHLog, LogLevel::Debug, ("document %p Embed", this));
MoveLoadingToActiveEntry(mLoadType != LOAD_ERROR_PAGE);
}
@@ -6764,7 +6766,7 @@ nsresult nsDocShell::CreateAboutBlankContentViewer(
// hook 'em up
if (viewer) {
viewer->SetContainer(this);
rv = Embed(viewer, aActor);
rv = Embed(viewer, aActor, true);
NS_ENSURE_SUCCESS(rv, rv);
SetCurrentURI(blankDoc->GetDocumentURI(), nullptr, true, 0);