Bug 1671184 - Don't send GeckoView settings to child processes. r=snorp

Now that GeckoViewSettingChild is an actor, nobody listens to settings in the
child anymore.

Differential Revision: https://phabricator.services.mozilla.com/D93512
This commit is contained in:
Agi Sferro 2020-10-14 17:26:02 +00:00
Родитель 8ed2ac71fb
Коммит fb84d4b14d
2 изменённых файлов: 4 добавлений и 27 удалений

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

@ -260,11 +260,6 @@ var ModuleManager = {
module.impl.onSettingsUpdate(); module.impl.onSettingsUpdate();
} }
}); });
this._browser.messageManager.sendAsyncMessage(
"GeckoView:UpdateSettings",
aSettings
);
}, },
onMessageFromActor(aActorName, aMessage) { onMessageFromActor(aActorName, aMessage) {
@ -492,7 +487,7 @@ class ModuleInfo {
} }
} }
this._updateContentModuleState(/* includeSettings */ aEnabled); this._updateContentModuleState();
} }
receiveMessage(aMessage) { receiveMessage(aMessage) {
@ -504,20 +499,19 @@ class ModuleInfo {
} }
onContentModuleLoaded() { onContentModuleLoaded() {
this._updateContentModuleState(/* includeSettings */ true); this._updateContentModuleState();
if (this._impl) { if (this._impl) {
this._impl.onContentModuleLoaded(); this._impl.onContentModuleLoaded();
} }
} }
_updateContentModuleState(aIncludeSettings) { _updateContentModuleState() {
this._manager.messageManager.sendAsyncMessage( this._manager.messageManager.sendAsyncMessage(
"GeckoView:UpdateModuleState", "GeckoView:UpdateModuleState",
{ {
module: this._name, module: this._name,
enabled: this.enabled, enabled: this.enabled,
settings: aIncludeSettings ? this._manager.settings : null,
} }
); );
} }

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

@ -27,7 +27,6 @@ class GeckoViewChildModule {
this.moduleName = aModuleName; this.moduleName = aModuleName;
this.messageManager = aGlobal; this.messageManager = aGlobal;
this.enabled = false; this.enabled = false;
this.settings = {};
if (!aGlobal._gvEventDispatcher) { if (!aGlobal._gvEventDispatcher) {
aGlobal._gvEventDispatcher = GeckoViewUtils.getDispatcherForWindow( aGlobal._gvEventDispatcher = GeckoViewUtils.getDispatcherForWindow(
@ -47,11 +46,6 @@ class GeckoViewChildModule {
} }
this.eventDispatcher = aGlobal._gvEventDispatcher; this.eventDispatcher = aGlobal._gvEventDispatcher;
this.messageManager.addMessageListener("GeckoView:UpdateSettings", aMsg => {
Object.assign(this.settings, aMsg.data);
this.onSettingsUpdate();
});
this.messageManager.addMessageListener( this.messageManager.addMessageListener(
"GeckoView:UpdateModuleState", "GeckoView:UpdateModuleState",
aMsg => { aMsg => {
@ -59,11 +53,7 @@ class GeckoViewChildModule {
return; return;
} }
const { enabled, settings } = aMsg.data; const { enabled } = aMsg.data;
if (settings) {
Object.assign(this.settings, settings);
}
if (enabled !== this.enabled) { if (enabled !== this.enabled) {
if (!enabled) { if (!enabled) {
@ -76,10 +66,6 @@ class GeckoViewChildModule {
this.onEnable(); this.onEnable();
} }
} }
if (settings) {
this.onSettingsUpdate();
}
} }
); );
@ -93,9 +79,6 @@ class GeckoViewChildModule {
// Override to initialize module. // Override to initialize module.
onInit() {} onInit() {}
// Override to detect settings change. Access settings via this.settings.
onSettingsUpdate() {}
// Override to enable module after setting a Java delegate. // Override to enable module after setting a Java delegate.
onEnable() {} onEnable() {}