Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5493)

Unified Diff: chrome/browser/safe_browsing/safe_browsing_store_file.cc

Issue 220493003: Safebrowsing: change gethash caching to match api 2.3 rules, fix some corner cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (including 227613008) Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_store_file.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
index 50c1b5fcff1b005f6347bed9b3083b7deb54ac97..8b75a25b614024ad4ea76af7b599adae95ab9df6 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
@@ -442,10 +442,6 @@ bool prefix_bounder(SBPrefix val, const T& elt) {
// aggregate operations on same.
class StateInternal {
public:
- explicit StateInternal(const std::vector<SBAddFullHash>& pending_adds)
- : add_full_hashes_(pending_adds.begin(), pending_adds.end()) {
- }
-
StateInternal() {}
// Append indicated amount of data from |fp|.
@@ -779,9 +775,8 @@ bool SafeBrowsingStoreFile::GetAddFullHashes(
}
bool SafeBrowsingStoreFile::WriteAddHash(int32 chunk_id,
- base::Time receive_time,
const SBFullHash& full_hash) {
- add_hashes_.push_back(SBAddFullHash(chunk_id, receive_time, full_hash));
+ add_hashes_.push_back(SBAddFullHash(chunk_id, full_hash));
return true;
}
@@ -915,7 +910,6 @@ bool SafeBrowsingStoreFile::FinishChunk() {
}
bool SafeBrowsingStoreFile::DoUpdate(
- const std::vector<SBAddFullHash>& pending_adds,
safe_browsing::PrefixSetBuilder* builder,
std::vector<SBAddFullHash>* add_full_hashes_result) {
DCHECK(file_.get() || empty_);
@@ -939,7 +933,7 @@ bool SafeBrowsingStoreFile::DoUpdate(
std::max(static_cast<int>(update_size / 1024), 1));
// Chunk updates to integrate.
- StateInternal new_state(pending_adds);
+ StateInternal new_state;
// Read update chunks.
for (int i = 0; i < chunks_written_; ++i) {
@@ -1181,13 +1175,12 @@ bool SafeBrowsingStoreFile::DoUpdate(
}
bool SafeBrowsingStoreFile::FinishUpdate(
- const std::vector<SBAddFullHash>& pending_adds,
safe_browsing::PrefixSetBuilder* builder,
std::vector<SBAddFullHash>* add_full_hashes_result) {
DCHECK(builder);
DCHECK(add_full_hashes_result);
- if (!DoUpdate(pending_adds, builder, add_full_hashes_result)) {
+ if (!DoUpdate(builder, add_full_hashes_result)) {
CancelUpdate();
return false;
}

Powered by Google App Engine
This is Rietveld 408576698