diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 17:39:10 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 17:39:10 +0000 |
commit | 2a025b18b5c8971caa8845da9a724a2092e37eae (patch) | |
tree | 8d18268a54724fa6d266d45ecca2542b5b5b08db /chrome/browser/extensions | |
parent | f5ad75410da18f0963d1a4901e45fd71d051595a (diff) | |
download | chromium_src-2a025b18b5c8971caa8845da9a724a2092e37eae.zip chromium_src-2a025b18b5c8971caa8845da9a724a2092e37eae.tar.gz chromium_src-2a025b18b5c8971caa8845da9a724a2092e37eae.tar.bz2 |
Coverity: Pass strings and GURLs by reference.
CID=5051,5052,5053
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/159343
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_updater.cc | 6 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_updater.h | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_updater_unittest.cc | 7 |
3 files changed, 11 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 770f9c6..a6a5ca5 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -4,6 +4,9 @@ #include "chrome/browser/extensions/extension_updater.h" +#include <algorithm> +#include <set> + #include "base/logging.h" #include "base/file_util.h" #include "base/file_version_info.h" @@ -537,7 +540,8 @@ void ExtensionUpdater::StartUpdateCheck(const GURL& url) { } } -void ExtensionUpdater::FetchUpdatedExtension(const std::string& id, GURL url) { +void ExtensionUpdater::FetchUpdatedExtension(const std::string& id, + const GURL& url) { for (std::deque<ExtensionFetch>::const_iterator iter = extensions_pending_.begin(); iter != extensions_pending_.end(); ++iter) { diff --git a/chrome/browser/extensions/extension_updater.h b/chrome/browser/extensions/extension_updater.h index 5af2c03..3973b4e 100644 --- a/chrome/browser/extensions/extension_updater.h +++ b/chrome/browser/extensions/extension_updater.h @@ -92,7 +92,7 @@ class ExtensionUpdater std::string id; GURL url; ExtensionFetch() : id(""), url() {} - ExtensionFetch(std::string i, GURL u) : id(i), url(u) {} + ExtensionFetch(const std::string& i, const GURL& u) : id(i), url(u) {} }; // These are needed for unit testing, to help identify the correct mock @@ -139,7 +139,7 @@ class ExtensionUpdater void StartUpdateCheck(const GURL& url); // Begins (or queues up) download of an updated extension. - void FetchUpdatedExtension(const std::string& id, GURL url); + void FetchUpdatedExtension(const std::string& id, const GURL& url); typedef std::vector<ParseResult*> ParseResultList; diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc index 55acce7..999adbd 100644 --- a/chrome/browser/extensions/extension_updater_unittest.cc +++ b/chrome/browser/extensions/extension_updater_unittest.cc @@ -205,9 +205,10 @@ class ExtensionUpdaterTest : public testing::Test { } // Make a test ParseResult - static ExtensionUpdater::ParseResult* MakeParseResult(std::string id, - std::string version, - std::string url) { + static ExtensionUpdater::ParseResult* MakeParseResult( + const std::string& id, + const std::string& version, + const std::string& url) { ExtensionUpdater::ParseResult *result = new ExtensionUpdater::ParseResult; result->extension_id = id; result->version.reset(Version::GetVersionFromString(version)); |