Bug 1617899 - gBrowserInit._delayedStartup shouldn't call SessionStore in the middle of announcing that delayed startup has finished. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Tue, 25 Feb 2020 15:59:35 +0000
changeset 515631 db9ab4cfffbf6f73f1eafa4d609b6bd81e7b6e4a
parent 515630 9740196a8dbf7f7e814d45af803bae2a31d41b63
child 515632 3dbf9f9d69b4762b8407ad4a08627437b9ffc333
push id37160
push useraciure@mozilla.com
push dateWed, 26 Feb 2020 21:39:03 +0000
treeherdermozilla-central@862da1751d9f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1617899
milestone75.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1617899 - gBrowserInit._delayedStartup shouldn't call SessionStore in the middle of announcing that delayed startup has finished. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D64088
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2078,27 +2078,26 @@ var gBrowserInit = {
     }
 
     if (!Services.policies.isAllowed("hideShowMenuBar")) {
       document.getElementById("toolbar-menubar").removeAttribute("toolbarname");
     }
 
     CaptivePortalWatcher.delayedStartup();
 
-    this.delayedStartupFinished = true;
-
-    _resolveDelayedStartup();
-
     SessionStore.promiseAllWindowsRestored.then(() => {
       this._schedulePerWindowIdleTasks();
       document.documentElement.setAttribute("sessionrestored", "true");
     });
 
+    this.delayedStartupFinished = true;
+    _resolveDelayedStartup();
     Services.obs.notifyObservers(window, "browser-delayed-startup-finished");
     TelemetryTimestamps.add("delayedStartupFinished");
+    // We've announced that delayed startup has finished. Do not add code past this point.
   },
 
   _setInitialFocus() {
     let initiallyFocusedElement = document.commandDispatcher.focusedElement;
 
     this._firstBrowserPaintDeferred = {};
     this._firstBrowserPaintDeferred.promise = new Promise(resolve => {
       this._firstBrowserPaintDeferred.resolve = resolve;