Bug 1524688: Part 43 - Convert RemoteSettingsComponents to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:03:10 -0800
changeset 459015 09f626870ad0
parent 459014 fe9b6695212e
child 459016 e657e77d4271
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 43 - Convert RemoteSettingsComponents to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18453
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
services/settings/RemoteSettingsComponents.js
services/settings/RemoteSettingsComponents.jsm
services/settings/components.conf
services/settings/moz.build
services/settings/servicesSettings.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -215,17 +215,16 @@
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
 @RESPATH@/components/SyncComponents.manifest
 @RESPATH@/components/FxAccountsComponents.manifest
 @RESPATH@/components/FxAccountsPush.js
 @RESPATH@/components/servicesComponents.manifest
 @RESPATH@/components/servicesSettings.manifest
-@RESPATH@/components/RemoteSettingsComponents.js
 @RESPATH@/components/cryptoComponents.manifest
 @RESPATH@/components/recording-cmdline.js
 @RESPATH@/components/recording-cmdline.manifest
 @RESPATH@/components/htmlMenuBuilder.js
 @RESPATH@/components/htmlMenuBuilder.manifest
 
 @RESPATH@/components/NotificationStorage.js
 @RESPATH@/components/NotificationStorage.manifest
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -142,17 +142,16 @@
 
 @BINPATH@/components/ProcessSingleton.manifest
 @BINPATH@/components/HandlerService.manifest
 @BINPATH@/components/HandlerService.js
 @BINPATH@/components/contentAreaDropListener.manifest
 @BINPATH@/components/contentAreaDropListener.js
 @BINPATH@/components/servicesComponents.manifest
 @BINPATH@/components/servicesSettings.manifest
-@BINPATH@/components/RemoteSettingsComponents.js
 
 @BINPATH@/components/htmlMenuBuilder.js
 @BINPATH@/components/htmlMenuBuilder.manifest
 
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @BINPATH@/components/TestInterfaceJS.js
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
rename from services/settings/RemoteSettingsComponents.js
rename to services/settings/RemoteSettingsComponents.jsm
--- a/services/settings/RemoteSettingsComponents.js
+++ b/services/settings/RemoteSettingsComponents.jsm
@@ -2,27 +2,24 @@
  * 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/. */
  "use strict";
 
 var EXPORTED_SYMBOLS = [
   "RemoteSettingsTimer",
 ];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "RemoteSettings",
   "resource://services-settings/remote-settings.js");
 
 
 var RemoteSettingsTimer = function() {};
 RemoteSettingsTimer.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsITimerCallback]),
   classID: Components.ID("{5e756573-234a-49ea-bbe4-59ec7a70657d}"),
   contractID: "@mozilla.org/services/settings;1",
 
   // By default, this timer fires once every 24 hours. See the "services.settings.poll_interval" pref.
   notify(timer) {
     RemoteSettings.pollChanges()
       .catch(e => Cu.reportError(e));
   },
 };
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RemoteSettingsTimer]);
new file mode 100644
--- /dev/null
+++ b/services/settings/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': '{5e756573-234a-49ea-bbe4-59ec7a70657d}',
+        'contract_ids': ['@mozilla.org/services/settings;1'],
+        'jsm': 'resource://services-settings/RemoteSettingsComponents.jsm',
+        'constructor': 'RemoteSettingsTimer',
+    },
+]
--- a/services/settings/moz.build
+++ b/services/settings/moz.build
@@ -5,21 +5,25 @@
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'Remote Settings Client')
 
 DIRS += [
     'dumps',
 ]
 
 EXTRA_COMPONENTS += [
-    'RemoteSettingsComponents.js',
     'servicesSettings.manifest',
 ]
 
 EXTRA_JS_MODULES['services-settings'] += [
     'remote-settings.js',
     'RemoteSettingsClient.jsm',
+    'RemoteSettingsComponents.jsm',
     'RemoteSettingsWorker.js',
     'RemoteSettingsWorker.jsm',
     'Utils.jsm',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
--- a/services/settings/servicesSettings.manifest
+++ b/services/settings/servicesSettings.manifest
@@ -1,7 +1,5 @@
 # Register resource aliases
 resource services-settings resource://gre/modules/services-settings/
 
 # Schedule polling of remote settings changes
-component {5e756573-234a-49ea-bbe4-59ec7a70657d} RemoteSettingsComponents.js
-contract @mozilla.org/services/settings;1 {5e756573-234a-49ea-bbe4-59ec7a70657d}
 category update-timer RemoteSettingsComponents @mozilla.org/services/settings;1,getService,services-settings-poll-changes,services.settings.poll_interval,86400