Bug 1524688: Part 33 - Convert mozIntl to static registration. r=zbraniecki
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:34:41 -0800
changeset 459005 56f5c8f0d708
parent 459004 5746311ef859
child 459006 f509a5759fdf
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)
reviewerszbraniecki
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 33 - Convert mozIntl to static registration. r=zbraniecki Differential Revision: https://phabricator.services.mozilla.com/D18443
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/mozintl/components.conf
toolkit/components/mozintl/moz.build
toolkit/components/mozintl/mozIntl.js
toolkit/components/mozintl/mozIntl.jsm
toolkit/components/mozintl/mozIntl.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -258,19 +258,16 @@
 #endif
 
 @RESPATH@/components/nsAsyncShutdown.manifest
 @RESPATH@/components/nsAsyncShutdown.js
 
 @RESPATH@/components/BuiltinProviders.manifest
 @RESPATH@/components/PresentationControlService.js
 
-@RESPATH@/components/mozIntl.manifest
-@RESPATH@/components/mozIntl.js
-
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @RESPATH@/components/TestInterfaceJS.js
 @RESPATH@/components/TestInterfaceJS.manifest
 @RESPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 #if defined(MOZ_DEBUG) || defined(MOZ_DEV_EDITION) || defined(NIGHTLY_BUILD)
 @RESPATH@/browser/components/testComponents.manifest
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -176,19 +176,16 @@
 @BINPATH@/components/BuiltinProviders.manifest
 @BINPATH@/components/PresentationControlService.js
 @BINPATH@/components/PresentationNetworkHelper.js
 @BINPATH@/components/PresentationNetworkHelper.manifest
 @BINPATH@/components/AndroidCastDeviceProvider.manifest
 @BINPATH@/components/AndroidCastDeviceProvider.js
 #endif
 
-@BINPATH@/components/mozIntl.manifest
-@BINPATH@/components/mozIntl.js
-
 ; Modules
 @BINPATH@/modules/*
 @BINPATH@/actors/*
 
 ; Security Reports
 @BINPATH@/components/SecurityReporter.manifest
 @BINPATH@/components/SecurityReporter.js
 
--- a/toolkit/components/mozintl/components.conf
+++ b/toolkit/components/mozintl/components.conf
@@ -6,9 +6,15 @@
 
 Classes = [
     {
         'cid': '{b43c96be-2b3a-4dc4-90e9-b06d34219b68}',
         'contract_ids': ['@mozilla.org/mozintlhelper;1'],
         'type': 'mozilla::MozIntlHelper',
         'headers': ['/toolkit/components/mozintl/MozIntlHelper.h'],
     },
+    {
+        'cid': '{35ec195a-e8d0-4300-83af-c8a2cc84b4a3}',
+        'contract_ids': ['@mozilla.org/mozintl;1'],
+        'jsm': 'resource://gre/modules/mozIntl.jsm',
+        'constructor': 'MozIntl',
+    },
 ]
--- a/toolkit/components/mozintl/moz.build
+++ b/toolkit/components/mozintl/moz.build
@@ -15,18 +15,17 @@ XPIDL_SOURCES += [
 ]
 
 XPIDL_MODULE = 'mozintl'
 
 SOURCES += [
     'MozIntlHelper.cpp',
 ]
 
-EXTRA_COMPONENTS += [
-    'mozIntl.js',
-    'mozIntl.manifest',
+EXTRA_JS_MODULES += [
+    'mozIntl.jsm',
 ]
 
 XPCOM_MANIFESTS += [
     'components.conf',
 ]
 
 FINAL_LIBRARY = 'xul'
rename from toolkit/components/mozintl/mozIntl.js
rename to toolkit/components/mozintl/mozIntl.jsm
--- a/toolkit/components/mozintl/mozIntl.js
+++ b/toolkit/components/mozintl/mozIntl.jsm
@@ -1,13 +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");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const { LocalizationSync } = ChromeUtils.import("resource://gre/modules/Localization.jsm", null);
 
 const mozIntlHelper =
   Cc["@mozilla.org/mozintlhelper;1"].getService(Ci.mozIMozIntlHelper);
 const osPrefs =
   Cc["@mozilla.org/intl/ospreferences;1"].getService(Ci.mozIOSPreferences);
 
@@ -504,10 +503,9 @@ class MozIntl {
     }
     return MozRelativeTimeFormat;
   }
 }
 
 MozIntl.prototype.classID = Components.ID("{35ec195a-e8d0-4300-83af-c8a2cc84b4a3}");
 MozIntl.prototype.QueryInterface = ChromeUtils.generateQI([Ci.mozIMozIntl]);
 
-var components = [MozIntl];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+var EXPORTED_SYMBOLS = ["MozIntl"];
deleted file mode 100644
--- a/toolkit/components/mozintl/mozIntl.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {35ec195a-e8d0-4300-83af-c8a2cc84b4a3} mozIntl.js
-contract @mozilla.org/mozintl;1 {35ec195a-e8d0-4300-83af-c8a2cc84b4a3}