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
This commit is contained in:
Eugen Sawin 2019-03-22 20:46:04 +00:00
Родитель d94b0ddbac
Коммит 2276021d2f
2 изменённых файлов: 5 добавлений и 6 удалений

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

@ -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",

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

@ -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",