chore: pass base::StringPiece args by value (#19432)
https://cs.chromium.org/chromium/src/base/strings/string_piece.h?l=14 discusses this, saying "Prefer passing StringPieces by value" because "[p]assing by value generates slightly smaller code."
This commit is contained in:
parent
539078f281
commit
f6fb877de9
12 changed files with 46 additions and 54 deletions
|
@ -40,8 +40,7 @@ class WebContentsPreferences
|
|||
void SetDefaults();
|
||||
|
||||
// A simple way to know whether a Boolean property is enabled.
|
||||
bool IsEnabled(const base::StringPiece& name,
|
||||
bool default_value = false) const;
|
||||
bool IsEnabled(base::StringPiece name, bool default_value = false) const;
|
||||
|
||||
// $.extend(|web_preferences|, |new_web_preferences|).
|
||||
void Merge(const base::DictionaryValue& new_web_preferences);
|
||||
|
@ -57,7 +56,7 @@ class WebContentsPreferences
|
|||
void Clear();
|
||||
|
||||
// Return true if the particular preference value exists.
|
||||
bool GetPreference(const base::StringPiece& name, std::string* value) const;
|
||||
bool GetPreference(base::StringPiece name, std::string* value) const;
|
||||
|
||||
// Whether to enable the remote module
|
||||
bool IsRemoteModuleEnabled() const;
|
||||
|
@ -77,10 +76,10 @@ class WebContentsPreferences
|
|||
static content::WebContents* GetWebContentsFromProcessID(int process_id);
|
||||
|
||||
// Set preference value to given bool if user did not provide value
|
||||
bool SetDefaultBoolIfUndefined(const base::StringPiece& key, bool val);
|
||||
bool SetDefaultBoolIfUndefined(base::StringPiece key, bool val);
|
||||
|
||||
// Set preference value to given bool
|
||||
void SetBool(const base::StringPiece& key, bool value);
|
||||
void SetBool(base::StringPiece key, bool value);
|
||||
|
||||
static std::vector<WebContentsPreferences*> instances_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue