PasswordFormManager currently does too many things: represents forms on the site, facilitates filling and saving, and also fetches data from the PasswordStore.
There might be multiple forms on the page, and all the forms on the same origin will request the same data from the PasswordStore. Doing this repeatedly for each form is wasteful of resources, and an unnecessary complication.
We should pull the credentials-fetching part out of PFM into a dedicated class. The PasswordManager should keep one such class for every relevant origin, and the PFMs could, e.g., reference-count it in some way to indicate which origin is still relevant.
We should make sure that the new class also observes changes in the PasswordStore and notifies PFM if necessary, to avoid bugs like issue 472088 .
Cc-ing dvadym@, because we have talked about this already.
Comment 1 by vabr@chromium.org
, Apr 1 2016