Bug 1386445 - Early about:newtab pages are missing message APIs because RemotePages registers too late. r?mconley draft
authorEd Lee <edilee@mozilla.com>
Tue, 01 Aug 2017 12:30:33 -0700
changeset 619377 48fcadb0ad3cff892178745532340ef853e78807
parent 619065 ef9a0f01e4f68214f0ff8f4631783b8a0e075a82
child 640374 9a17f13ee24c0a8b0a0b5ac5f5f0d121b4e02c9c
push id71655
push userbmo:edilee@mozilla.com
push dateTue, 01 Aug 2017 22:45:26 +0000
reviewersmconley
bugs1386445
milestone56.0a1
Bug 1386445 - Early about:newtab pages are missing message APIs because RemotePages registers too late. r?mconley MozReview-Commit-ID: IXJLvFCgbEH
browser/base/content/test/performance/browser_startup.js
browser/components/nsBrowserGlue.js
--- a/browser/base/content/test/performance/browser_startup.js
+++ b/browser/base/content/test/performance/browser_startup.js
@@ -35,16 +35,20 @@ const startupPhases = {
     modules: new Set([
       "resource://gre/modules/AppConstants.jsm",
       "resource://gre/modules/XPCOMUtils.jsm",
       "resource://gre/modules/Services.jsm",
 
       // Bugs to fix: Probably loaded too early, needs investigation.
       "resource://gre/modules/RemotePageManager.jsm", // bug 1369466
     ])
+  }, blacklist: {
+    modules: new Set([
+      "resource:///modules/AboutNewTab.jsm",
+    ])
   }},
 
   // For the following phases of startup we have only a black list for now
 
   // We are at this phase after creating the first browser window (ie. after final-ui-startup).
   "before opening first browser window": {blacklist: {
     components: new Set([
       "nsAsyncShutdown.js",
@@ -61,17 +65,16 @@ const startupPhases = {
   "before first paint": {blacklist: {
     components: new Set([
       "UnifiedComplete.js",
       "nsSearchService.js",
     ]),
     modules: new Set([
       "chrome://webcompat-reporter/content/TabListener.jsm",
       "chrome://webcompat-reporter/content/WebCompatReporter.jsm",
-      "resource:///modules/AboutNewTab.jsm",
       "resource:///modules/BrowserUITelemetry.jsm",
       "resource:///modules/BrowserUsageTelemetry.jsm",
       "resource:///modules/ContentCrashHandlers.jsm",
       "resource:///modules/DirectoryLinksProvider.jsm",
       "resource://gre/modules/NewTabUtils.jsm",
       "resource://gre/modules/PageThumbs.jsm",
       "resource://gre/modules/Promise.jsm", // imported by devtools during _delayedStartup
     ]),
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -612,16 +612,20 @@ BrowserGlue.prototype = {
     // prefs are applied in _onAppDefaults()
     this._distributionCustomizer.applyCustomizations();
 
     // handle any UI migration
     this._migrateUI();
 
     listeners.init();
 
+    // Get the RemotePage listener ready for any early-loading about:newtab
+    // pages, e.g., start/home page, command line, sessionstore
+    AboutNewTab.init();
+
     SessionStore.init();
 
     if (AppConstants.INSTALL_COMPACT_THEMES) {
       let vendorShortName = gBrandBundle.GetStringFromName("vendorShortName");
 
       LightweightThemeManager.addBuiltInTheme({
         id: "firefox-compact-light@mozilla.org",
         name: gBrowserBundle.GetStringFromName("compactLightTheme.name"),
@@ -964,17 +968,16 @@ BrowserGlue.prototype = {
       WeaveService.init();
     }
 
     PageThumbs.init();
 
     DirectoryLinksProvider.init();
     NewTabUtils.init();
     NewTabUtils.links.addProvider(DirectoryLinksProvider);
-    AboutNewTab.init();
 
     PageActions.init();
 
     this._firstWindowTelemetry(aWindow);
     this._firstWindowLoaded();
 
     this._mediaTelemetryIdleObserver = {
       browserGlue: this,