Bug 1524688: Part 36 - Convert nsCrashMonitor to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:41:14 -0800
changeset 459008 a1dd5cec066e
parent 459007 517838ee0c3c
child 459009 c819943ff466
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 36 - Convert nsCrashMonitor to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18446
browser/installer/package-manifest.in
toolkit/components/crashmonitor/components.conf
toolkit/components/crashmonitor/crashmonitor.manifest
toolkit/components/crashmonitor/moz.build
toolkit/components/crashmonitor/nsCrashMonitor.js
toolkit/components/crashmonitor/nsCrashMonitor.jsm
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -186,18 +186,16 @@
 @RESPATH@/browser/components/aboutdevtools.manifest
 @RESPATH@/browser/components/aboutdevtoolstoolbox-registration.js
 @RESPATH@/browser/components/aboutdevtoolstoolbox.manifest
 @RESPATH@/browser/components/aboutNewTabService.js
 @RESPATH@/browser/components/NewTabComponents.manifest
 @RESPATH@/browser/components/EnterprisePolicies.js
 @RESPATH@/browser/components/EnterprisePoliciesContent.js
 @RESPATH@/browser/components/EnterprisePolicies.manifest
-@RESPATH@/components/crashmonitor.manifest
-@RESPATH@/components/nsCrashMonitor.js
 @RESPATH@/components/toolkitsearch.manifest
 #ifdef NIGHTLY_BUILD
 @RESPATH@/browser/components/payments.manifest
 @RESPATH@/browser/components/paymentUIService.js
 #endif
 @RESPATH@/components/WebVTT.manifest
 @RESPATH@/components/WebVTTParserWrapper.js
 @RESPATH@/components/nsHelperAppDlg.manifest
new file mode 100644
--- /dev/null
+++ b/toolkit/components/crashmonitor/components.conf
@@ -0,0 +1,15 @@
+# -*- 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': '{d9d75e86-8f17-4c57-993e-f738f0d86d42}',
+        'contract_ids': ['@mozilla.org/toolkit/crashmonitor;1'],
+        'jsm': 'resource://gre/modules/nsCrashMonitor.jsm',
+        'constructor': 'CrashMonitor',
+        'categories': {'profile-after-change': 'CrashMonitor'},
+    },
+]
deleted file mode 100644
--- a/toolkit/components/crashmonitor/crashmonitor.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {d9d75e86-8f17-4c57-993e-f738f0d86d42} nsCrashMonitor.js
-contract @mozilla.org/toolkit/crashmonitor;1 {d9d75e86-8f17-4c57-993e-f738f0d86d42}
-category profile-after-change CrashMonitor @mozilla.org/toolkit/crashmonitor;1
--- a/toolkit/components/crashmonitor/moz.build
+++ b/toolkit/components/crashmonitor/moz.build
@@ -6,14 +6,14 @@
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'General')
 
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
 
 EXTRA_JS_MODULES += [
     'CrashMonitor.jsm',
+    'nsCrashMonitor.jsm',
 ]
 
-EXTRA_COMPONENTS += [
-    'crashmonitor.manifest',
-    'nsCrashMonitor.js',
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
rename from toolkit/components/crashmonitor/nsCrashMonitor.js
rename to toolkit/components/crashmonitor/nsCrashMonitor.jsm
--- a/toolkit/components/crashmonitor/nsCrashMonitor.js
+++ b/toolkit/components/crashmonitor/nsCrashMonitor.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 var MonitorAPI = ChromeUtils.import("resource://gre/modules/CrashMonitor.jsm").CrashMonitor;
 
 function CrashMonitor() {}
 
 CrashMonitor.prototype = {
 
   classID: Components.ID("{d9d75e86-8f17-4c57-993e-f738f0d86d42}"),
   contractID: "@mozilla.org/toolkit/crashmonitor;1",
@@ -18,9 +16,9 @@ CrashMonitor.prototype = {
   observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     case "profile-after-change":
       MonitorAPI.init();
     }
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CrashMonitor]);
+var EXPORTED_SYMBOLS = ["CrashMonitor"];