diff options
author | vabr@chromium.org <vabr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-09 13:14:30 +0000 |
---|---|---|
committer | vabr@chromium.org <vabr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-09 13:14:30 +0000 |
commit | e88809afcdd3e70a4f527edaec1d6b9b7ff4e7ac (patch) | |
tree | c3c7a0d5427f073b21f613a653f9e016dec54643 /components | |
parent | ed921a04a86cc068cd1e7452da7ddb1861da246a (diff) | |
download | chromium_src-e88809afcdd3e70a4f527edaec1d6b9b7ff4e7ac.zip chromium_src-e88809afcdd3e70a4f527edaec1d6b9b7ff4e7ac.tar.gz chromium_src-e88809afcdd3e70a4f527edaec1d6b9b7ff4e7ac.tar.bz2 |
PasswordFormManager::best_matches should return a const ref
Currently, it returns 'const PasswordFormMap'. While returning a value, marking it const does not make much sense (it's a copy anyway). So it should be either 'const PasswordFormMap&' or just 'PasswordFormMap'. The only place this call is used at makes a copy of the result anyway, so I chose the former. That also seems to be a more versatile choice -- if somebody needs just a read-only copy in the future, returning by value would result in an unnecessary copy.
BUG=261628
R=mkwst@chromium.org
Review URL: https://codereview.chromium.org/382493003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r-- | components/password_manager/core/browser/password_form_manager.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/password_manager/core/browser/password_form_manager.h b/components/password_manager/core/browser/password_form_manager.h index 7f62927..7b9ab4a 100644 --- a/components/password_manager/core/browser/password_form_manager.h +++ b/components/password_manager/core/browser/password_form_manager.h @@ -157,7 +157,7 @@ class PasswordFormManager : public PasswordStoreConsumer { } // Returns the best matches. - const autofill::PasswordFormMap best_matches() const { + const autofill::PasswordFormMap& best_matches() const { return best_matches_; } |