From 020583d8bdab75823fb3fcbee9d9e91fd7b7b5b2 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 29 Jan 2019 21:17:26 -0800 Subject: [PATCH] Bug 1524688: Part 22 - Convert URLFormatter to static registration. r=aswan --HG-- rename : toolkit/components/urlformatter/nsURLFormatter.js => toolkit/components/urlformatter/URLFormatter.jsm extra : source : dd89eb7e9b0d03d762b6bec4e90f5a956cdbe803 --- browser/installer/package-manifest.in | 2 -- mobile/android/installer/package-manifest.in | 2 -- .../{nsURLFormatter.js => URLFormatter.jsm} | 2 +- toolkit/components/urlformatter/components.conf | 14 ++++++++++++++ toolkit/components/urlformatter/moz.build | 9 ++++++--- .../urlformatter/nsURLFormatter.manifest | 2 -- 6 files changed, 21 insertions(+), 10 deletions(-) rename toolkit/components/urlformatter/{nsURLFormatter.js => URLFormatter.jsm} (98%) create mode 100644 toolkit/components/urlformatter/components.conf delete mode 100644 toolkit/components/urlformatter/nsURLFormatter.manifest diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 2dbe3818e12c..81e631b67755 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -214,8 +214,6 @@ @RESPATH@/components/nsUpdateTimerManager.manifest @RESPATH@/components/nsUpdateTimerManager.js @RESPATH@/components/ProcessSingleton.manifest -@RESPATH@/components/nsURLFormatter.manifest -@RESPATH@/components/nsURLFormatter.js @RESPATH@/components/PageThumbsStorageService.js @RESPATH@/components/mozProtocolHandler.js @RESPATH@/components/mozProtocolHandler.manifest diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index a145601ee45e..4cadd01b172b 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -151,8 +151,6 @@ @BINPATH@/components/nsUpdateTimerManager.js @BINPATH@/components/ProcessSingleton.manifest -@BINPATH@/components/nsURLFormatter.manifest -@BINPATH@/components/nsURLFormatter.js @BINPATH@/components/ContentPrefService2.manifest @BINPATH@/components/ContentPrefService2.js @BINPATH@/components/HandlerService.manifest diff --git a/toolkit/components/urlformatter/nsURLFormatter.js b/toolkit/components/urlformatter/URLFormatter.jsm similarity index 98% rename from toolkit/components/urlformatter/nsURLFormatter.js rename to toolkit/components/urlformatter/URLFormatter.jsm index 7e5a547b9620..5a9c3a73540c 100644 --- a/toolkit/components/urlformatter/nsURLFormatter.js +++ b/toolkit/components/urlformatter/URLFormatter.jsm @@ -133,4 +133,4 @@ nsURLFormatterService.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsURLFormatterService]); +var EXPORTED_SYMBOLS = ["nsURLFormatterService"]; diff --git a/toolkit/components/urlformatter/components.conf b/toolkit/components/urlformatter/components.conf new file mode 100644 index 000000000000..f41c89b3fc52 --- /dev/null +++ b/toolkit/components/urlformatter/components.conf @@ -0,0 +1,14 @@ +# -*- 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': '{e6156350-2be8-11db-a98b-0800200c9a66}', + 'contract_ids': ['@mozilla.org/toolkit/URLFormatterService;1'], + 'jsm': 'resource://gre/modules/URLFormatter.jsm', + 'constructor': 'nsURLFormatterService', + }, +] diff --git a/toolkit/components/urlformatter/moz.build b/toolkit/components/urlformatter/moz.build index 6a13571494cc..7007d6ade2ec 100644 --- a/toolkit/components/urlformatter/moz.build +++ b/toolkit/components/urlformatter/moz.build @@ -15,9 +15,12 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'urlformatter' -EXTRA_COMPONENTS += [ - 'nsURLFormatter.js', - 'nsURLFormatter.manifest', +EXTRA_JS_MODULES += [ + 'URLFormatter.jsm', +] + +XPCOM_MANIFESTS += [ + 'components.conf', ] DEFINES['OBJDIR'] = OBJDIR diff --git a/toolkit/components/urlformatter/nsURLFormatter.manifest b/toolkit/components/urlformatter/nsURLFormatter.manifest deleted file mode 100644 index 3f9123d7357a..000000000000 --- a/toolkit/components/urlformatter/nsURLFormatter.manifest +++ /dev/null @@ -1,2 +0,0 @@ -component {e6156350-2be8-11db-a98b-0800200c9a66} nsURLFormatter.js -contract @mozilla.org/toolkit/URLFormatterService;1 {e6156350-2be8-11db-a98b-0800200c9a66}