Backed out changeset cfb9cc9ee352 (bug 1607545) for node failures on a CLOSED TREE
authorOana Pop Rus <opoprus@mozilla.com>
Sat, 25 Jan 2020 01:21:24 +0200
changeset 511763 c7218dc33989b88f360c0340080661121fa7cb95
parent 511762 5683b58e5a5c2782645bacc08f3dadb043809e7e
child 511764 90a631ef67b5f2c13b8c63c63ea7d789445b6531
push id106014
push useropoprus@mozilla.com
push dateFri, 24 Jan 2020 23:26:32 +0000
treeherderautoland@90a631ef67b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1607545
milestone74.0a1
backs outcfb9cc9ee352674f247aef75c73de318994fc308
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
Backed out changeset cfb9cc9ee352 (bug 1607545) for node failures on a CLOSED TREE
browser/base/content/browser.js
browser/components/newtab/AboutNewTabService.jsm
browser/components/newtab/lib/TelemetryFeed.jsm
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -10,17 +10,16 @@ var { Services } = ChromeUtils.import("r
 var { AppConstants } = ChromeUtils.import(
   "resource://gre/modules/AppConstants.jsm"
 );
 ChromeUtils.import("resource://gre/modules/NotificationDB.jsm");
 
 // lazy module getters
 
 XPCOMUtils.defineLazyModuleGetters(this, {
-  AboutNewTabStartupRecorder: "resource:///modules/AboutNewTabService.jsm",
   AddonManager: "resource://gre/modules/AddonManager.jsm",
   AMTelemetry: "resource://gre/modules/AddonManager.jsm",
   NewTabPagePreloading: "resource:///modules/NewTabPagePreloading.jsm",
   BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
   BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
   BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
   CFRPageActions: "resource://activity-stream/lib/CFRPageActions.jsm",
   CharsetMenu: "resource://gre/modules/CharsetMenu.jsm",
@@ -2338,18 +2337,16 @@ var gBrowserInit = {
 
       let uri = window.arguments[0];
       let defaultArgs = Cc["@mozilla.org/browser/clh;1"].getService(
         Ci.nsIBrowserHandler
       ).defaultArgs;
 
       // If the given URI is different from the homepage, we want to load it.
       if (uri != defaultArgs) {
-        AboutNewTabStartupRecorder.noteNonDefaultStartup();
-
         if (uri instanceof Ci.nsIArray) {
           // Transform the nsIArray of nsISupportsString's into a JS Array of
           // JS strings.
           return Array.from(
             uri.enumerate(Ci.nsISupportsString),
             supportStr => supportStr.data
           );
         } else if (uri instanceof Ci.nsISupportsString) {
--- a/browser/components/newtab/AboutNewTabService.jsm
+++ b/browser/components/newtab/AboutNewTabService.jsm
@@ -46,16 +46,17 @@ function AboutNewTabService() {
   );
   if (!IS_RELEASE_OR_BETA) {
     Services.prefs.addObserver(PREF_ACTIVITY_STREAM_DEBUG, this);
   }
 
   // More initialization happens here
   this.toggleActivityStream(true);
   this.initialized = true;
+  this.alreadyRecordedTopsitesPainted = false;
 
   if (IS_MAIN_PROCESS) {
     AboutNewTab.init();
   } else if (IS_PRIVILEGED_PROCESS) {
     Services.obs.addObserver(this, TOPIC_CONTENT_DOCUMENT_INTERACTIVE);
   }
 }
 
@@ -291,54 +292,39 @@ AboutNewTabService.prototype = {
 
   resetNewTabURL() {
     this._overridden = false;
     this._newTabURL = ABOUT_URL;
     this.toggleActivityStream(true, true);
     this.notifyChange();
   },
 
+  maybeRecordTopsitesPainted(timestamp) {
+    if (this.alreadyRecordedTopsitesPainted) {
+      return;
+    }
+
+    const SCALAR_KEY = "timestamps.about_home_topsites_first_paint";
+
+    let startupInfo = Services.startup.getStartupInfo();
+    let processStartTs = startupInfo.process.getTime();
+    let delta = Math.round(timestamp - processStartTs);
+    Services.telemetry.scalarSet(SCALAR_KEY, delta);
+    this.alreadyRecordedTopsitesPainted = true;
+  },
+
   uninit() {
     if (!this.initialized) {
       return;
     }
     Services.obs.removeObserver(this, TOPIC_APP_QUIT);
     Services.prefs.removeObserver(
       PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS,
       this
     );
     if (!IS_RELEASE_OR_BETA) {
       Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_DEBUG, this);
     }
     this.initialized = false;
   },
 };
 
-/**
- * We split out the definition of AboutNewTabStartupRecorder from
- * AboutNewTabService to avoid initializing the AboutNewTabService
- * unnecessarily early when we just want to record some startup
- * data.
- */
-const AboutNewTabStartupRecorder = {
-  _alreadyRecordedTopsitesPainted: false,
-  _nonDefaultStartup: false,
-
-  noteNonDefaultStartup() {
-    this._nonDefaultStartup = true;
-  },
-
-  maybeRecordTopsitesPainted(timestamp) {
-    if (this._alreadyRecordedTopsitesPainted || this._nonDefaultStartup) {
-      return;
-    }
-
-    const SCALAR_KEY = "timestamps.about_home_topsites_first_paint";
-
-    let startupInfo = Services.startup.getStartupInfo();
-    let processStartTs = startupInfo.process.getTime();
-    let delta = Math.round(timestamp - processStartTs);
-    Services.telemetry.scalarSet(SCALAR_KEY, delta);
-    this._alreadyRecordedTopsitesPainted = true;
-  },
-};
-
-const EXPORTED_SYMBOLS = ["AboutNewTabService", "AboutNewTabStartupRecorder"];
+const EXPORTED_SYMBOLS = ["AboutNewTabService"];
--- a/browser/components/newtab/lib/TelemetryFeed.jsm
+++ b/browser/components/newtab/lib/TelemetryFeed.jsm
@@ -26,21 +26,16 @@ ChromeUtils.defineModuleGetter(
 );
 ChromeUtils.defineModuleGetter(
   this,
   "perfService",
   "resource://activity-stream/common/PerfService.jsm"
 );
 ChromeUtils.defineModuleGetter(
   this,
-  "AboutNewTabStartupRecorder",
-  "resource:///modules/AboutNewTabService.jsm"
-);
-ChromeUtils.defineModuleGetter(
-  this,
   "PingCentre",
   "resource:///modules/PingCentre.jsm"
 );
 ChromeUtils.defineModuleGetter(
   this,
   "UTEventReporting",
   "resource://activity-stream/lib/UTEventReporting.jsm"
 );
@@ -1043,17 +1038,17 @@ this.TelemetryFeed = class TelemetryFeed
     let timestamp = data.topsites_first_painted_ts;
 
     if (
       timestamp &&
       session.page === "about:home" &&
       !HomePage.overridden &&
       Services.prefs.getIntPref("browser.startup.page") === 1
     ) {
-      AboutNewTabStartupRecorder.maybeRecordTopsitesPainted(timestamp);
+      aboutNewTabService.maybeRecordTopsitesPainted(timestamp);
     }
 
     Object.assign(session.perf, data);
   }
 
   uninit() {
     try {
       Services.obs.removeObserver(