Cleanup return values in autofill

This CL turns const by value return values into const by ref. 

Replacing const value by a const ref when a member variable is safe, because
the member variable will live at least as long as the temporary object returned
now. It can also be more efficient, because returning a ref can spare copying.

BUG=393155

Review URL: https://codereview.chromium.org/382243002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282769 0039d316-1c4b-4281-b951-d872f2087c98
parent 6287759b
...@@ -61,10 +61,10 @@ class AutofillCountry { ...@@ -61,10 +61,10 @@ class AutofillCountry {
static const std::string GetCountryCode(const base::string16& country, static const std::string GetCountryCode(const base::string16& country,
const std::string& locale); const std::string& locale);
const std::string country_code() const { return country_code_; } const std::string& country_code() const { return country_code_; }
const base::string16 name() const { return name_; } const base::string16& name() const { return name_; }
const base::string16 postal_code_label() const { return postal_code_label_; } const base::string16& postal_code_label() const { return postal_code_label_; }
const base::string16 state_label() const { return state_label_; } const base::string16& state_label() const { return state_label_; }
// City is expected in a complete address for this country. // City is expected in a complete address for this country.
bool requires_city() const { bool requires_city() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment