Bug 1524688: Part 10 - Convert password manager to static registration. r=MattN
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 19:44:47 -0800
changeset 458983 25f982fd53bd
parent 458982 4fb0f0a59fe2
child 458984 9895239d8ac6
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 10 - Convert password manager to static registration. r=MattN
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/passwordmgr/LoginInfo.jsm
toolkit/components/passwordmgr/LoginManager.jsm
toolkit/components/passwordmgr/LoginManagerPrompter.jsm
toolkit/components/passwordmgr/components.conf
toolkit/components/passwordmgr/crypto-SDR.js
toolkit/components/passwordmgr/moz.build
toolkit/components/passwordmgr/nsLoginInfo.js
toolkit/components/passwordmgr/nsLoginManager.js
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
toolkit/components/passwordmgr/passwordmgr.manifest
toolkit/components/passwordmgr/storage-json.js
toolkit/components/passwordmgr/storage-mozStorage.js
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -199,22 +199,16 @@
 @RESPATH@/components/toolkitsearch.manifest
 @RESPATH@/components/nsSearchService.js
 @RESPATH@/components/nsSearchSuggestions.js
 @RESPATH@/components/nsSidebar.js
 #ifdef NIGHTLY_BUILD
 @RESPATH@/browser/components/payments.manifest
 @RESPATH@/browser/components/paymentUIService.js
 #endif
-@RESPATH@/components/passwordmgr.manifest
-@RESPATH@/components/nsLoginInfo.js
-@RESPATH@/components/nsLoginManager.js
-@RESPATH@/components/nsLoginManagerPrompter.js
-@RESPATH@/components/storage-json.js
-@RESPATH@/components/crypto-SDR.js
 @RESPATH@/components/TooltipTextProvider.js
 @RESPATH@/components/TooltipTextProvider.manifest
 @RESPATH@/components/WebVTT.manifest
 @RESPATH@/components/WebVTTParserWrapper.js
 @RESPATH@/components/nsHelperAppDlg.manifest
 @RESPATH@/components/nsHelperAppDlg.js
 @RESPATH@/components/NetworkGeolocationProvider.manifest
 @RESPATH@/components/NetworkGeolocationProvider.js
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -120,22 +120,16 @@
 @BINPATH@/components/mozProtocolHandler.manifest
 #ifndef MOZ_GECKOVIEW_JAR
 @BINPATH@/components/nsDNSServiceDiscovery.manifest
 @BINPATH@/components/nsDNSServiceDiscovery.js
 #endif
 @BINPATH@/components/toolkitsearch.manifest
 @BINPATH@/components/nsSearchService.js
 @BINPATH@/components/nsSidebar.js
-@BINPATH@/components/passwordmgr.manifest
-@BINPATH@/components/nsLoginInfo.js
-@BINPATH@/components/nsLoginManager.js
-@BINPATH@/components/nsLoginManagerPrompter.js
-@BINPATH@/components/storage-mozStorage.js
-@BINPATH@/components/crypto-SDR.js
 @BINPATH@/components/TooltipTextProvider.js
 @BINPATH@/components/TooltipTextProvider.manifest
 @BINPATH@/components/NetworkGeolocationProvider.manifest
 @BINPATH@/components/NetworkGeolocationProvider.js
 
 @BINPATH@/components/extensions.manifest
 
 #ifndef MOZ_GECKOVIEW_JAR
rename from toolkit/components/passwordmgr/nsLoginInfo.js
rename to toolkit/components/passwordmgr/LoginInfo.jsm
--- a/toolkit/components/passwordmgr/nsLoginInfo.js
+++ b/toolkit/components/passwordmgr/LoginInfo.jsm
@@ -84,9 +84,9 @@ nsLoginInfo.prototype = {
   guid: null,
   timeCreated: null,
   timeLastUsed: null,
   timePasswordChanged: null,
   timesUsed: null,
 
 }; // end of nsLoginInfo implementation
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsLoginInfo]);
+var EXPORTED_SYMBOLS = ["nsLoginInfo"];
rename from toolkit/components/passwordmgr/nsLoginManager.js
rename to toolkit/components/passwordmgr/LoginManager.jsm
--- a/toolkit/components/passwordmgr/nsLoginManager.js
+++ b/toolkit/components/passwordmgr/LoginManager.jsm
@@ -580,9 +580,9 @@ LoginManager.prototype = {
                              .catch(Cu.reportError);
   },
 
   stopSearch() {
     this._autoCompleteLookupPromise = null;
   },
 }; // end of LoginManager implementation
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]);
+var EXPORTED_SYMBOLS = ["LoginManager"];
rename from toolkit/components/passwordmgr/nsLoginManagerPrompter.js
rename to toolkit/components/passwordmgr/LoginManagerPrompter.jsm
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/LoginManagerPrompter.jsm
@@ -1556,10 +1556,9 @@ LoginManagerPrompter.prototype = {
 
 }; // end of LoginManagerPrompter implementation
 
 XPCOMUtils.defineLazyGetter(this.LoginManagerPrompter.prototype, "log", () => {
   let logger = LoginHelper.createLogger("LoginManagerPrompter");
   return logger.log.bind(logger);
 });
 
-var component = [LoginManagerPromptFactory, LoginManagerPrompter];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
+var EXPORTED_SYMBOLS = ["LoginManagerPromptFactory", "LoginManagerPrompter"];
new file mode 100644
--- /dev/null
+++ b/toolkit/components/passwordmgr/components.conf
@@ -0,0 +1,63 @@
+# -*- 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': '{cb9e0de8-3598-4ed7-857b-827f011ad5d8}',
+        'contract_ids': ['@mozilla.org/login-manager;1'],
+        'jsm': 'resource://gre/modules/LoginManager.jsm',
+        'constructor': 'LoginManager',
+    },
+    {
+        'cid': '{749e62f4-60ae-4569-a8a2-de78b649660e}',
+        'contract_ids': ['@mozilla.org/passwordmanager/authpromptfactory;1'],
+        'jsm': 'resource://gre/modules/LoginManagerPrompter.jsm',
+        'constructor': 'LoginManagerPromptFactory',
+    },
+    {
+        'cid': '{8aa66d77-1bbb-45a6-991e-b8f47751c291}',
+        'contract_ids': ['@mozilla.org/login-manager/prompter;1'],
+        'jsm': 'resource://gre/modules/LoginManagerPrompter.jsm',
+        'constructor': 'LoginManagerPrompter',
+    },
+    {
+        'cid': '{0f2f347c-1e4f-40cc-8efd-792dea70a85e}',
+        'contract_ids': ['@mozilla.org/login-manager/loginInfo;1'],
+        'jsm': 'resource://gre/modules/LoginInfo.jsm',
+        'constructor': 'nsLoginInfo',
+    },
+    {
+        'cid': '{dc6c2976-0f73-4f1f-b9ff-3d72b4e28309}',
+        'contract_ids': ['@mozilla.org/login-manager/crypto/SDR;1'],
+        'jsm': 'resource://gre/modules/crypto-SDR.js',
+        'constructor': 'LoginManagerCrypto_SDR',
+    },
+]
+
+if buildconfig.substs['OS_TARGET'] == 'Android':
+    Classes += [
+        {
+            'cid': '{8c2023b9-175c-477e-9761-44ae7b549756}',
+            'contract_ids': [
+                '@mozilla.org/login-manager/storage/mozStorage;1',
+                '@mozilla.org/login-manager/storage/default;1',
+            ],
+            'jsm': 'resource://gre/modules/storage-mozStorage.js',
+            'constructor': 'LoginManagerStorage_mozStorage',
+        },
+    ]
+else:
+    Classes += [
+        {
+            'cid': '{c00c432d-a0c9-46d7-bef6-9c45b4d07341}',
+            'contract_ids': [
+                '@mozilla.org/login-manager/storage/json;1',
+                '@mozilla.org/login-manager/storage/default;1',
+            ],
+            'jsm': 'resource://gre/modules/storage-json.js',
+            'constructor': 'LoginManagerStorage_json',
+        },
+    ]
--- a/toolkit/components/passwordmgr/crypto-SDR.js
+++ b/toolkit/components/passwordmgr/crypto-SDR.js
@@ -230,10 +230,9 @@ LoginManagerCrypto_SDR.prototype = {
   },
 }; // end of nsLoginManagerCrypto_SDR implementation
 
 XPCOMUtils.defineLazyGetter(this.LoginManagerCrypto_SDR.prototype, "log", () => {
   let logger = LoginHelper.createLogger("Login crypto");
   return logger.log.bind(logger);
 });
 
-var component = [LoginManagerCrypto_SDR];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
+var EXPORTED_SYMBOLS = ["LoginManagerCrypto_SDR"];
--- a/toolkit/components/passwordmgr/moz.build
+++ b/toolkit/components/passwordmgr/moz.build
@@ -23,55 +23,50 @@ XPIDL_SOURCES += [
     'nsILoginManagerCrypto.idl',
     'nsILoginManagerPrompter.idl',
     'nsILoginManagerStorage.idl',
     'nsILoginMetaInfo.idl',
 ]
 
 XPIDL_MODULE = 'loginmgr'
 
-EXTRA_COMPONENTS += [
+EXTRA_JS_MODULES += [
     'crypto-SDR.js',
-    'nsLoginInfo.js',
-    'nsLoginManager.js',
-    'nsLoginManagerPrompter.js',
-]
-
-EXTRA_PP_COMPONENTS += [
-    'passwordmgr.manifest',
-]
-
-EXTRA_JS_MODULES += [
     'InsecurePasswordUtils.jsm',
     'LoginHelper.jsm',
+    'LoginInfo.jsm',
+    'LoginManager.jsm',
     'LoginManagerContent.jsm',
     'LoginManagerParent.jsm',
+    'LoginManagerPrompter.jsm',
     'LoginRecipes.jsm',
     'OSCrypto.jsm',
 ]
 
 if CONFIG['OS_TARGET'] == 'Android':
-    EXTRA_COMPONENTS += [
+    EXTRA_JS_MODULES += [
         'storage-mozStorage.js',
     ]
 else:
-    EXTRA_COMPONENTS += [
-        'storage-json.js',
-    ]
     EXTRA_JS_MODULES += [
         'LoginImport.jsm',
         'LoginStore.jsm',
+        'storage-json.js',
     ]
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     EXTRA_JS_MODULES += [
         'OSCrypto_win.js',
     ]
 
 if CONFIG['MOZ_BUILD_APP'] == 'browser':
     EXTRA_JS_MODULES += [
         'LoginManagerContextMenu.jsm',
     ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 JAR_MANIFESTS += ['jar.mn']
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Password Manager')
deleted file mode 100644
--- a/toolkit/components/passwordmgr/passwordmgr.manifest
+++ /dev/null
@@ -1,19 +0,0 @@
-component {cb9e0de8-3598-4ed7-857b-827f011ad5d8} nsLoginManager.js
-contract @mozilla.org/login-manager;1 {cb9e0de8-3598-4ed7-857b-827f011ad5d8}
-component {749e62f4-60ae-4569-a8a2-de78b649660e} nsLoginManagerPrompter.js
-contract @mozilla.org/passwordmanager/authpromptfactory;1 {749e62f4-60ae-4569-a8a2-de78b649660e}
-component {8aa66d77-1bbb-45a6-991e-b8f47751c291} nsLoginManagerPrompter.js
-contract @mozilla.org/login-manager/prompter;1 {8aa66d77-1bbb-45a6-991e-b8f47751c291}
-component {0f2f347c-1e4f-40cc-8efd-792dea70a85e} nsLoginInfo.js
-contract @mozilla.org/login-manager/loginInfo;1 {0f2f347c-1e4f-40cc-8efd-792dea70a85e}
-#ifdef ANDROID
-component {8c2023b9-175c-477e-9761-44ae7b549756} storage-mozStorage.js
-contract @mozilla.org/login-manager/storage/mozStorage;1 {8c2023b9-175c-477e-9761-44ae7b549756}
-contract @mozilla.org/login-manager/storage/default;1 {8c2023b9-175c-477e-9761-44ae7b549756}
-#else
-component {c00c432d-a0c9-46d7-bef6-9c45b4d07341} storage-json.js
-contract @mozilla.org/login-manager/storage/json;1 {c00c432d-a0c9-46d7-bef6-9c45b4d07341}
-contract @mozilla.org/login-manager/storage/default;1 {c00c432d-a0c9-46d7-bef6-9c45b4d07341}
-#endif
-component {dc6c2976-0f73-4f1f-b9ff-3d72b4e28309} crypto-SDR.js
-contract @mozilla.org/login-manager/crypto/SDR;1 {dc6c2976-0f73-4f1f-b9ff-3d72b4e28309}
--- a/toolkit/components/passwordmgr/storage-json.js
+++ b/toolkit/components/passwordmgr/storage-json.js
@@ -537,9 +537,9 @@ this.LoginManagerStorage_json.prototype 
   },
 };
 
 XPCOMUtils.defineLazyGetter(this.LoginManagerStorage_json.prototype, "log", () => {
   let logger = LoginHelper.createLogger("Login storage");
   return logger.log.bind(logger);
 });
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManagerStorage_json]);
+var EXPORTED_SYMBOLS = ["LoginManagerStorage_json"];
--- a/toolkit/components/passwordmgr/storage-mozStorage.js
+++ b/toolkit/components/passwordmgr/storage-mozStorage.js
@@ -1274,10 +1274,9 @@ LoginManagerStorage_mozStorage.prototype
 
 }; // end of nsLoginManagerStorage_mozStorage implementation
 
 XPCOMUtils.defineLazyGetter(this.LoginManagerStorage_mozStorage.prototype, "log", () => {
   let logger = LoginHelper.createLogger("Login storage");
   return logger.log.bind(logger);
 });
 
-var component = [LoginManagerStorage_mozStorage];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
+var EXPORTED_SYMBOLS = ["LoginManagerStorage_mozStorage"];