Bug 1524688: Part 41 - Convert BHRTelemetry to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:52:24 -0800
changeset 459013 995ea188bc31
parent 459012 01c4d3edb1b0
child 459014 fe9b6695212e
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)
reviewersmconley
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 41 - Convert BHRTelemetry to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18451
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/backgroundhangmonitor/BHRTelemetryService.js
toolkit/components/backgroundhangmonitor/BHRTelemetryService.jsm
toolkit/components/backgroundhangmonitor/BHRTelemetryService.manifest
toolkit/components/backgroundhangmonitor/components.conf
toolkit/components/backgroundhangmonitor/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -505,18 +505,11 @@ bin/libfreebl_32int64_3.so
 #ifdef XP_MACOSX
 @RESPATH@/fix_macosx_stack.py
 #endif
 #ifdef XP_LINUX
 @RESPATH@/fix_linux_stack.py
 #endif
 #endif
 
-; NOTE: This must match the config checks in
-; /toolkit/components/backgroundhangmonitor/moz.build.
-#if defined(NIGHTLY_BUILD) && !defined(MOZ_DEBUG) && !defined(MOZ_TSAN) && !defined(MOZ_ASAN)
-@RESPATH@/components/BHRTelemetryService.js
-@RESPATH@/components/BHRTelemetryService.manifest
-#endif
-
 #ifdef PKG_LOCALE_MANIFEST
 #include @PKG_LOCALE_MANIFEST@
 #endif
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -300,15 +300,8 @@
 @BINPATH@/components/marionette.manifest
 @BINPATH@/components/marionette.js
 @BINPATH@/defaults/pref/marionette.js
 #endif
 
 #ifdef PKG_LOCALE_MANIFEST
 #include @PKG_LOCALE_MANIFEST@
 #endif
-
-; NOTE: This must match the config checks in
-; /toolkit/components/backgroundhangmonitor/moz.build.
-#if defined(NIGHTLY_BUILD) && !defined(MOZ_DEBUG) && !defined(MOZ_TSAN) && !defined(MOZ_ASAN)
-@BINPATH@/components/BHRTelemetryService.js
-@BINPATH@/components/BHRTelemetryService.manifest
-#endif
rename from toolkit/components/backgroundhangmonitor/BHRTelemetryService.js
rename to toolkit/components/backgroundhangmonitor/BHRTelemetryService.jsm
--- a/toolkit/components/backgroundhangmonitor/BHRTelemetryService.js
+++ b/toolkit/components/backgroundhangmonitor/BHRTelemetryService.jsm
@@ -1,15 +1,14 @@
 /* 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.import("resource://gre/modules/Services.jsm", this);
 
 ChromeUtils.defineModuleGetter(this, "TelemetryController",
                                "resource://gre/modules/TelemetryController.jsm");
 
 function BHRTelemetryService() {
   // Allow tests to get access to this object to verify it works correctly.
   this.wrappedJSObject = this;
@@ -118,9 +117,9 @@ BHRTelemetryService.prototype = Object.f
       break;
     case "idle-daily":
       this.submit();
       break;
     }
   },
 });
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BHRTelemetryService]);
+var EXPORTED_SYMBOLS = ["BHRTelemetryService"];
deleted file mode 100644
--- a/toolkit/components/backgroundhangmonitor/BHRTelemetryService.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {117c8cdf-69e6-4f31-a439-b8a654c67127} BHRTelemetryService.js process=main
-contract @mozilla.org/bhr-telemetry-service;1 {117c8cdf-69e6-4f31-a439-b8a654c67127} process=main
-category profile-after-change BHRTelemetryService @mozilla.org/bhr-telemetry-service;1 process=main
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/toolkit/components/backgroundhangmonitor/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': '{117c8cdf-69e6-4f31-a439-b8a654c67127}',
+        'contract_ids': ['@mozilla.org/bhr-telemetry-service;1'],
+        'jsm': 'resource://gre/modules/BHRTelemetryService.jsm',
+        'constructor': 'BHRTelemetryService',
+        'categories': {'profile-after-change': 'BHRTelemetryService'},
+        'processes': ProcessSelector.MAIN_PROCESS_ONLY,
+    },
+]
--- a/toolkit/components/backgroundhangmonitor/moz.build
+++ b/toolkit/components/backgroundhangmonitor/moz.build
@@ -13,19 +13,22 @@
 # BHR disabled for TSan builds because of bug 1121216.
 # BHR disabled for ASan builds because of bug 1445441.
 if CONFIG['NIGHTLY_BUILD'] and \
    not CONFIG['MOZ_DEBUG'] and \
    not CONFIG['MOZ_TSAN'] and \
    not CONFIG['MOZ_ASAN']:
     DEFINES['MOZ_ENABLE_BACKGROUND_HANG_MONITOR'] = 1
 
-    EXTRA_COMPONENTS += [
-        'BHRTelemetryService.js',
-        'BHRTelemetryService.manifest',
+    EXTRA_JS_MODULES += [
+        'BHRTelemetryService.jsm',
+    ]
+
+    XPCOM_MANIFESTS += [
+        'components.conf',
     ]
 
     XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini']
 
 XPIDL_SOURCES += [
     'nsIHangDetails.idl',
 ]