diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 19:38:22 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 19:38:22 +0000 |
commit | 48329f9991ee2acf562abdd28e41c5597dc2c066 (patch) | |
tree | 1dc266596a66273d47890d113c1494b0c574d0e0 | |
parent | 34f75094b3a50f58a57b5676a160e0b96db3bd8a (diff) | |
download | chromium_src-48329f9991ee2acf562abdd28e41c5597dc2c066.zip chromium_src-48329f9991ee2acf562abdd28e41c5597dc2c066.tar.gz chromium_src-48329f9991ee2acf562abdd28e41c5597dc2c066.tar.bz2 |
Coverity: Pass parameters by reference.
CID=6820,8735,11066,11067,11070,11071,11072,11073,11215,11216,11217,11927,12403
BUG=none
TEST=none
R=csilv@chromium.org
Review URL: http://codereview.chromium.org/6730040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79602 0039d316-1c4b-4281-b951-d872f2087c98
16 files changed, 40 insertions, 32 deletions
diff --git a/chrome/browser/extensions/extension_menu_manager.cc b/chrome/browser/extensions/extension_menu_manager.cc index c87dfb7..33ed7fc 100644 --- a/chrome/browser/extensions/extension_menu_manager.cc +++ b/chrome/browser/extensions/extension_menu_manager.cc @@ -285,7 +285,8 @@ bool ExtensionMenuManager::RemoveContextMenuItem( return result; } -void ExtensionMenuManager::RemoveAllContextItems(std::string extension_id) { +void ExtensionMenuManager::RemoveAllContextItems( + const std::string& extension_id) { ExtensionMenuItem::List::iterator i; for (i = context_items_[extension_id].begin(); i != context_items_[extension_id].end(); ++i) { diff --git a/chrome/browser/extensions/extension_menu_manager.h b/chrome/browser/extensions/extension_menu_manager.h index b54d57a..94cbe75 100644 --- a/chrome/browser/extensions/extension_menu_manager.h +++ b/chrome/browser/extensions/extension_menu_manager.h @@ -124,7 +124,7 @@ class ExtensionMenuItem { } // Simple mutator methods. - void set_title(std::string new_title) { title_ = new_title; } + void set_title(const std::string& new_title) { title_ = new_title; } void set_contexts(ContextList contexts) { contexts_ = contexts; } void set_type(Type type) { type_ = type; } void set_document_url_patterns(const ExtensionExtent& patterns) { @@ -233,7 +233,7 @@ class ExtensionMenuManager : public NotificationObserver { bool RemoveContextMenuItem(const ExtensionMenuItem::Id& id); // Removes all items for the given extension id. - void RemoveAllContextItems(std::string extension_id); + void RemoveAllContextItems(const std::string& extension_id); // Returns the item with the given |id| or NULL. ExtensionMenuItem* GetItemById(const ExtensionMenuItem::Id& id) const; diff --git a/chrome/browser/importer/external_process_importer_bridge.cc b/chrome/browser/importer/external_process_importer_bridge.cc index c262483..1bbe237 100644 --- a/chrome/browser/importer/external_process_importer_bridge.cc +++ b/chrome/browser/importer/external_process_importer_bridge.cc @@ -39,7 +39,7 @@ void ExternalProcessImporterBridge::AddHomePage(const GURL& home_page) { #if defined(OS_WIN) void ExternalProcessImporterBridge::AddIE7PasswordInfo( - const IE7PasswordInfo password_info) { + const IE7PasswordInfo& password_info) { NOTIMPLEMENTED(); } #endif diff --git a/chrome/browser/importer/external_process_importer_bridge.h b/chrome/browser/importer/external_process_importer_bridge.h index 4c5644a..4a9d28c 100644 --- a/chrome/browser/importer/external_process_importer_bridge.h +++ b/chrome/browser/importer/external_process_importer_bridge.h @@ -38,7 +38,8 @@ class ExternalProcessImporterBridge : public ImporterBridge { virtual void AddHomePage(const GURL& home_page) OVERRIDE; #if defined(OS_WIN) - virtual void AddIE7PasswordInfo(const IE7PasswordInfo password_info) OVERRIDE; + virtual void AddIE7PasswordInfo( + const IE7PasswordInfo& password_info) OVERRIDE; #endif virtual void SetFavicons( diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc index dde3a39..c7279df 100644 --- a/chrome/browser/importer/external_process_importer_client.cc +++ b/chrome/browser/importer/external_process_importer_client.cc @@ -85,8 +85,8 @@ void ExternalProcessImporterClient::OnImportStart() { bridge_->NotifyStarted(); } -void ExternalProcessImporterClient::OnImportFinished(bool succeeded, - std::string error_msg) { +void ExternalProcessImporterClient::OnImportFinished( + bool succeeded, const std::string& error_msg) { if (cancelled_) return; @@ -147,8 +147,9 @@ void ExternalProcessImporterClient::OnHomePageImportReady( } void ExternalProcessImporterClient::OnBookmarksImportStart( - const std::wstring first_folder_name, - int options, size_t total_bookmarks_count) { + const std::wstring& first_folder_name, + int options, + size_t total_bookmarks_count) { if (cancelled_) return; diff --git a/chrome/browser/importer/external_process_importer_client.h b/chrome/browser/importer/external_process_importer_client.h index 4a053f9..973975a 100644 --- a/chrome/browser/importer/external_process_importer_client.h +++ b/chrome/browser/importer/external_process_importer_client.h @@ -51,7 +51,8 @@ class ExternalProcessImporterClient // Begin ProfileImportProcessHost::ImportProcessClient implementation. virtual void OnProcessCrashed(int exit_status) OVERRIDE; virtual void OnImportStart() OVERRIDE; - virtual void OnImportFinished(bool succeeded, std::string error_msg) OVERRIDE; + virtual void OnImportFinished(bool succeeded, + const std::string& error_msg) OVERRIDE; virtual void OnImportItemStart(int item) OVERRIDE; virtual void OnImportItemFinished(int item) OVERRIDE; @@ -72,7 +73,7 @@ class ExternalProcessImporterClient // |first_folder_name| can be NULL. // |options| is described in ProfileWriter::BookmarkOptions. // |total_bookmarks_count| is the total number of bookmarks to be imported. - virtual void OnBookmarksImportStart(const std::wstring first_folder_name, + virtual void OnBookmarksImportStart(const std::wstring& first_folder_name, int options, size_t total_bookmarks_count) OVERRIDE; diff --git a/chrome/browser/importer/importer_bridge.h b/chrome/browser/importer/importer_bridge.h index e6653fa..bea568a 100644 --- a/chrome/browser/importer/importer_bridge.h +++ b/chrome/browser/importer/importer_bridge.h @@ -30,7 +30,7 @@ class ImporterBridge : public base::RefCountedThreadSafe<ImporterBridge> { virtual void AddHomePage(const GURL& home_page) = 0; #if defined(OS_WIN) - virtual void AddIE7PasswordInfo(const IE7PasswordInfo password_info) = 0; + virtual void AddIE7PasswordInfo(const IE7PasswordInfo& password_info) = 0; #endif virtual void SetFavicons( diff --git a/chrome/browser/importer/in_process_importer_bridge.cc b/chrome/browser/importer/in_process_importer_bridge.cc index 382871f..b57d211 100644 --- a/chrome/browser/importer/in_process_importer_bridge.cc +++ b/chrome/browser/importer/in_process_importer_bridge.cc @@ -39,7 +39,7 @@ void InProcessImporterBridge::AddHomePage(const GURL &home_page) { #if defined(OS_WIN) void InProcessImporterBridge::AddIE7PasswordInfo( - const IE7PasswordInfo password_info) { + const IE7PasswordInfo& password_info) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, NewRunnableMethod(writer_, &ProfileWriter::AddIE7PasswordInfo, diff --git a/chrome/browser/importer/in_process_importer_bridge.h b/chrome/browser/importer/in_process_importer_bridge.h index bde4320..142d4f6 100644 --- a/chrome/browser/importer/in_process_importer_bridge.h +++ b/chrome/browser/importer/in_process_importer_bridge.h @@ -30,7 +30,8 @@ class InProcessImporterBridge : public ImporterBridge { virtual void AddHomePage(const GURL &home_page) OVERRIDE; #if defined(OS_WIN) - virtual void AddIE7PasswordInfo(const IE7PasswordInfo password_info) OVERRIDE; + virtual void AddIE7PasswordInfo( + const IE7PasswordInfo& password_info) OVERRIDE; #endif virtual void SetFavicons( diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc index 3b5af2e..5def384 100644 --- a/chrome/browser/net/predictor.cc +++ b/chrome/browser/net/predictor.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -281,7 +281,7 @@ struct RightToLeftStringSorter { } static bool string_compare(const std::string& left_host, - const std::string right_host) { + const std::string& right_host) { if (left_host == right_host) return true; size_t left_already_matched = left_host.size(); size_t right_already_matched = right_host.size(); diff --git a/chrome/browser/profile_import_process_host.h b/chrome/browser/profile_import_process_host.h index d485563..24e7dae 100644 --- a/chrome/browser/profile_import_process_host.h +++ b/chrome/browser/profile_import_process_host.h @@ -41,10 +41,11 @@ class ProfileImportProcessHost : public BrowserChildProcessHost { // ImporterHost. virtual void OnProcessCrashed(int exit_status) {} virtual void OnImportStart() {} - virtual void OnImportFinished(bool succeeded, std::string error_msg) {} + virtual void OnImportFinished(bool succeeded, + const std::string& error_msg) {} virtual void OnImportItemStart(int item) {} virtual void OnImportItemFinished(int item) {} - virtual void OnImportItemFailed(std::string error_msg) {} + virtual void OnImportItemFailed(const std::string& error_msg) {} // These methods pass back data to be written to the user's profile from // the external process to the process host client. @@ -56,9 +57,9 @@ class ProfileImportProcessHost : public BrowserChildProcessHost { virtual void OnHomePageImportReady( const GURL& home_page) {} - virtual void OnBookmarksImportStart( - const std::wstring first_folder_name, - int options, size_t total_bookmarks_count) {} + virtual void OnBookmarksImportStart(const std::wstring& first_folder_name, + int options, + size_t total_bookmarks_count) {} virtual void OnBookmarksImportGroup( const std::vector<ProfileWriter::BookmarkEntry>& bookmarks) {} diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index e996b3b..6251845 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -472,7 +472,8 @@ class StatusBubbleViews::StatusViewExpander : public ui::LinearAnimation, } // Manage the expansion of the bubble. - void StartExpansion(string16 expanded_text, int current_width, + void StartExpansion(const string16& expanded_text, + int current_width, int expansion_end); // Set width of fully expanded bubble. @@ -510,7 +511,8 @@ void StatusBubbleViews::StatusViewExpander::AnimationEnded( } void StatusBubbleViews::StatusViewExpander::StartExpansion( - string16 expanded_text, int expansion_start, + const string16& expanded_text, + int expansion_start, int expansion_end) { expanded_text_ = expanded_text; expansion_start_ = expansion_start; diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc index b641d35..cbf55ee 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc @@ -258,9 +258,9 @@ bool CloudPrintProxyBackend::InitializeWithLsid(const std::string& lsid, } bool CloudPrintProxyBackend::InitializeWithToken( - const std::string cloud_print_token, - const std::string cloud_print_xmpp_token, - const std::string email, + const std::string& cloud_print_token, + const std::string& cloud_print_xmpp_token, + const std::string& email, const std::string& proxy_id) { if (!core_thread_.Start()) return false; diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.h b/chrome/service/cloud_print/cloud_print_proxy_backend.h index 2a6b3df..aa0328d 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.h +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -55,9 +55,9 @@ class CloudPrintProxyBackend { ~CloudPrintProxyBackend(); bool InitializeWithLsid(const std::string& lsid, const std::string& proxy_id); - bool InitializeWithToken(const std::string cloud_print_token, - const std::string cloud_print_xmpp_token, - const std::string email, + bool InitializeWithToken(const std::string& cloud_print_token, + const std::string& cloud_print_xmpp_token, + const std::string& email, const std::string& proxy_id); void Shutdown(); void RegisterPrinters(const printing::PrinterList& printer_list); diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc index fd86652..a49e434 100644 --- a/chrome/service/service_utility_process_host.cc +++ b/chrome/service/service_utility_process_host.cc @@ -157,7 +157,7 @@ bool ServiceUtilityProcessHost::MessageForClient(const IPC::Message& message) { } #if defined(OS_WIN) // This hack is Windows-specific. -void ServiceUtilityProcessHost::OnPreCacheFont(LOGFONT font) { +void ServiceUtilityProcessHost::OnPreCacheFont(const LOGFONT& font) { PreCacheFont(font); } #endif // OS_WIN diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h index d9d9907..b3802f9 100644 --- a/chrome/service/service_utility_process_host.h +++ b/chrome/service/service_utility_process_host.h @@ -130,7 +130,7 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost { bool MessageForClient(const IPC::Message& message); #if defined(OS_WIN) // This hack is Windows-specific. - void OnPreCacheFont(LOGFONT font); + void OnPreCacheFont(const LOGFONT& font); #endif // defined(OS_WIN) // A pointer to our client interface, who will be informed of progress. |