Commit 6574d79e authored by orenb@chromium.org's avatar orenb@chromium.org

Fixed coverity defects pertaining to pass-by-value use where pass-by-reference is preferred

CID_COUNT=3
CID=(104210, 104215),104237,104238
BUG=
TEST=
TBR=jln,bolms,brettw

Review URL: https://chromiumcodereview.appspot.com/10825016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148437 0039d316-1c4b-4281-b951-d872f2087c98
parent 7f806f9f
...@@ -37,7 +37,7 @@ void ShellWindowRegistry::RemoveObserver(Observer* observer) { ...@@ -37,7 +37,7 @@ void ShellWindowRegistry::RemoveObserver(Observer* observer) {
} }
ShellWindowRegistry::ShellWindowSet ShellWindowRegistry::GetShellWindowsForApp( ShellWindowRegistry::ShellWindowSet ShellWindowRegistry::GetShellWindowsForApp(
const std::string app_id) const { const std::string& app_id) const {
ShellWindowSet app_windows; ShellWindowSet app_windows;
for (ShellWindowSet::const_iterator i = shell_windows_.begin(); for (ShellWindowSet::const_iterator i = shell_windows_.begin();
i != shell_windows_.end(); ++i) { i != shell_windows_.end(); ++i) {
......
...@@ -58,7 +58,7 @@ class ShellWindowRegistry : public ProfileKeyedService { ...@@ -58,7 +58,7 @@ class ShellWindowRegistry : public ProfileKeyedService {
void RemoveObserver(Observer* observer); void RemoveObserver(Observer* observer);
// Returns a set of windows owned by the application identified by app_id. // Returns a set of windows owned by the application identified by app_id.
ShellWindowSet GetShellWindowsForApp(const std::string app_id) const; ShellWindowSet GetShellWindowsForApp(const std::string& app_id) const;
const ShellWindowSet& shell_windows() const { return shell_windows_; } const ShellWindowSet& shell_windows() const { return shell_windows_; }
// Helper functions to find shell windows with particular attributes. // Helper functions to find shell windows with particular attributes.
......
...@@ -249,7 +249,7 @@ bool Sandbox::isSingleThreaded(int proc_fd) { ...@@ -249,7 +249,7 @@ bool Sandbox::isSingleThreaded(int proc_fd) {
return true; return true;
} }
static bool isDenied(Sandbox::ErrorCode code) { static bool isDenied(const Sandbox::ErrorCode& code) {
return (code & SECCOMP_RET_ACTION) == SECCOMP_RET_TRAP || return (code & SECCOMP_RET_ACTION) == SECCOMP_RET_TRAP ||
(code >= (SECCOMP_RET_ERRNO + 1) && (code >= (SECCOMP_RET_ERRNO + 1) &&
code <= (SECCOMP_RET_ERRNO + 4095)); code <= (SECCOMP_RET_ERRNO + 4095));
......
...@@ -325,7 +325,7 @@ class Sandbox { ...@@ -325,7 +325,7 @@ class Sandbox {
friend class Util; friend class Util;
friend class Verifier; friend class Verifier;
struct Range { struct Range {
Range(uint32_t f, uint32_t t, ErrorCode e) : Range(uint32_t f, uint32_t t, const ErrorCode& e) :
from(f), from(f),
to(t), to(t),
err(e) { err(e) {
......
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