Bug 1367077 - 4. Remove LoginManagerParent.login; r=kmag
☠☠ backed out by 1083f0e1147b ☠ ☠
authorJim Chen <nchen@mozilla.com>
Wed, 13 Sep 2017 11:52:04 -0400
changeset 430087 6c65c331b97fdf61b0efbb0b5b9de84cb6588805
parent 430086 8a3e6fbd6511d12292c0a0497bf56a779fc20bba
child 430088 e05d7bb3a80fe117f328b77e0b7bd81b4f10bad9
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1367077
milestone57.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 1367077 - 4. Remove LoginManagerParent.login; r=kmag Mobile code now loads LoginManagerParent lazily, similar to nsBrowserGlue on desktop, so we no longer need LoginManagerParent.login. MozReview-Commit-ID: 8tnWnev344
browser/components/nsBrowserGlue.js
toolkit/components/passwordmgr/LoginManagerParent.jsm
toolkit/components/passwordmgr/test/pwmgr_common.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -142,24 +142,24 @@ const listeners = {
     "Content:Click": ["ContentClick"],
     "ContentSearch": ["ContentSearch"],
     "FormValidation:ShowPopup": ["FormValidationHandler"],
     "FormValidation:HidePopup": ["FormValidationHandler"],
     "Prompt:Open": ["RemotePrompt"],
     "Reader:ArticleGet": ["ReaderParent"],
     "Reader:FaviconRequest": ["ReaderParent"],
     "Reader:UpdateReaderButton": ["ReaderParent"],
-    // PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN LoginManagerParent.init
+    // PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN BrowserCLH.js
     "RemoteLogins:findLogins": ["LoginManagerParent"],
     "RemoteLogins:findRecipes": ["LoginManagerParent"],
     "RemoteLogins:onFormSubmit": ["LoginManagerParent"],
     "RemoteLogins:autoCompleteLogins": ["LoginManagerParent"],
     "RemoteLogins:removeLogin": ["LoginManagerParent"],
     "RemoteLogins:insecureLoginFormPresent": ["LoginManagerParent"],
-    // PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN LoginManagerParent.init
+    // PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN BrowserCLH.js
     "WCCR:registerProtocolHandler": ["Feeds"],
     "WCCR:registerContentHandler": ["Feeds"],
     "rtcpeer:CancelRequest": ["webrtcUI"],
     "rtcpeer:Request": ["webrtcUI"],
     "webrtc:CancelRequest": ["webrtcUI"],
     "webrtc:Request": ["webrtcUI"],
     "webrtc:StopRecording": ["webrtcUI"],
     "webrtc:UpdateBrowserIndicators": ["webrtcUI"],
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -61,34 +61,18 @@ var LoginManagerParent = {
     // Dedupe so the length checks below still make sense with scheme upgrades.
     let resolveBy = [
       "scheme",
       "timePasswordChanged",
     ];
     return LoginHelper.dedupeLogins(logins, ["username"], resolveBy, formOrigin);
   },
 
-  // This should only be called on Android. Listeners are added in
-  // nsBrowserGlue.js on desktop. Please make sure that the list of
-  // listeners added here stays in sync with the listeners added in
-  // nsBrowserGlue when you change either.
-  init() {
-    let mm = Cc["@mozilla.org/globalmessagemanager;1"]
-               .getService(Ci.nsIMessageListenerManager);
-    // PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN nsBrowserGlue
-    mm.addMessageListener("RemoteLogins:findLogins", this);
-    mm.addMessageListener("RemoteLogins:findRecipes", this);
-    mm.addMessageListener("RemoteLogins:onFormSubmit", this);
-    mm.addMessageListener("RemoteLogins:autoCompleteLogins", this);
-    mm.addMessageListener("RemoteLogins:removeLogin", this);
-    mm.addMessageListener("RemoteLogins:insecureLoginFormPresent", this);
-    // PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN nsBrowserGlue
-  },
-
-  // Listeners are added in nsBrowserGlue.js
+  // Listeners are added in nsBrowserGlue.js on desktop
+  // and in BrowserCLH.js on mobile.
   receiveMessage(msg) {
     let data = msg.data;
     switch (msg.name) {
       case "RemoteLogins:findLogins": {
         // TODO Verify msg.target's principals against the formOrigin?
         this.sendLoginDataToChild(data.options.showMasterPassword,
                                   data.formOrigin,
                                   data.actionOrigin,
--- a/toolkit/components/passwordmgr/test/pwmgr_common.js
+++ b/toolkit/components/passwordmgr/test/pwmgr_common.js
@@ -393,22 +393,16 @@ if (this.addMessageListener) {
       topic,
       data,
     });
   }
   Services.obs.addObserver(onPrompt, "passwordmgr-prompt-change");
   Services.obs.addObserver(onPrompt, "passwordmgr-prompt-save");
 
   addMessageListener("setupParent", ({selfFilling = false} = {selfFilling: false}) => {
-    // Force LoginManagerParent to init for the tests since it's normally delayed
-    // by apps such as on Android.
-    if (AppConstants.platform == "android") {
-      LoginManagerParent.init();
-    }
-
     commonInit(selfFilling);
     sendAsyncMessage("doneSetup");
   });
 
   addMessageListener("loadRecipes", function(recipes) {
     (async function() {
       var recipeParent = await LoginManagerParent.recipeParentPromise;
       await recipeParent.load(recipes);