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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_store.h

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.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_store.h b/chrome/browser/safe_browsing/safe_browsing_store.h
index b3817438e5e6b4bd644eb9f547afec59b7d39aee..d3ee8ea79bd1fef1229e7dadfcb482242c9ff02f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store.h
+++ b/chrome/browser/safe_browsing/safe_browsing_store.h
@@ -74,21 +74,15 @@ typedef std::deque<SBSubPrefix> SBSubPrefixes;
struct SBAddFullHash {
int32 chunk_id;
- int32 received;
+ // Received field is not used anymore, but is kept for DB compatability.
+ // TODO(mattm): Remove it next time the DB format is changed.
+ int32 deprecated_received;
SBFullHash full_hash;
- SBAddFullHash(int32 id, base::Time r, const SBFullHash& h)
- : chunk_id(id),
- received(static_cast<int32>(r.ToTimeT())),
- full_hash(h) {
- }
+ SBAddFullHash(int32 id, const SBFullHash& h)
+ : chunk_id(id), deprecated_received(), full_hash(h) {}
- // Provided for ReadAddHashes() implementations, which already have
- // an int32 for the time.
- SBAddFullHash(int32 id, int32 r, const SBFullHash& h)
- : chunk_id(id), received(r), full_hash(h) {}
-
- SBAddFullHash() : chunk_id(), received(), full_hash() {}
+ SBAddFullHash() : chunk_id(), deprecated_received(), full_hash() {}
int32 GetAddChunkId() const { return chunk_id; }
SBPrefix GetAddPrefix() const { return full_hash.prefix; }
@@ -184,7 +178,6 @@ class SafeBrowsingStore {
virtual bool WriteAddPrefix(int32 chunk_id, SBPrefix prefix) = 0;
virtual bool WriteAddHash(int32 chunk_id,
- base::Time receive_time,
const SBFullHash& full_hash) = 0;
virtual bool WriteSubPrefix(int32 chunk_id,
int32 add_chunk_id, SBPrefix prefix) = 0;
@@ -220,12 +213,7 @@ class SafeBrowsingStore {
// Pass the collected chunks through SBPRocessSubs() and commit to
// permanent storage. The resulting add prefixes and hashes will be
// stored in |add_prefixes_result| and |add_full_hashes_result|.
- // |pending_adds| is the set of full hashes which have been received
- // since the previous update, and is provided as a convenience
- // (could be written via WriteAddHash(), but that would flush the
- // chunk to disk).
virtual bool FinishUpdate(
- const std::vector<SBAddFullHash>& pending_adds,
safe_browsing::PrefixSetBuilder* builder,
std::vector<SBAddFullHash>* add_full_hashes_result) = 0;

Powered by Google App Engine
This is Rietveld 408576698