Bug 1376591 - Move SafeBrowsing.init() after startup and put it into IdleDispatch Callback
MozReview-Commit-ID: E834rSHikYb
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1493,19 +1493,16 @@ var gBrowserInit = {
window.focus();
} else {
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
// Such callers expect that window.arguments[0] is handled as a single URI.
loadOneOrMoreURIs(uriToLoad, Services.scriptSecurityManager.getSystemPrincipal());
}
}
- // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
- setTimeout(function() { SafeBrowsing.init(); }, 2000);
-
Services.obs.addObserver(gIdentityHandler, "perm-changed");
Services.obs.addObserver(gRemoteControl, "remote-active");
Services.obs.addObserver(gSessionHistoryObserver, "browser:purge-session-history");
Services.obs.addObserver(gStoragePressureObserver, "QuotaManager::StoragePressure");
Services.obs.addObserver(gXPInstallObserver, "addon-install-disabled");
Services.obs.addObserver(gXPInstallObserver, "addon-install-started");
Services.obs.addObserver(gXPInstallObserver, "addon-install-blocked");
Services.obs.addObserver(gXPInstallObserver, "addon-install-origin-blocked");
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -15,16 +15,19 @@ Cu.import("resource://gre/modules/AppCon
XPCOMUtils.defineLazyServiceGetter(this, "WindowsUIUtils", "@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils");
XPCOMUtils.defineLazyGetter(this, "WeaveService", () =>
Cc["@mozilla.org/weave/service;1"].getService().wrappedJSObject
);
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
"resource://gre/modules/ContextualIdentityService.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "SafeBrowsing",
+ "resource://gre/modules/SafeBrowsing.jsm");
+
// lazy module getters
/* global AboutHome:false, AboutNewTab:false, AddonManager:false, AppMenuNotifications:false,
AsyncPrefs: false, AsyncShutdown:false, AutoCompletePopup:false, BookmarkHTMLUtils:false,
BookmarkJSONUtils:false, BrowserUITelemetry:false, BrowserUsageTelemetry:false,
ContentClick:false, ContentPrefServiceParent:false, ContentSearch:false,
DateTimePickerHelper:false, DirectoryLinksProvider:false,
ExtensionsUI:false, Feeds:false,
@@ -1180,16 +1183,20 @@ BrowserGlue.prototype = {
});
}
// Let's load the contextual identities.
Services.tm.idleDispatchToMainThread(() => {
ContextualIdentityService.load();
});
+ Services.tm.idleDispatchToMainThread(() => {
+ SafeBrowsing.init();
+ }, 5000);
+
this._sanitizer.onStartup();
E10SAccessibilityCheck.onWindowsRestored();
},
_createExtraDefaultProfile() {
if (!AppConstants.MOZ_DEV_EDITION) {
return;
}