Bug 1524688: Part 37 - Convert CrashService to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:43:16 -0800
changeset 459009 c819943ff466
parent 459008 a1dd5cec066e
child 459010 56c61e0a1f45
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 37 - Convert CrashService to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18447
browser/installer/package-manifest.in
toolkit/components/crashes/CrashService.js
toolkit/components/crashes/CrashService.jsm
toolkit/components/crashes/CrashService.manifest
toolkit/components/crashes/components.conf
toolkit/components/crashes/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -460,18 +460,16 @@ bin/libfreebl_32int64_3.so
 #ifdef MOZ_MAINTENANCE_SERVICE
 @BINPATH@/maintenanceservice.exe
 @BINPATH@/maintenanceservice_installer.exe
 #endif
 
 ; [Crash Reporter]
 ;
 #ifdef MOZ_CRASHREPORTER
-@RESPATH@/components/CrashService.manifest
-@RESPATH@/components/CrashService.js
 #ifdef XP_MACOSX
 @BINPATH@/crashreporter.app/
 #else
 @BINPATH@/crashreporter@BIN_SUFFIX@
 @RESPATH@/crashreporter.ini
 @BINPATH@/minidump-analyzer@BIN_SUFFIX@
 #ifdef XP_UNIX
 @RESPATH@/Throbber-small.gif
rename from toolkit/components/crashes/CrashService.js
rename to toolkit/components/crashes/CrashService.jsm
--- a/toolkit/components/crashes/CrashService.js
+++ b/toolkit/components/crashes/CrashService.jsm
@@ -3,19 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm", this);
 ChromeUtils.import("resource://gre/modules/AsyncShutdown.jsm", this);
 const {parseKeyValuePairs} = ChromeUtils.import("resource://gre/modules/KeyValueParser.jsm");
 ChromeUtils.import("resource://gre/modules/osfile.jsm", this);
-ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm", this);
 ChromeUtils.import("resource://gre/modules/Services.jsm", this);
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
 // Set to true if the application is quitting
 var gQuitting = false;
 
 // Tracks all the running instances of the minidump-analyzer
 var gRunningProcesses = new Set();
 
 /**
@@ -258,9 +256,9 @@ CrashService.prototype = Object.freeze({
           }
           Services.obs.notifyObservers(null, "test-minidump-analyzer-killed");
         });
         break;
     }
   },
 });
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CrashService]);
+var EXPORTED_SYMBOLS = ["CrashService"];
deleted file mode 100644
--- a/toolkit/components/crashes/CrashService.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {92668367-1b17-4190-86b2-1061b2179744} CrashService.js
-contract @mozilla.org/crashservice;1 {92668367-1b17-4190-86b2-1061b2179744}
-category profile-after-change CrashService @mozilla.org/crashservice;1
new file mode 100644
--- /dev/null
+++ b/toolkit/components/crashes/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': '{92668367-1b17-4190-86b2-1061b2179744}',
+        'contract_ids': ['@mozilla.org/crashservice;1'],
+        'jsm': 'resource://gre/modules/CrashService.jsm',
+        'constructor': 'CrashService',
+        'categories': {'profile-after-change': 'CrashService'},
+    },
+]
--- a/toolkit/components/crashes/moz.build
+++ b/toolkit/components/crashes/moz.build
@@ -11,23 +11,23 @@ with Files('docs/**'):
 
 XPIDL_MODULE = 'toolkit_crashservice'
 
 XPIDL_SOURCES += [
     'nsICrashService.idl',
 ]
 
 if CONFIG['MOZ_CRASHREPORTER']:
-    EXTRA_COMPONENTS += [
-        'CrashService.js',
-        'CrashService.manifest',
+    EXTRA_JS_MODULES += [
+        'CrashManager.jsm',
+        'CrashService.jsm',
     ]
 
-    EXTRA_JS_MODULES += [
-        'CrashManager.jsm',
+    XPCOM_MANIFESTS += [
+        'components.conf',
     ]
 
     TESTING_JS_MODULES += [
         'CrashManagerTest.jsm',
     ]
 
     XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']