Bug 1524688: Part 27 - Convert TelemetryStartup to static registration. r=gfritzsche
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 21:29:25 -0800
changeset 459000 ff120b4eeb79
parent 458999 fe583e7aae8d
child 459001 2bd48db9cd0f
push id111909
push usermaglione.k@gmail.com
push dateThu, 14 Feb 2019 02:30:40 +0000
treeherdermozilla-inbound@81dc12cc9257 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1524688
milestone67.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 1524688: Part 27 - Convert TelemetryStartup to static registration. r=gfritzsche
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/telemetry/TelemetryStartup.js
toolkit/components/telemetry/TelemetryStartup.jsm
toolkit/components/telemetry/TelemetryStartup.manifest
toolkit/components/telemetry/components.conf
toolkit/components/telemetry/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -229,18 +229,16 @@
 @RESPATH@/components/FxAccountsComponents.manifest
 @RESPATH@/components/FxAccountsPush.js
 @RESPATH@/components/CaptivePortalDetectComponents.manifest
 @RESPATH@/components/captivedetect.js
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
 @RESPATH@/components/RemoteSettingsComponents.js
 @RESPATH@/components/cryptoComponents.manifest
-@RESPATH@/components/TelemetryStartup.js
-@RESPATH@/components/TelemetryStartup.manifest
 @RESPATH@/components/recording-cmdline.js
 @RESPATH@/components/recording-cmdline.manifest
 @RESPATH@/components/htmlMenuBuilder.js
 @RESPATH@/components/htmlMenuBuilder.manifest
 
 @RESPATH@/components/NotificationStorage.js
 @RESPATH@/components/NotificationStorage.manifest
 @RESPATH@/components/Push.manifest
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -151,21 +151,16 @@
 @BINPATH@/components/HandlerService.manifest
 @BINPATH@/components/HandlerService.js
 @BINPATH@/components/contentAreaDropListener.manifest
 @BINPATH@/components/contentAreaDropListener.js
 @BINPATH@/components/servicesComponents.manifest
 @BINPATH@/components/servicesSettings.manifest
 @BINPATH@/components/RemoteSettingsComponents.js
 
-#ifndef MOZ_GECKOVIEW_JAR
-@BINPATH@/components/TelemetryStartup.js
-@BINPATH@/components/TelemetryStartup.manifest
-#endif
-
 @BINPATH@/components/htmlMenuBuilder.js
 @BINPATH@/components/htmlMenuBuilder.manifest
 
 @BINPATH@/components/CaptivePortalDetectComponents.manifest
 @BINPATH@/components/captivedetect.js
 
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @BINPATH@/components/TestInterfaceJS.js
rename from toolkit/components/telemetry/TelemetryStartup.js
rename to toolkit/components/telemetry/TelemetryStartup.jsm
--- a/toolkit/components/telemetry/TelemetryStartup.js
+++ b/toolkit/components/telemetry/TelemetryStartup.jsm
@@ -1,30 +1,27 @@
 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
-
 ChromeUtils.defineModuleGetter(this, "TelemetryController",
                                "resource://gre/modules/TelemetryController.jsm");
 ChromeUtils.defineModuleGetter(this, "TelemetryEnvironment",
                                "resource://gre/modules/TelemetryEnvironment.jsm");
 
 /**
  * TelemetryStartup is needed to forward the "profile-after-change" notification
  * to TelemetryController.jsm.
  */
 function TelemetryStartup() {
 }
 
-TelemetryStartup.prototype.classID = Components.ID("{117b219f-92fe-4bd2-a21b-95a342a9d474}");
 TelemetryStartup.prototype.QueryInterface = ChromeUtils.generateQI([Ci.nsIObserver]);
 TelemetryStartup.prototype.observe = function(aSubject, aTopic, aData) {
   if (aTopic == "profile-after-change") {
     // In the content process, this is done in ContentProcessSingleton.js.
     TelemetryController.observe(null, aTopic, null);
   }
   if (aTopic == "profile-after-change") {
     annotateEnvironment();
@@ -40,9 +37,9 @@ function annotateEnvironment() {
       let env = JSON.stringify(TelemetryEnvironment.currentEnvironment);
       cr.getService(Ci.nsICrashReporter).annotateCrashReport("TelemetryEnvironment", env);
     }
   } catch (e) {
     // crash reporting not built or disabled? Ignore errors
   }
 }
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryStartup]);
+var EXPORTED_SYMBOLS = ["TelemetryStartup"];
deleted file mode 100644
--- a/toolkit/components/telemetry/TelemetryStartup.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {117b219f-92fe-4bd2-a21b-95a342a9d474} TelemetryStartup.js
-contract @mozilla.org/base/telemetry-startup;1 {117b219f-92fe-4bd2-a21b-95a342a9d474}
-category profile-after-change TelemetryStartup @mozilla.org/base/telemetry-startup;1 process=main
new file mode 100644
--- /dev/null
+++ b/toolkit/components/telemetry/components.conf
@@ -0,0 +1,16 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+Classes = [
+    {
+        'cid': '{117b219f-92fe-4bd2-a21b-95a342a9d474}',
+        'contract_ids': ['@mozilla.org/base/telemetry-startup;1'],
+        'jsm': 'resource://gre/modules/TelemetryStartup.jsm',
+        'constructor': 'TelemetryStartup',
+        'categories': {'profile-after-change': 'TelemetryStartup'},
+        'processes': ProcessSelector.MAIN_PROCESS_ONLY,
+    },
+]
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -89,24 +89,20 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 
 # KeyedStackCapturer entirely relies on profiler to be enabled.
 if CONFIG['MOZ_GECKO_PROFILER']:
     SOURCES += [
       'other/KeyedStackCapturer.cpp'
     ]
 
 XPCOM_MANIFESTS += [
+    'components.conf',
     'core/components.conf',
 ]
 
-EXTRA_COMPONENTS += [
-    'TelemetryStartup.js',
-    'TelemetryStartup.manifest'
-]
-
 EXTRA_JS_MODULES += [
     'app/TelemetryArchive.jsm',
     'app/TelemetryController.jsm',
     'app/TelemetryEnvironment.jsm',
     'app/TelemetryReportingPolicy.jsm',
     'app/TelemetrySend.jsm',
     'app/TelemetryStorage.jsm',
     'app/TelemetryTimestamps.jsm',
@@ -115,16 +111,17 @@ EXTRA_JS_MODULES += [
     'other/UITelemetry.jsm',
     'pings/CoveragePing.jsm',
     'pings/EventPing.jsm',
     'pings/HealthPing.jsm',
     'pings/ModulesPing.jsm',
     'pings/TelemetrySession.jsm',
     'pings/UntrustedModulesPing.jsm',
     'pings/UpdatePing.jsm',
+    'TelemetryStartup.jsm',
 ]
 
 TESTING_JS_MODULES += [
   'tests/unit/TelemetryArchiveTesting.jsm',
 ]
 
 PYTHON_UNITTEST_MANIFESTS += [
     'tests/python/python.ini',