Bug 1656997 - When session history runs in the parent process, SessionStore should not modify the session history when doing process switches, r=nika,mconley

Differential Revision: https://phabricator.services.mozilla.com/D86073
This commit is contained in:
Olli Pettay 2020-08-14 15:27:26 +00:00
Родитель cadcd14bc8
Коммит 0352eecee9
2 изменённых файлов: 27 добавлений и 11 удалений

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

@ -29,6 +29,12 @@
"UrlbarProviderOpenTabs",
"resource:///modules/UrlbarProviderOpenTabs.jsm"
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
"sessionHistoryInParent",
"fission.sessionHistoryInParent",
false
);
Services.obs.addObserver(this, "contextual-identity-updated");
@ -1979,8 +1985,10 @@
// Ensure that SessionStore has flushed any session history state from the
// content process before we this browser's remoteness.
b.prepareToChangeRemoteness = () =>
SessionStore.prepareToChangeRemoteness(b);
if (!this.sessionHistoryInParent) {
b.prepareToChangeRemoteness = () =>
SessionStore.prepareToChangeRemoteness(b);
}
const defaultBrowserAttributes = {
contextmenu: "contentAreaContextMenu",

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

@ -18,6 +18,10 @@
"resource://gre/modules/BrowserUtils.jsm"
);
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
let LazyModules = {};
ChromeUtils.defineModuleGetter(
@ -44,10 +48,12 @@
"resource://gre/actors/PopupBlockingParent.jsm"
);
ChromeUtils.defineModuleGetter(
LazyModules,
"XPCOMUtils",
"resource://gre/modules/XPCOMUtils.jsm"
let lazyPrefs = {};
XPCOMUtils.defineLazyPreferenceGetter(
lazyPrefs,
"sessionHistoryInParent",
"fission.sessionHistoryInParent",
false
);
const elementsToDestroyOnUnload = new Set();
@ -90,7 +96,7 @@
// between calls to destroy().
this.progressListeners = [];
LazyModules.XPCOMUtils.defineLazyGetter(this, "popupBlocker", () => {
XPCOMUtils.defineLazyGetter(this, "popupBlocker", () => {
return new LazyModules.PopupBlocker(this);
});
@ -1872,10 +1878,12 @@
// history, and performing the `resumeRedirectedLoad`, in order to get
// sesssion state set up correctly.
// FIXME: This probably needs to be hookable by GeckoView.
let tabbrowser = this.getTabBrowser();
if (tabbrowser) {
tabbrowser.finishBrowserRemotenessChange(this, redirectLoadSwitchId);
return true;
if (!lazyPrefs.sessionHistoryInParent) {
let tabbrowser = this.getTabBrowser();
if (tabbrowser) {
tabbrowser.finishBrowserRemotenessChange(this, redirectLoadSwitchId);
return true;
}
}
return false;
}