Closed Bug 1255253 Opened 8 years ago Closed 8 years ago

Remove a mostly-unneeded countLogins() call

Categories

(Toolkit :: Password Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: Dolske, Assigned: Dolske)

References

Details

Attachments

(1 file)

The code in LoginManagerParent.jsm's sendLoginDataToChild() has a countLogins() call that actually isn't really needed anymore. I think it's mostly a leftover from when this was a hot code path (fixed by using DOMFormHasPassword) and to avoid a master password prompt (fixed by .uiBusy).

The current code basically looks like:

  if (countLogins() == 0)
    return; // no logins to process
  if (uiBusy) {
    // Master password already showing, add a callback to finish operation
    // after it's been entered, to avoid showing a 2nd prompt.
    return;
  }
  login = findLogins();

If countLogins() != 0, removing this code has no effect. If it is 0, there is no effect in the common case of the user either not having a master password or having already entered it.

The only slight difference is that if the user has a master password prompt showing, but is ignoring it and continuing to browse (which is weird because it's a modal prompt), we will add pointless callbacks that will just discover findLogins() have no logins.

That's still zero functional change for the user.

Removing this call allows proceeding in bug 667233 without modifying the countLogins() API or implementing a countSearchLogins() alternative.
(Also there's a tiny perf benefit, in not doing the same underlying search twice.)
Attached patch Patch v.1Splinter Review
(I didn't actually test this yet :)

Note that I removed the telemetry probe -- it was comparing the countLogins() count (which ignored the formAction) to the findLogins() count (which did not). The telemetry was seeking to understand if password manager would be more useful to users if it stopped taking the form submit URL into account... Currently telemetry shows about 12% of the time using it resulted in 0 logins available to the user (even though countLogins found something), and an additional 5% where fewer logins were available.

We don't have any plans to change this in the near term, so I'm just removing it.
Assignee: nobody → dolske
Attachment #8728759 - Flags: review?(MattN+bmo)
Attachment #8728759 - Flags: review?(MattN+bmo) → review+
Status: NEW → ASSIGNED
Reminder to land this since bug 667233 depends on it.
Flags: needinfo?(dolske)
Flags: needinfo?(dolske)
https://hg.mozilla.org/mozilla-central/rev/f7bfb9a0184a
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: