PasswordStore: Clean up expectations about rewriting vectors of forms
Many methods in PasswordStore and its backends have a ScopedVector of password forms as an out-argument, into which they put retrieved credentials.
Ideally, those methods would return that vector instead, but that is often not possible, because they already return a bool flag of success.
Keeping the out-argument has one bad consequence: it is not clear, if the retrieved credentials are appended to the vector, or if they replace the contents of the vector.
It looks like those methods are fed empty vectors anyway, so it is natural to make that explicit. This CL adds comments stating that the vectors are erased before anything new is added to them, and also modifies the code to make sure that they are indeed erased, even in failure cases.
The CL also contains some related clean-ups, like moving static methods to anonymous namespace etc.
BUG=
324291
Committed:
https://crrev.com/c5c4d77323e8bff2028f9e43f52f0be4c3a93a77
Cr-Commit-Position: refs/heads/master@{#320721}