Bug 1551657 part 5. Stop using [array] in promptToChangePasswordWithUsernames. r=MattN
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 14 May 2019 19:33:21 +0000
changeset 532762 bbbbed508f9be54d655124bc1662d6b2cb47cbef
parent 532761 bdbfb93093eeba973bb1e1f3fc2c2697ed4e64c4
child 532763 57ad9770bc01ffdbc52f841d8e437820a8a222f1
push id11272
push userapavel@mozilla.com
push dateThu, 16 May 2019 15:28:22 +0000
treeherdermozilla-beta@2265bfc5920d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1551657
milestone68.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 1551657 part 5. Stop using [array] in promptToChangePasswordWithUsernames. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D31121
mobile/android/components/LoginManagerPrompter.js
toolkit/components/passwordmgr/LoginManagerParent.jsm
toolkit/components/passwordmgr/LoginManagerPrompter.jsm
toolkit/components/passwordmgr/nsILoginManagerPrompter.idl
--- a/mobile/android/components/LoginManagerPrompter.js
+++ b/mobile/android/components/LoginManagerPrompter.js
@@ -258,20 +258,18 @@ LoginManagerPrompter.prototype = {
    *
    * Called when we detect a password change in a form submission, but we
    * don't know which existing login (username) it's for. Asks the user
    * to select a username and confirm the password change.
    *
    * Note: The caller doesn't know the username for aNewLogin, so this
    *       function fills in .username and .usernameField with the values
    *       from the login selected by the user.
-   *
-   * Note; XPCOM stupidity: |count| is just |logins.length|.
    */
-  promptToChangePasswordWithUsernames: function(logins, count, aNewLogin) {
+  promptToChangePasswordWithUsernames: function(logins, aNewLogin) {
     var usernames = logins.map(l => l.username);
     var dialogText  = this._getLocalizedString("userSelectText2");
     var dialogTitle = this._getLocalizedString("passwordChangeTitle");
     var selectedIndex = { value: null };
 
     // If user selects ok, outparam.value is set to the index
     // of the selected username.
     var ok = Services.prompt.select(null,
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -389,18 +389,17 @@ var LoginManagerParent = {
         formLogin.usernameField = oldLogin.usernameField;
 
         prompter.promptToChangePassword(oldLogin, formLogin, dismissedPrompt);
       } else {
         // Note: It's possible that that we already have the correct u+p saved
         // but since we don't have the username, we don't know if the user is
         // changing a second account to the new password so we ask anyways.
 
-        prompter.promptToChangePasswordWithUsernames(
-          logins, logins.length, formLogin);
+        prompter.promptToChangePasswordWithUsernames(logins, formLogin);
       }
 
       return;
     }
 
 
     var existingLogin = null;
     // Look for an existing login that matches the form login.
--- a/toolkit/components/passwordmgr/LoginManagerPrompter.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerPrompter.jsm
@@ -1251,21 +1251,19 @@ LoginManagerPrompter.prototype = {
   /**
    * Called when we detect a password change in a form submission, but we
    * don't know which existing login (username) it's for. Asks the user
    * to select a username and confirm the password change.
    *
    * Note: The caller doesn't know the username for aNewLogin, so this
    *       function fills in .username and .usernameField with the values
    *       from the login selected by the user.
-   *
-   * Note; XPCOM stupidity: |count| is just |logins.length|.
    */
-  promptToChangePasswordWithUsernames(logins, count, aNewLogin) {
-    this.log("promptToChangePasswordWithUsernames with count:", count);
+  promptToChangePasswordWithUsernames(logins, aNewLogin) {
+    this.log("promptToChangePasswordWithUsernames with count:", logins.length);
 
     var usernames = logins.map(l => l.username || this._getLocalizedString("noUsername"));
     var dialogText  = this._getLocalizedString("userSelectText2");
     var dialogTitle = this._getLocalizedString("passwordChangeTitle");
     var selectedIndex = { value: null };
 
     // If user selects ok, outparam.value is set to the index
     // of the selected username.
--- a/toolkit/components/passwordmgr/nsILoginManagerPrompter.idl
+++ b/toolkit/components/passwordmgr/nsILoginManagerPrompter.idl
@@ -74,28 +74,25 @@ interface nsILoginManagerPrompter : nsIS
   /**
    * Ask the user if they want to change the password for one of
    * multiple logins, when the caller can't determine exactly which
    * login should be changed. If the user consents, modifyLogin() will
    * be called.
    *
    * @param logins
    *        An array of existing logins.
-   * @param count
-   *        (length of the array)
    * @param aNewLogin
    *        The new login.
    *
    * Note: Because the caller does not know the username of the login
    *       to be changed, aNewLogin.username and aNewLogin.usernameField
    *       will be set (using the user's selection) before modifyLogin()
    *       is called.
    */
   void promptToChangePasswordWithUsernames(
-          [array, size_is(count)] in nsILoginInfo logins,
-          in uint32_t count,
+          in Array<nsILoginInfo> logins,
           in nsILoginInfo aNewLogin);
 };
 %{C++
 
 #define NS_LOGINMANAGERPROMPTER_CONTRACTID "@mozilla.org/login-manager/prompter/;1"
 
 %}