From 2276021d2f8ce1c2f588b4713dc721af3b0abc6d Mon Sep 17 00:00:00 2001 From: Eugen Sawin Date: Fri, 22 Mar 2019 20:46:04 +0000 Subject: [PATCH] Bug 1530789 - [2.0] Initialize the SafeBrowsing module only in the parent process. r=dimi Differential Revision: https://phabricator.services.mozilla.com/D21422 --HG-- extra : moz-landing-system : lando --- mobile/android/components/geckoview/GeckoViewStartup.js | 5 +++++ mobile/android/modules/geckoview/GeckoViewSettings.jsm | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mobile/android/components/geckoview/GeckoViewStartup.js b/mobile/android/components/geckoview/GeckoViewStartup.js index c8f4cfd1f598..5014a75bfaa5 100644 --- a/mobile/android/components/geckoview/GeckoViewStartup.js +++ b/mobile/android/components/geckoview/GeckoViewStartup.js @@ -12,6 +12,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { GeckoViewTelemetryController: "resource://gre/modules/GeckoViewTelemetryController.jsm", L10nRegistry: "resource://gre/modules/L10nRegistry.jsm", Preferences: "resource://gre/modules/Preferences.jsm", + SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm", Services: "resource://gre/modules/Services.jsm", }); @@ -125,6 +126,10 @@ GeckoViewStartup.prototype = { ChromeUtils.import("resource://gre/modules/NotificationDB.jsm"); + // Initialize safe browsing module. This is required for content + // blocking features and manages blocklist downloads and updates. + SafeBrowsing.init(); + // Listen for global EventDispatcher messages EventDispatcher.instance.registerListener(this, ["GeckoView:ResetUserPrefs", diff --git a/mobile/android/modules/geckoview/GeckoViewSettings.jsm b/mobile/android/modules/geckoview/GeckoViewSettings.jsm index 26b4c6a14e27..e460a02cf165 100644 --- a/mobile/android/modules/geckoview/GeckoViewSettings.jsm +++ b/mobile/android/modules/geckoview/GeckoViewSettings.jsm @@ -9,10 +9,6 @@ var EXPORTED_SYMBOLS = ["GeckoViewSettings"]; const {GeckoViewModule} = ChromeUtils.import("resource://gre/modules/GeckoViewModule.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); -XPCOMUtils.defineLazyModuleGetters(this, { - SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm", -}); - XPCOMUtils.defineLazyGetter( this, "MOBILE_USER_AGENT", function() { @@ -45,11 +41,9 @@ const USER_AGENT_MODE_VR = 2; class GeckoViewSettings extends GeckoViewModule { onInit() { debug `onInit`; - this._useTrackingProtection = false; this._userAgentMode = USER_AGENT_MODE_MOBILE; this._userAgentOverride = null; // Required for safe browsing and tracking protection. - SafeBrowsing.init(); this.registerListener([ "GeckoView:GetUserAgent",