summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-09 02:04:17 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-09 02:04:17 +0000
commitaad8e8ffb7ccdecd012a427e47bffb454e08bded (patch)
tree4df4ca8ac0eae9cd80449665caec58fdcb7f399a /chrome/browser/safe_browsing
parent556aa68d7645a4e3e802ab304bdc85e240f25747 (diff)
downloadchromium_src-aad8e8ffb7ccdecd012a427e47bffb454e08bded.zip
chromium_src-aad8e8ffb7ccdecd012a427e47bffb454e08bded.tar.gz
chromium_src-aad8e8ffb7ccdecd012a427e47bffb454e08bded.tar.bz2
Coverity: Pass parameters by reference.
CID=2620,2654,2656,2657,2694,2701,2718,8074,8075,8076,8077,8078, 8079,8080,8082,8083,8406,8407,8408,8730,9160,11282,11897,12722, 12724 BUG=none TEST=none Review URL: http://codereview.chromium.org/4623001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65469 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_store.h11
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_store_file.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_store_file.h5
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_store_sqlite.h5
4 files changed, 14 insertions, 11 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_store.h b/chrome/browser/safe_browsing/safe_browsing_store.h
index b6b44bd..418c55f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store.h
+++ b/chrome/browser/safe_browsing/safe_browsing_store.h
@@ -69,7 +69,7 @@ struct SBAddFullHash {
int32 received;
SBFullHash full_hash;
- SBAddFullHash(int32 id, base::Time r, SBFullHash h)
+ SBAddFullHash(int32 id, base::Time r, const SBFullHash& h)
: chunk_id(id),
received(static_cast<int32>(r.ToTimeT())),
full_hash(h) {
@@ -77,7 +77,7 @@ struct SBAddFullHash {
// Provided for ReadAddHashes() implementations, which already have
// an int32 for the time.
- SBAddFullHash(int32 id, int32 r, SBFullHash h)
+ SBAddFullHash(int32 id, int32 r, const SBFullHash& h)
: chunk_id(id), received(r), full_hash(h) {}
SBAddFullHash() : chunk_id(), received(), full_hash() {}
@@ -91,7 +91,7 @@ struct SBSubFullHash {
int32 add_chunk_id;
SBFullHash full_hash;
- SBSubFullHash(int32 id, int32 add_id, SBFullHash h)
+ SBSubFullHash(int32 id, int32 add_id, const SBFullHash& h)
: chunk_id(id), add_chunk_id(add_id), full_hash(h) {}
SBSubFullHash() : chunk_id(), add_chunk_id(), full_hash() {}
@@ -182,11 +182,12 @@ class SafeBrowsingStore {
virtual bool WriteAddPrefix(int32 chunk_id, SBPrefix prefix) = 0;
virtual bool WriteAddHash(int32 chunk_id,
- base::Time receive_time, SBFullHash full_hash) = 0;
+ base::Time receive_time,
+ const SBFullHash& full_hash) = 0;
virtual bool WriteSubPrefix(int32 chunk_id,
int32 add_chunk_id, SBPrefix prefix) = 0;
virtual bool WriteSubHash(int32 chunk_id, int32 add_chunk_id,
- SBFullHash full_hash) = 0;
+ const SBFullHash& full_hash) = 0;
// Collect the chunk data and preferrably store it on disk to
// release memory. Shoul not modify the data in-place.
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
index 196cf0d..71f415f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
@@ -239,7 +239,7 @@ bool SafeBrowsingStoreFile::WriteAddPrefix(int32 chunk_id, SBPrefix prefix) {
bool SafeBrowsingStoreFile::WriteAddHash(int32 chunk_id,
base::Time receive_time,
- SBFullHash full_hash) {
+ const SBFullHash& full_hash) {
add_hashes_.push_back(SBAddFullHash(chunk_id, receive_time, full_hash));
return true;
}
@@ -252,7 +252,7 @@ bool SafeBrowsingStoreFile::WriteSubPrefix(int32 chunk_id,
}
bool SafeBrowsingStoreFile::WriteSubHash(int32 chunk_id, int32 add_chunk_id,
- SBFullHash full_hash) {
+ const SBFullHash& full_hash) {
sub_hashes_.push_back(SBSubFullHash(chunk_id, add_chunk_id, full_hash));
return true;
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.h b/chrome/browser/safe_browsing/safe_browsing_store_file.h
index cd0cee2..5ddc87a 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_file.h
+++ b/chrome/browser/safe_browsing/safe_browsing_store_file.h
@@ -127,11 +127,12 @@ class SafeBrowsingStoreFile : public SafeBrowsingStore {
virtual bool BeginChunk();
virtual bool WriteAddPrefix(int32 chunk_id, SBPrefix prefix);
virtual bool WriteAddHash(int32 chunk_id,
- base::Time receive_time, SBFullHash full_hash);
+ base::Time receive_time,
+ const SBFullHash& full_hash);
virtual bool WriteSubPrefix(int32 chunk_id,
int32 add_chunk_id, SBPrefix prefix);
virtual bool WriteSubHash(int32 chunk_id, int32 add_chunk_id,
- SBFullHash full_hash);
+ const SBFullHash& full_hash);
virtual bool FinishChunk();
virtual bool BeginUpdate();
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h
index 6f684c1d..60e7fda 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h
+++ b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h
@@ -37,7 +37,8 @@ class SafeBrowsingStoreSqlite : public SafeBrowsingStore {
return WriteAddPrefixes(prefixes);
}
virtual bool WriteAddHash(int32 chunk_id,
- base::Time receive_time, SBFullHash full_hash) {
+ base::Time receive_time,
+ const SBFullHash& full_hash) {
const std::vector<SBAddFullHash>
hashes(1, SBAddFullHash(chunk_id, receive_time, full_hash));
return WriteAddHashes(hashes);
@@ -49,7 +50,7 @@ class SafeBrowsingStoreSqlite : public SafeBrowsingStore {
return WriteSubPrefixes(prefixes);
}
virtual bool WriteSubHash(int32 chunk_id, int32 add_chunk_id,
- SBFullHash full_hash) {
+ const SBFullHash& full_hash) {
const std::vector<SBSubFullHash>
hashes(1, SBSubFullHash(chunk_id, add_chunk_id, full_hash));
return WriteSubHashes(hashes);