summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 01:24:06 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 01:24:06 +0000
commit7feb8500ebed1895f08d9716afc092a10a2f7b07 (patch)
treeee94765b323327e3fd8dfc661335ea0ee065e009
parent79c266203684643750a573e431cdb0fc0af5d850 (diff)
downloadchromium_src-7feb8500ebed1895f08d9716afc092a10a2f7b07.zip
chromium_src-7feb8500ebed1895f08d9716afc092a10a2f7b07.tar.gz
chromium_src-7feb8500ebed1895f08d9716afc092a10a2f7b07.tar.bz2
Coverity: Fix several pass-by-values.
CID_COUNT=8 CID=7757,8647,11476,16931,16932,100206,100577,102872 BUG=none TEST=none R=tbreisacher@chromium.org TBR=brettw@chromium.org,kalman@chromium.org Review URL: https://chromiumcodereview.appspot.com/10824033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148687 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/themes/browser_theme_pack.cc2
-rw-r--r--chrome/browser/themes/browser_theme_pack.h2
-rw-r--r--chrome/common/extensions/url_pattern.cc2
-rw-r--r--chrome/test/base/chrome_process_util.cc2
-rw-r--r--content/browser/webui/web_ui_message_handler.cc6
-rw-r--r--content/public/browser/web_ui_message_handler.h2
-rw-r--r--content/renderer/renderer_main_platform_delegate_win.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.h6
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.cc2
-rw-r--r--ppapi/native_client/src/trusted/plugin/service_runtime.h2
-rw-r--r--sandbox/win/src/process_thread_dispatcher.cc2
-rw-r--r--skia/ext/skia_sandbox_support_win.h2
-rw-r--r--webkit/appcache/view_appcache_internals_job.cc2
13 files changed, 18 insertions, 16 deletions
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index bf3f74a..cb7aba4 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -377,7 +377,7 @@ scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromExtension(
// static
scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack(
- FilePath path, const std::string& expected_id) {
+ const FilePath& path, const std::string& expected_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Allow IO on UI thread due to deep-seated theme design issues.
// (see http://crbug.com/80206)
diff --git a/chrome/browser/themes/browser_theme_pack.h b/chrome/browser/themes/browser_theme_pack.h
index 5121034..6091df5 100644
--- a/chrome/browser/themes/browser_theme_pack.h
+++ b/chrome/browser/themes/browser_theme_pack.h
@@ -65,7 +65,7 @@ class BrowserThemePack : public base::RefCountedThreadSafe<
// operation should be relatively fast, as it should be an mmap() and some
// pointer swizzling. Returns NULL on any error attempting to read |path|.
static scoped_refptr<BrowserThemePack> BuildFromDataPack(
- FilePath path, const std::string& expected_id);
+ const FilePath& path, const std::string& expected_id);
// Builds a data pack on disk at |path| for future quick loading by
// BuildFromDataPack(). Often (but not always) called from the file thread;
diff --git a/chrome/common/extensions/url_pattern.cc b/chrome/common/extensions/url_pattern.cc
index c66e780..34ec6f8 100644
--- a/chrome/common/extensions/url_pattern.cc
+++ b/chrome/common/extensions/url_pattern.cc
@@ -76,7 +76,7 @@ bool IsStandardScheme(const std::string& scheme) {
url_parse::Component(0, static_cast<int>(scheme.length())));
}
-bool IsValidPortForScheme(const std::string scheme, const std::string& port) {
+bool IsValidPortForScheme(const std::string& scheme, const std::string& port) {
if (port == "*")
return true;
diff --git a/chrome/test/base/chrome_process_util.cc b/chrome/test/base/chrome_process_util.cc
index b513c81..a954f3b 100644
--- a/chrome/test/base/chrome_process_util.cc
+++ b/chrome/test/base/chrome_process_util.cc
@@ -40,7 +40,7 @@ class ChildProcessFilter : public base::ProcessFilter {
explicit ChildProcessFilter(base::ProcessId parent_pid)
: parent_pids_(&parent_pid, (&parent_pid) + 1) {}
- explicit ChildProcessFilter(std::vector<base::ProcessId> parent_pids)
+ explicit ChildProcessFilter(const std::vector<base::ProcessId>& parent_pids)
: parent_pids_(parent_pids.begin(), parent_pids.end()) {}
virtual bool Includes(const base::ProcessEntry& entry) const {
diff --git a/content/browser/webui/web_ui_message_handler.cc b/content/browser/webui/web_ui_message_handler.cc
index bf2d391..7e7e3ea 100644
--- a/content/browser/webui/web_ui_message_handler.cc
+++ b/content/browser/webui/web_ui_message_handler.cc
@@ -14,21 +14,21 @@
namespace content {
void WebUIMessageHandler::SetURLAndTitle(DictionaryValue* dictionary,
- string16 title,
+ const string16& title,
const GURL& gurl) {
dictionary->SetString("url", gurl.spec());
bool using_url_as_the_title = false;
+ string16 title_to_set(title);
if (title.empty()) {
using_url_as_the_title = true;
- title = UTF8ToUTF16(gurl.spec());
+ title_to_set = UTF8ToUTF16(gurl.spec());
}
// Since the title can contain BiDi text, we need to mark the text as either
// RTL or LTR, depending on the characters in the string. If we use the URL
// as the title, we mark the title as LTR since URLs are always treated as
// left to right strings.
- string16 title_to_set(title);
if (base::i18n::IsRTL()) {
if (using_url_as_the_title) {
base::i18n::WrapStringWithLTRFormatting(&title_to_set);
diff --git a/content/public/browser/web_ui_message_handler.h b/content/public/browser/web_ui_message_handler.h
index ab0c8dd..672a8ad 100644
--- a/content/public/browser/web_ui_message_handler.h
+++ b/content/public/browser/web_ui_message_handler.h
@@ -42,7 +42,7 @@ class CONTENT_EXPORT WebUIMessageHandler {
// Adds "url" and "title" keys on incoming dictionary, setting title
// as the url as a fallback on empty title.
static void SetURLAndTitle(base::DictionaryValue* dictionary,
- string16 title,
+ const string16& title,
const GURL& gurl);
// Extract an integer value from a list Value.
diff --git a/content/renderer/renderer_main_platform_delegate_win.cc b/content/renderer/renderer_main_platform_delegate_win.cc
index 200133d..a4f3095 100644
--- a/content/renderer/renderer_main_platform_delegate_win.cc
+++ b/content/renderer/renderer_main_platform_delegate_win.cc
@@ -65,7 +65,7 @@ void EnableThemeSupportForRenderer(bool no_sandbox) {
}
// Windows-only skia sandbox support
-void SkiaPreCacheFont(LOGFONT logfont) {
+void SkiaPreCacheFont(const LOGFONT& logfont) {
content::RenderThread* render_thread = content::RenderThread::Get();
if (render_thread) {
render_thread->PreCacheFont(logfont);
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h
index ce6df11..71ff290 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.h
+++ b/ppapi/native_client/src/trusted/plugin/plugin.h
@@ -202,11 +202,13 @@ class Plugin : public pp::InstancePrivate {
// plugin_base_url is the URL used for resolving relative URLs used in
// src="...".
nacl::string plugin_base_url() const { return plugin_base_url_; }
- void set_plugin_base_url(nacl::string url) { plugin_base_url_ = url; }
+ void set_plugin_base_url(const nacl::string& url) { plugin_base_url_ = url; }
// manifest_base_url is the URL used for resolving relative URLs mentioned
// in manifest files. If the manifest is a data URI, this is an empty string.
nacl::string manifest_base_url() const { return manifest_base_url_; }
- void set_manifest_base_url(nacl::string url) { manifest_base_url_ = url; }
+ void set_manifest_base_url(const nacl::string& url) {
+ manifest_base_url_ = url;
+ }
// The URL of the manifest file as set by the "src" attribute.
// It is not the fully resolved URL if it was set as relative.
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index 8f4fa8e..f58f0c5 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -699,7 +699,7 @@ SrpcClient* ServiceRuntime::SetupAppChannel() {
}
}
-bool ServiceRuntime::Log(int severity, nacl::string msg) {
+bool ServiceRuntime::Log(int severity, const nacl::string& msg) {
NaClSrpcResultCodes rpc_result =
NaClSrpcInvokeBySignature(&command_channel_,
"log:is:",
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.h b/ppapi/native_client/src/trusted/plugin/service_runtime.h
index 54829ef..38ade82 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.h
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h
@@ -225,7 +225,7 @@ class ServiceRuntime {
// Starts the application channel to the nexe.
SrpcClient* SetupAppChannel();
- bool Log(int severity, nacl::string msg);
+ bool Log(int severity, const nacl::string& msg);
Plugin* plugin() const { return plugin_; }
void Shutdown();
diff --git a/sandbox/win/src/process_thread_dispatcher.cc b/sandbox/win/src/process_thread_dispatcher.cc
index 2df203a..b2331b7 100644
--- a/sandbox/win/src/process_thread_dispatcher.cc
+++ b/sandbox/win/src/process_thread_dispatcher.cc
@@ -64,7 +64,7 @@ bool IsPathRelative(const std::wstring &path) {
}
// Converts a relative path to an absolute path.
-bool ConvertToAbsolutePath(const std::wstring child_current_directory,
+bool ConvertToAbsolutePath(const std::wstring& child_current_directory,
bool use_env_path, std::wstring *path) {
wchar_t file_buffer[MAX_PATH];
wchar_t *file_part = NULL;
diff --git a/skia/ext/skia_sandbox_support_win.h b/skia/ext/skia_sandbox_support_win.h
index 68b881d..47615bf 100644
--- a/skia/ext/skia_sandbox_support_win.h
+++ b/skia/ext/skia_sandbox_support_win.h
@@ -9,7 +9,7 @@
#include "SkPreConfig.h"
-typedef void (*SkiaEnsureTypefaceAccessible)(LOGFONT font);
+typedef void (*SkiaEnsureTypefaceAccessible)(const LOGFONT& font);
SK_API void SetSkiaEnsureTypefaceAccessible(SkiaEnsureTypefaceAccessible func);
diff --git a/webkit/appcache/view_appcache_internals_job.cc b/webkit/appcache/view_appcache_internals_job.cc
index da6ff63..94ee601 100644
--- a/webkit/appcache/view_appcache_internals_job.cc
+++ b/webkit/appcache/view_appcache_internals_job.cc
@@ -276,7 +276,7 @@ void EmitHexDump(const char *buf, size_t buf_len, size_t total_len,
out->append("</pre>");
}
-GURL DecodeBase64URL(const std::string base64) {
+GURL DecodeBase64URL(const std::string& base64) {
std::string url;
base::Base64Decode(base64, &url);
return GURL(url);