From 28911b048d443311fba9491630d0452a3ce7fa34 Mon Sep 17 00:00:00 2001 From: Agi Sferro Date: Tue, 20 Oct 2020 16:14:36 +0000 Subject: [PATCH] Bug 1646810 - HistoryInParent workaround for SessionStateAggregator. r=esawin This is a temporary workaround so that we can test Fission on GeckoView without implementiong SessionStateAggregator, which needs to be moved to the parent since Fission implies HistoryInParent. Differential Revision: https://phabricator.services.mozilla.com/D93865 --- .../geckoview/SessionStateAggregator.js | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/mobile/android/chrome/geckoview/SessionStateAggregator.js b/mobile/android/chrome/geckoview/SessionStateAggregator.js index 8dc4498b7590..55d743d2455d 100644 --- a/mobile/android/chrome/geckoview/SessionStateAggregator.js +++ b/mobile/android/chrome/geckoview/SessionStateAggregator.js @@ -644,7 +644,30 @@ class SessionStateAggregator extends GeckoViewChildModule { } } +// TODO: Bug 1648158 Move SessionAggregator to the parent process +class DummySessionStateAggregator extends GeckoViewChildModule { + constructor(aModuleName, aMessageManager) { + super(aModuleName, aMessageManager); + this.messageManager.addMessageListener("GeckoView:FlushSessionState", this); + } + + receiveMessage(aMsg) { + debug`receiveMessage: ${aMsg.name}`; + + switch (aMsg.name) { + case "GeckoView:FlushSessionState": + // Do nothing + break; + } + } +} + const { debug, warn } = SessionStateAggregator.initLogging( "SessionStateAggregator" ); -const module = SessionStateAggregator.create(this); + +const module = Services.appinfo.sessionHistoryInParent + ? // If history is handled in the parent we don't need a session aggregator + // TODO: Bug 1648158 remove this and do everything in the parent + DummySessionStateAggregator.create(this) + : SessionStateAggregator.create(this);