Bug 1524688: Part 38 - Convert ContentPrefService2 to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:45:03 -0800
changeset 459010 56c61e0a1f45
parent 459009 c819943ff466
child 459011 1bb7dfbb9f48
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 38 - Convert ContentPrefService2 to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18448
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/contentprefs/ContentPrefService2.js
toolkit/components/contentprefs/ContentPrefService2.jsm
toolkit/components/contentprefs/ContentPrefService2.manifest
toolkit/components/contentprefs/components.conf
toolkit/components/contentprefs/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -200,18 +200,16 @@
 @RESPATH@/components/WebVTTParserWrapper.js
 @RESPATH@/components/nsHelperAppDlg.manifest
 @RESPATH@/components/nsHelperAppDlg.js
 @RESPATH@/components/extensions.manifest
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/ProcessSingleton.manifest
-@RESPATH@/components/ContentPrefService2.manifest
-@RESPATH@/components/ContentPrefService2.js
 @RESPATH@/components/nsContentDispatchChooser.manifest
 @RESPATH@/components/nsContentDispatchChooser.js
 @RESPATH@/components/contentAreaDropListener.manifest
 @RESPATH@/components/contentAreaDropListener.js
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
 #ifdef XP_MACOSX
 @RESPATH@/browser/components/MacTouchBar.manifest
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -139,18 +139,16 @@
 @BINPATH@/components/nsUpdateService.manifest
 #endif
 #endif
 
 @BINPATH@/components/ClearDataService.manifest
 @BINPATH@/components/ClearDataService.js
 
 @BINPATH@/components/ProcessSingleton.manifest
-@BINPATH@/components/ContentPrefService2.manifest
-@BINPATH@/components/ContentPrefService2.js
 @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
 
rename from toolkit/components/contentprefs/ContentPrefService2.js
rename to toolkit/components/contentprefs/ContentPrefService2.jsm
--- a/toolkit/components/contentprefs/ContentPrefService2.js
+++ b/toolkit/components/contentprefs/ContentPrefService2.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 {ContentPref, cbHandleCompletion, cbHandleError, cbHandleResult} = ChromeUtils.import("resource://gre/modules/ContentPrefUtils.jsm");
 const {ContentPrefStore} = ChromeUtils.import("resource://gre/modules/ContentPrefStore.jsm");
 ChromeUtils.defineModuleGetter(this, "OS",
                                "resource://gre/modules/osfile.jsm");
 ChromeUtils.defineModuleGetter(this, "Sqlite",
                                "resource://gre/modules/Sqlite.jsm");
 
@@ -1238,10 +1237,9 @@ function checkCallbackArg(callback, requ
 }
 
 function invalidArg(msg) {
   return Components.Exception(msg, Cr.NS_ERROR_INVALID_ARG);
 }
 
 // XPCOM Plumbing
 
-var components = [ContentPrefService2];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+var EXPORTED_SYMBOLS = ["ContentPrefService2"];
deleted file mode 100644
--- a/toolkit/components/contentprefs/ContentPrefService2.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {e3f772f3-023f-4b32-b074-36cf0fd5d414} ContentPrefService2.js
-contract @mozilla.org/content-pref/service;1 {e3f772f3-023f-4b32-b074-36cf0fd5d414}
-
new file mode 100644
--- /dev/null
+++ b/toolkit/components/contentprefs/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': '{e3f772f3-023f-4b32-b074-36cf0fd5d414}',
+        'contract_ids': ['@mozilla.org/content-pref/service;1'],
+        'jsm': 'resource://gre/modules/ContentPrefService2.jsm',
+        'constructor': 'ContentPrefService2',
+    },
+]
--- a/toolkit/components/contentprefs/moz.build
+++ b/toolkit/components/contentprefs/moz.build
@@ -7,22 +7,22 @@
 XPCSHELL_TESTS_MANIFESTS += [
     'tests/unit_cps2/xpcshell.ini',
 ]
 
 MOCHITEST_MANIFESTS += [
     'tests/mochitest/mochitest.ini'
 ]
 
-EXTRA_COMPONENTS += [
-    'ContentPrefService2.js',
-    'ContentPrefService2.manifest',
-]
-
 EXTRA_JS_MODULES += [
+    'ContentPrefService2.jsm',
     'ContentPrefServiceChild.jsm',
     'ContentPrefServiceParent.jsm',
     'ContentPrefStore.jsm',
     'ContentPrefUtils.jsm',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Preferences')