From ad0d65f1315d8ddadb3b6aa77fd8424f9a9eaa2a Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Wed, 9 Aug 2017 15:06:30 -0300 Subject: [PATCH] Bug 1388145 - Move ContextualIdentityService and SafeBrowsing initialization to _scheduleStartupIdleTasks. r=florian This has no change in behavior since they are already scheduled with idleDispatchToMainThread, but this puts them in the proper code location MozReview-Commit-ID: IS5ZQjJy77q --HG-- extra : rebase_source : 08ee589ee7b88fc78dbd106c6f3f191c5fe2e928 --- browser/components/nsBrowserGlue.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index eaf2ede27a3f..2f6066099b99 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -1186,15 +1186,6 @@ BrowserGlue.prototype = { }); } - // Let's load the contextual identities. - Services.tm.idleDispatchToMainThread(() => { - ContextualIdentityService.load(); - }); - - Services.tm.idleDispatchToMainThread(() => { - SafeBrowsing.init(); - }, 5000); - this._sanitizer.onStartup(); E10SAccessibilityCheck.onWindowsRestored(); @@ -1233,7 +1224,15 @@ BrowserGlue.prototype = { * to the other ones scheduled together. */ _scheduleStartupIdleTasks() { - // TODO: Functions to be added here with Services.tm.idleDispatchToMainThread + Services.tm.idleDispatchToMainThread(() => { + ContextualIdentityService.load(); + }); + + // It's important that SafeBrowsing is initialized reasonably + // early, so we use a maximum timeout for it. + Services.tm.idleDispatchToMainThread(() => { + SafeBrowsing.init(); + }, 5000); }, /**