Bug 1458375 - Add browser-idle-startup-tasks-finished notification to Fennec. r?snorp draft
authorMike Conley <mconley@mozilla.com>
Wed, 30 May 2018 17:08:09 -0400
changeset 806908 4903d1de25ad8f6c26cba23bfde79dff87fad48c
parent 806907 68b436d08670064db113b1819e7e344e5e27a190
child 806909 6f17cb7c594480ce5ea1d1c5af811c7fc2cdc200
push id112986
push usermconley@mozilla.com
push dateTue, 12 Jun 2018 19:30:14 +0000
reviewerssnorp
bugs1458375
milestone62.0a1
Bug 1458375 - Add browser-idle-startup-tasks-finished notification to Fennec. r?snorp MozReview-Commit-ID: CDEMUCL8ykG
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -549,16 +549,22 @@ var BrowserApp = {
       });
 
       InitLater(() => LightWeightThemeWebInstaller.init());
       InitLater(() => CastingApps.init(), window, "CastingApps");
 
       // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
       InitLater(() => SafeBrowsing.init(), window, "SafeBrowsing");
 
+      // This should always go last, since the idle tasks (except for the ones with
+      // timeouts) should execute in order. Note that this observer notification is
+      // not guaranteed to fire, since the window could close before we get here.
+      InitLater(() => {
+        Services.obs.notifyObservers(window, "browser-idle-startup-tasks-finished");
+      });
     }, {once: true});
   },
 
   get _startupStatus() {
     delete this._startupStatus;
 
     let savedMilestone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "");
     let ourMilestone = AppConstants.MOZ_APP_VERSION;