Descriptioncredentials_to_update should own its PasswordForms
Inside PasswordFormManager and FormSaver, the |credentials_to_update| argument is used to pass copies of non-best matches with a modified password, in order to be saved to PasswordStore.
Currently, the PasswordForm in |not_best_matches_| is changed directly, and a pointer to it is passed in |credentials_to_update|. However, |not_best_matches_| will need to become constant as its ownership transfers to the coming FormFetcher class, to avoid potential for surprising side-effects when multiple PasswordFormManager change the shared object inside one FormFetcher.
This CL makes that possible by changing the element type of |credentials_to_update| from a pointer to a PasswordForm to a PasswordForm itself. That way it is possible to modify just the copy inside |credentials_to_update| and not the original in |not_best_matches_|. The fact that |not_best_matches_| fall out of sync with the PasswordStore at that point does not matter: the current PasswordFormManager is currently saving a PasswordForm, so it will be destroyed soon and will not need |not_best_matches_|.
BUG=621355
Committed: https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58
Cr-Commit-Position: refs/heads/master@{#413436}
Patch Set 1 #Patch Set 2 : Rebased #
Total comments: 2
Patch Set 3 : Just rebased #Patch Set 4 : No empty->null #Messages
Total messages: 17 (11 generated)
|