From dac8038c04fdb40cf96635963586db4f35e3c366 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 30 Jan 2019 10:41:14 -0800 Subject: [PATCH] Bug 1524688: Part 36 - Convert nsCrashMonitor to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18446 --HG-- rename : toolkit/components/crashmonitor/nsCrashMonitor.js => toolkit/components/crashmonitor/nsCrashMonitor.jsm extra : rebase_source : b83120741bcc21c5c61f2611ed05a86075ced2b1 --- browser/installer/package-manifest.in | 2 -- toolkit/components/crashmonitor/components.conf | 15 +++++++++++++++ .../components/crashmonitor/crashmonitor.manifest | 3 --- toolkit/components/crashmonitor/moz.build | 6 +++--- .../{nsCrashMonitor.js => nsCrashMonitor.jsm} | 4 +--- 5 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 toolkit/components/crashmonitor/components.conf delete mode 100644 toolkit/components/crashmonitor/crashmonitor.manifest rename toolkit/components/crashmonitor/{nsCrashMonitor.js => nsCrashMonitor.jsm} (81%) diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 9368ac987079..72eeee130b1d 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -191,8 +191,6 @@ @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 diff --git a/toolkit/components/crashmonitor/components.conf b/toolkit/components/crashmonitor/components.conf new file mode 100644 index 000000000000..72e08d63c515 --- /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'}, + }, +] diff --git a/toolkit/components/crashmonitor/crashmonitor.manifest b/toolkit/components/crashmonitor/crashmonitor.manifest deleted file mode 100644 index 59e336f82a6a..000000000000 --- 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 diff --git a/toolkit/components/crashmonitor/moz.build b/toolkit/components/crashmonitor/moz.build index df2876762fe5..5d7b5086eb1e 100644 --- a/toolkit/components/crashmonitor/moz.build +++ b/toolkit/components/crashmonitor/moz.build @@ -11,9 +11,9 @@ XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini'] EXTRA_JS_MODULES += [ 'CrashMonitor.jsm', + 'nsCrashMonitor.jsm', ] -EXTRA_COMPONENTS += [ - 'crashmonitor.manifest', - 'nsCrashMonitor.js', +XPCOM_MANIFESTS += [ + 'components.conf', ] diff --git a/toolkit/components/crashmonitor/nsCrashMonitor.js b/toolkit/components/crashmonitor/nsCrashMonitor.jsm similarity index 81% rename from toolkit/components/crashmonitor/nsCrashMonitor.js rename to toolkit/components/crashmonitor/nsCrashMonitor.jsm index 9704939fb968..0ccef5a48573 100644 --- a/toolkit/components/crashmonitor/nsCrashMonitor.js +++ b/toolkit/components/crashmonitor/nsCrashMonitor.jsm @@ -2,8 +2,6 @@ * 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() {} @@ -23,4 +21,4 @@ CrashMonitor.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CrashMonitor]); +var EXPORTED_SYMBOLS = ["CrashMonitor"];