Bug 1524688: Part 13 - Convert satchel to static registration. r=MattN
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 20:17:06 -0800
changeset 458986 b586d55d76d5
parent 458985 6dcacead1746
child 458987 35a5f031dd1e
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)
reviewersMattN
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 13 - Convert satchel to static registration. r=MattN
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/satchel/FormAutoComplete.jsm
toolkit/components/satchel/FormHistoryStartup.js
toolkit/components/satchel/FormHistoryStartup.jsm
toolkit/components/satchel/InputListAutoComplete.jsm
toolkit/components/satchel/components.conf
toolkit/components/satchel/moz.build
toolkit/components/satchel/nsFormAutoComplete.js
toolkit/components/satchel/nsInputListAutoComplete.js
toolkit/components/satchel/satchel.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -228,20 +228,16 @@
 @RESPATH@/components/ContentPrefService2.manifest
 @RESPATH@/components/ContentPrefService2.js
 @RESPATH@/components/nsContentDispatchChooser.manifest
 @RESPATH@/components/nsContentDispatchChooser.js
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
 @RESPATH@/components/nsWebHandlerApp.manifest
 @RESPATH@/components/nsWebHandlerApp.js
-@RESPATH@/components/satchel.manifest
-@RESPATH@/components/nsFormAutoComplete.js
-@RESPATH@/components/FormHistoryStartup.js
-@RESPATH@/components/nsInputListAutoComplete.js
 @RESPATH@/components/contentAreaDropListener.manifest
 @RESPATH@/components/contentAreaDropListener.js
 #ifdef XP_MACOSX
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
 @RESPATH@/components/SyncComponents.manifest
 @RESPATH@/components/Weave.js
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -160,20 +160,16 @@
 @BINPATH@/components/nsURLFormatter.manifest
 @BINPATH@/components/nsURLFormatter.js
 @BINPATH@/components/ContentPrefService2.manifest
 @BINPATH@/components/ContentPrefService2.js
 @BINPATH@/components/HandlerService.manifest
 @BINPATH@/components/HandlerService.js
 @BINPATH@/components/nsWebHandlerApp.manifest
 @BINPATH@/components/nsWebHandlerApp.js
-@BINPATH@/components/satchel.manifest
-@BINPATH@/components/nsFormAutoComplete.js
-@BINPATH@/components/FormHistoryStartup.js
-@BINPATH@/components/nsInputListAutoComplete.js
 @BINPATH@/components/contentAreaDropListener.manifest
 @BINPATH@/components/contentAreaDropListener.js
 @BINPATH@/components/servicesComponents.manifest
 @BINPATH@/components/servicesSettings.manifest
 @BINPATH@/components/RemoteSettingsComponents.js
 
 #ifndef MOZ_GECKOVIEW_JAR
 @BINPATH@/components/TelemetryStartup.js
rename from toolkit/components/satchel/nsFormAutoComplete.js
rename to toolkit/components/satchel/FormAutoComplete.jsm
--- a/toolkit/components/satchel/nsFormAutoComplete.js
+++ b/toolkit/components/satchel/FormAutoComplete.jsm
@@ -1,16 +1,15 @@
 /* vim: set ts=4 sts=4 sw=4 et tw=80: */
 /* 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/. */
 
 "use strict";
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function isAutocompleteDisabled(aField) {
   if (aField.autocomplete !== "") {
     return aField.autocomplete === "off";
   }
 
   return aField.form && aField.form.autocomplete === "off";
@@ -617,9 +616,9 @@ FormAutoCompleteResult.prototype = {
     let [removedEntry] = this.entries.splice(index, 1);
 
     if (removeFromDB) {
       this.client.remove(removedEntry.text, removedEntry.guid);
     }
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FormAutoComplete]);
+var EXPORTED_SYMBOLS = ["FormAutoComplete"];
rename from toolkit/components/satchel/FormHistoryStartup.js
rename to toolkit/components/satchel/FormHistoryStartup.jsm
--- a/toolkit/components/satchel/FormHistoryStartup.js
+++ b/toolkit/components/satchel/FormHistoryStartup.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");
 
 ChromeUtils.defineModuleGetter(this, "FormHistory",
                                "resource://gre/modules/FormHistory.jsm");
 
 function FormHistoryStartup() { }
 
 FormHistoryStartup.prototype = {
@@ -129,9 +128,9 @@ FormHistoryStartup.prototype = {
           guid,
         });
         break;
       }
     }
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FormHistoryStartup]);
+var EXPORTED_SYMBOLS = ["FormHistoryStartup"];
rename from toolkit/components/satchel/nsInputListAutoComplete.js
rename to toolkit/components/satchel/InputListAutoComplete.jsm
--- a/toolkit/components/satchel/nsInputListAutoComplete.js
+++ b/toolkit/components/satchel/InputListAutoComplete.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 {FormAutoCompleteResult} =
     ChromeUtils.import("resource://gre/modules/nsFormAutoCompleteResult.jsm");
 
 function InputListAutoComplete() {}
 
 InputListAutoComplete.prototype = {
   classID: Components.ID("{bf1e01d0-953e-11df-981c-0800200c9a66}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIInputListAutoComplete]),
@@ -57,10 +56,9 @@ InputListAutoComplete.prototype = {
       labels.push(label);
       values.push(item.value);
     }
 
     return [values, labels];
   },
 };
 
-var component = [InputListAutoComplete];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
+var EXPORTED_SYMBOLS = ["InputListAutoComplete"];
--- a/toolkit/components/satchel/components.conf
+++ b/toolkit/components/satchel/components.conf
@@ -9,9 +9,29 @@ Classes = [
         'cid': '{895db6c7-dbdf-40ea-9f64-b175033243dc}',
         'contract_ids': [
             '@mozilla.org/autocomplete/search;1?name=form-history',
             '@mozilla.org/satchel/form-fill-controller;1',
         ],
         'type': 'nsFormFillController',
         'headers': ['/toolkit/components/satchel/nsFormFillController.h'],
     },
+
+    {
+        'cid': '{c11c21b2-71c9-4f87-a0f8-5e13f50495fd}',
+        'contract_ids': ['@mozilla.org/satchel/form-autocomplete;1'],
+        'jsm': 'resource://gre/modules/FormAutoComplete.jsm',
+        'constructor': 'FormAutoComplete',
+    },
+    {
+        'cid': '{bf1e01d0-953e-11df-981c-0800200c9a66}',
+        'contract_ids': ['@mozilla.org/satchel/inputlist-autocomplete;1'],
+        'jsm': 'resource://gre/modules/InputListAutoComplete.jsm',
+        'constructor': 'InputListAutoComplete',
+    },
+    {
+        'cid': '{3a0012eb-007f-4bb8-aa81-a07385f77a25}',
+        'contract_ids': ['@mozilla.org/satchel/form-history-startup;1'],
+        'jsm': 'resource://gre/modules/FormHistoryStartup.jsm',
+        'constructor': 'FormHistoryStartup',
+        'categories': {'profile-after-change': 'formHistoryStartup'},
+    },
 ]
--- a/toolkit/components/satchel/moz.build
+++ b/toolkit/components/satchel/moz.build
@@ -22,26 +22,22 @@ XPIDL_MODULE = 'satchel'
 SOURCES += [
     'nsFormFillController.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '../build',
 ]
 
-EXTRA_COMPONENTS += [
-    'FormHistoryStartup.js',
-    'nsFormAutoComplete.js',
-    'nsInputListAutoComplete.js',
-    'satchel.manifest',
-]
-
 EXTRA_JS_MODULES += [
     'AutoCompletePopup.jsm',
+    'FormAutoComplete.jsm',
     'FormHistory.jsm',
+    'FormHistoryStartup.jsm',
+    'InputListAutoComplete.jsm',
     'nsFormAutoCompleteResult.jsm',
 ]
 
 XPCOM_MANIFESTS += [
     'components.conf',
 ]
 
 FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/toolkit/components/satchel/satchel.manifest
+++ /dev/null
@@ -1,7 +0,0 @@
-component {c11c21b2-71c9-4f87-a0f8-5e13f50495fd} nsFormAutoComplete.js
-contract @mozilla.org/satchel/form-autocomplete;1 {c11c21b2-71c9-4f87-a0f8-5e13f50495fd}
-component {bf1e01d0-953e-11df-981c-0800200c9a66} nsInputListAutoComplete.js
-contract @mozilla.org/satchel/inputlist-autocomplete;1 {bf1e01d0-953e-11df-981c-0800200c9a66}
-component {3a0012eb-007f-4bb8-aa81-a07385f77a25} FormHistoryStartup.js
-contract @mozilla.org/satchel/form-history-startup;1 {3a0012eb-007f-4bb8-aa81-a07385f77a25}
-category profile-after-change formHistoryStartup @mozilla.org/satchel/form-history-startup;1