summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_database.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_database.h')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.h b/chrome/browser/safe_browsing/safe_browsing_database.h
index b676665..4b4fe47 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.h
+++ b/chrome/browser/safe_browsing/safe_browsing_database.h
@@ -69,8 +69,11 @@ class SafeBrowsingDatabase {
// to blocking user requests.
void set_synchronous() { asynchronous_ = false; }
- // Store the results of a GetHash response.
- void CacheHashResults(const std::vector<SBFullHashResult>& full_hits);
+ // Store the results of a GetHash response. In the case of empty results, we
+ // cache the prefixes until the next update so that we don't have to issue
+ // further GetHash requests we know will be empty.
+ void CacheHashResults(const std::vector<SBPrefix>& prefixes,
+ const std::vector<SBFullHashResult>& full_hits);
// Called when the user's machine has resumed from a lower power state.
void HandleResume();
@@ -288,6 +291,9 @@ class SafeBrowsingDatabase {
typedef stdext::hash_map<SBPrefix, HashList> HashCache;
HashCache hash_cache_;
+ // Cache of prefixes that returned empty results (no full hash match).
+ std::set<SBPrefix> prefix_miss_cache_;
+
// The amount of time, in milliseconds, to wait before the next disk write.
int disk_delay_;