Coverity: Fix a pass-by-value.
CID_COUNT=1 CID=103292 BUG=none TEST=none R=groby Review URL: https://chromiumcodereview.appspot.com/9380051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125070 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
base
chrome/browser/extensions/api/declarative
@ -18,7 +18,7 @@
|
||||
//
|
||||
// * Passed as a function argument
|
||||
// * Used as the right-hand side of an assignment
|
||||
// * Return from a function
|
||||
// * Returned from a function
|
||||
//
|
||||
// Each class will still need to define their own "move constructor" and "move
|
||||
// operator=" to make this useful. Here's an example of the macro, the move
|
||||
@ -122,7 +122,7 @@
|
||||
// function parameter or field of a class, the binary will not link.
|
||||
//
|
||||
// This ensures that RValue can only exist as a temporary which is important
|
||||
// to avoid accidental danging references.
|
||||
// to avoid accidental dangling references.
|
||||
//
|
||||
// (3) allows us to get around instantiations because our user-defined
|
||||
// conversion can return a downcast of this pointer.
|
||||
|
@ -86,7 +86,7 @@ bool InitializingRulesRegistry::IsUniqueId(
|
||||
}
|
||||
|
||||
std::string InitializingRulesRegistry::GenerateUniqueId(
|
||||
std::string extension_id) {
|
||||
const std::string& extension_id) {
|
||||
while (!IsUniqueId(extension_id, ToId(last_generated_rule_identifier_id_)))
|
||||
++last_generated_rule_identifier_id_;
|
||||
return ToId(last_generated_rule_identifier_id_);
|
||||
|
@ -51,7 +51,7 @@ class InitializingRulesRegistry : public RulesRegistry {
|
||||
const std::string& rule_id) const;
|
||||
|
||||
// Creates an ID that is unique within the scope of|extension_id|.
|
||||
std::string GenerateUniqueId(std::string extension_id);
|
||||
std::string GenerateUniqueId(const std::string& extension_id);
|
||||
|
||||
// Verifies that all |rules| have unique IDs or initializes them with
|
||||
// unique IDs if they don't have one. In case of duplicate IDs, this function
|
||||
|
Reference in New Issue
Block a user