summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-06 20:11:00 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-06 20:11:00 +0000
commit2bce035bc176ac4c5c8cb5f5311c2bfd77c4ee07 (patch)
tree5106d89cb36649c23d18126e529eff9494539b7e
parent6e9d11ebd13b9e3582697f7480c3d920331dc087 (diff)
downloadchromium_src-2bce035bc176ac4c5c8cb5f5311c2bfd77c4ee07.zip
chromium_src-2bce035bc176ac4c5c8cb5f5311c2bfd77c4ee07.tar.gz
chromium_src-2bce035bc176ac4c5c8cb5f5311c2bfd77c4ee07.tar.bz2
Fix few trivial Coverity issues, mainly PASS_BY_VALUE.
Review URL: http://codereview.chromium.org/155022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19974 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/directory_watcher_unittest.cc5
-rw-r--r--base/file_path.cc2
-rw-r--r--base/simple_thread.h2
-rw-r--r--base/tracked_objects.cc6
-rw-r--r--base/tracked_objects.h6
-rw-r--r--net/base/x509_certificate.h2
6 files changed, 13 insertions, 10 deletions
diff --git a/base/directory_watcher_unittest.cc b/base/directory_watcher_unittest.cc
index 1b15de8..625c5425 100644
--- a/base/directory_watcher_unittest.cc
+++ b/base/directory_watcher_unittest.cc
@@ -27,7 +27,10 @@ const int kWaitForEventTime = 1000;
class DirectoryWatcherTest : public testing::Test {
public:
// Implementation of DirectoryWatcher on Mac requires UI loop.
- DirectoryWatcherTest() : loop_(MessageLoop::TYPE_UI) {
+ DirectoryWatcherTest()
+ : loop_(MessageLoop::TYPE_UI),
+ notified_delegates_(0),
+ expected_notified_delegates_(0) {
}
void OnTestDelegateFirstNotification(const FilePath& path) {
diff --git a/base/file_path.cc b/base/file_path.cc
index f342054..fa93b2a 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -83,7 +83,7 @@ bool IsPathAbsolute(const FilePath::StringType& path) {
#endif // FILE_PATH_USES_DRIVE_LETTERS
}
-bool AreAllSeparators(FilePath::StringType input) {
+bool AreAllSeparators(const FilePath::StringType& input) {
for (FilePath::StringType::const_iterator it = input.begin();
it != input.end(); ++it) {
if (!FilePath::IsSeparator(*it))
diff --git a/base/simple_thread.h b/base/simple_thread.h
index 17a2f6d..737b97d 100644
--- a/base/simple_thread.h
+++ b/base/simple_thread.h
@@ -152,7 +152,7 @@ class DelegateSimpleThreadPool : public DelegateSimpleThread::Delegate {
public:
typedef DelegateSimpleThread::Delegate Delegate;
- DelegateSimpleThreadPool(const std::string name_prefix, int num_threads)
+ DelegateSimpleThreadPool(const std::string& name_prefix, int num_threads)
: name_prefix_(name_prefix), num_threads_(num_threads),
dry_(true, false) { }
~DelegateSimpleThreadPool();
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index a97f014..1e7d293 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -765,7 +765,7 @@ bool Comparator::Acceptable(const Snapshot& sample) const {
return true;
}
-void Comparator::SetTiebreaker(Selector selector, const std::string required) {
+void Comparator::SetTiebreaker(Selector selector, const std::string& required) {
if (selector == selector_ || NIL == selector)
return;
combined_selectors_ |= selector;
@@ -804,7 +804,7 @@ void Comparator::SetSubgroupTiebreaker(Selector selector) {
}
}
-void Comparator::ParseKeyphrase(const std::string key_phrase) {
+void Comparator::ParseKeyphrase(const std::string& key_phrase) {
static std::map<const std::string, Selector> key_map;
static bool initialized = false;
if (!initialized) {
@@ -829,7 +829,7 @@ void Comparator::ParseKeyphrase(const std::string key_phrase) {
SetTiebreaker(key_map[keyword], required);
}
-bool Comparator::ParseQuery(const std::string query) {
+bool Comparator::ParseQuery(const std::string& query) {
for (size_t i = 0; i < query.size();) {
size_t slash_offset = query.find('/', i);
ParseKeyphrase(query.substr(i, slash_offset - i));
diff --git a/base/tracked_objects.h b/base/tracked_objects.h
index f355b8d..1934afb 100644
--- a/base/tracked_objects.h
+++ b/base/tracked_objects.h
@@ -255,7 +255,7 @@ class Comparator {
// A comparator can be refined by specifying what to do if the selected basis
// for comparison is insufficient to establish an ordering. This call adds
// the indicated attribute as the new "least significant" basis of comparison.
- void SetTiebreaker(Selector selector, const std::string required);
+ void SetTiebreaker(Selector selector, const std::string& required);
// Indicate if this instance is set up to sort by the given Selector, thereby
// putting that information in the SortGrouping, so it is not needed in each
@@ -268,10 +268,10 @@ class Comparator {
void SetSubgroupTiebreaker(Selector selector);
// Translate a keyword and restriction in URL path to a selector for sorting.
- void ParseKeyphrase(const std::string key_phrase);
+ void ParseKeyphrase(const std::string& key_phrase);
// Parse a query in an about:objects URL to decide on sort ordering.
- bool ParseQuery(const std::string query);
+ bool ParseQuery(const std::string& query);
// Output a header line that can be used to indicated what items will be
// collected in the group. It lists all (potentially) tested attributes and
diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h
index 5956826..1e2419e 100644
--- a/net/base/x509_certificate.h
+++ b/net/base/x509_certificate.h
@@ -75,7 +75,7 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
// Principal represent an X.509 principal.
struct Principal {
Principal() { }
- explicit Principal(std::string name) : common_name(name) { }
+ explicit Principal(const std::string& name) : common_name(name) { }
// The different attributes for a principal. They may be "".
// Note that some of them can have several values.