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

Unified Diff: chrome/browser/safe_browsing/protocol_manager.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: changes to fullhash / prefix handling Created 6 years, 9 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/protocol_manager.h
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h
index f5555e3f6e1020f3d1d2765b451152a3a5503530..5442c18ccb1540888409a379dd886f53127fe8b0 100644
--- a/chrome/browser/safe_browsing/protocol_manager.h
+++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -59,10 +59,10 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
// Parameters:
// - The vector of full hash results. If empty, indicates that there
// were no matches, and that the resource is safe.
- // - Whether the result can be cached. This may not be the case when
- // the result did not come from the SB server, for example.
+ // - The cache lifetime of the result. A lifetime of 0 indicates the results
+ // should not be cached.
typedef base::Callback<void(const std::vector<SBFullHashResult>&,
- bool)> FullHashCallback;
+ const base::TimeDelta&)> FullHashCallback;
virtual ~SafeBrowsingProtocolManager();
@@ -142,6 +142,15 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
// cleared up by the full hashes.
GET_HASH_FULL_HASH_MISS,
+ // Subset of successful responses where the response body wasn't parsable.
+ GET_HASH_PARSE_ERROR,
+
+ // Gethash request failed (network error).
+ GET_HASH_NETWORK_ERROR,
+
+ // Gethash request returned HTTP result code other than 200 or 204.
+ GET_HASH_HTTP_ERROR,
+
// Memory space for histograms is determined by the max. ALWAYS
// ADD NEW VALUES BEFORE THIS ONE.
GET_HASH_RESULT_MAX

Powered by Google App Engine
This is Rietveld 408576698