From 89f19af05e6317424bce504f3a9c861f4d68c518 Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Thu, 19 Sep 2013 05:22:35 +0000 Subject: Use a const ref when passing in a vector of strings. No need to copy the parameter, even if it's not that big. BUG=None Review URL: https://chromiumcodereview.appspot.com/23533068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224045 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chromeos/settings/owner_flags_storage.cc | 2 +- chrome/browser/chromeos/settings/owner_flags_storage.h | 2 +- chrome/browser/flags_storage.h | 2 +- chrome/browser/pref_service_flags_storage.cc | 2 +- chrome/browser/pref_service_flags_storage.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/browser/chromeos/settings/owner_flags_storage.cc b/chrome/browser/chromeos/settings/owner_flags_storage.cc index 9c21c31..a6e926f 100644 --- a/chrome/browser/chromeos/settings/owner_flags_storage.cc +++ b/chrome/browser/chromeos/settings/owner_flags_storage.cc @@ -47,7 +47,7 @@ OwnerFlagsStorage::OwnerFlagsStorage(PrefService *prefs, OwnerFlagsStorage::~OwnerFlagsStorage() {} -bool OwnerFlagsStorage::SetFlags(std::set flags) { +bool OwnerFlagsStorage::SetFlags(const std::set& flags) { PrefServiceFlagsStorage::SetFlags(flags); base::ListValue experiments_list; diff --git a/chrome/browser/chromeos/settings/owner_flags_storage.h b/chrome/browser/chromeos/settings/owner_flags_storage.h index 77d7830..1ba8b21 100644 --- a/chrome/browser/chromeos/settings/owner_flags_storage.h +++ b/chrome/browser/chromeos/settings/owner_flags_storage.h @@ -22,7 +22,7 @@ class OwnerFlagsStorage : public ::about_flags::PrefServiceFlagsStorage { OwnerFlagsStorage(PrefService *prefs, CrosSettings *cros_settings); virtual ~OwnerFlagsStorage(); - virtual bool SetFlags(std::set flags) OVERRIDE; + virtual bool SetFlags(const std::set& flags) OVERRIDE; private: CrosSettings* cros_settings_; diff --git a/chrome/browser/flags_storage.h b/chrome/browser/flags_storage.h index 13efbb6..0651f00 100644 --- a/chrome/browser/flags_storage.h +++ b/chrome/browser/flags_storage.h @@ -20,7 +20,7 @@ class FlagsStorage { // Retrieves the flags as a set of strings. virtual std::set GetFlags() = 0; // Stores the |flags| and returns true on success. - virtual bool SetFlags(std::set flags) = 0; + virtual bool SetFlags(const std::set& flags) = 0; }; } // namespace about_flags diff --git a/chrome/browser/pref_service_flags_storage.cc b/chrome/browser/pref_service_flags_storage.cc index 7cc1f5b..ddd6705 100644 --- a/chrome/browser/pref_service_flags_storage.cc +++ b/chrome/browser/pref_service_flags_storage.cc @@ -33,7 +33,7 @@ std::set PrefServiceFlagsStorage::GetFlags() { return flags; } -bool PrefServiceFlagsStorage::SetFlags(std::set flags) { +bool PrefServiceFlagsStorage::SetFlags(const std::set& flags) { ListPrefUpdate update(prefs_, prefs::kEnabledLabsExperiments); ListValue* experiments_list = update.Get(); diff --git a/chrome/browser/pref_service_flags_storage.h b/chrome/browser/pref_service_flags_storage.h index 1a5539d..7710eb8 100644 --- a/chrome/browser/pref_service_flags_storage.h +++ b/chrome/browser/pref_service_flags_storage.h @@ -20,7 +20,7 @@ class PrefServiceFlagsStorage : public FlagsStorage { virtual ~PrefServiceFlagsStorage(); virtual std::set GetFlags() OVERRIDE; - virtual bool SetFlags(std::set flags) OVERRIDE; + virtual bool SetFlags(const std::set& flags) OVERRIDE; private: PrefService* prefs_; -- cgit v1.1