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 1d33c52e311de215bf346fd894c75648289630fb..f8a4a267008e9a3571696a0a7e1ec9156ff3c966 100644 |
--- a/chrome/browser/safe_browsing/protocol_manager.h |
+++ b/chrome/browser/safe_browsing/protocol_manager.h |
@@ -83,6 +83,12 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
bool is_download, |
bool is_extended_reporting); |
+ // Retrieve the full hash for a set of prefixes, and invoke the callback |
+ // argument when the results are retrieved. The callback may be invoked |
+ // synchronously. |
+ virtual void GetFullHashWithApis(const std::vector<SBPrefix>& prefixes, |
+ FullHashCallback callback); |
+ |
// Forces the start of next update after |interval| time. |
void ForceScheduleNextUpdate(base::TimeDelta interval); |
@@ -185,6 +191,10 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestChunkStrings); |
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestGetHashUrl); |
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
+ TestGetHashWithApisUrl); |
+ FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
+ TestGetHashWithApisRequest); |
+ FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
TestGetHashBackOffTimes); |
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestNextChunkUrl); |
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestUpdateUrl); |
@@ -220,6 +230,15 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
GURL GetHashUrl(bool is_extended_reporting) const; |
// Generates URL for reporting safe browsing hits for UMA users. |
+ // Generates GetHashWithApis Pver4 request URL for retrieving full hashes. |
+ // |request_base64| is the serialized FindFullHashesRequest protocol buffer |
+ // encoded in base 64. |
+ GURL GetHashWithApisUrl(const std::string& request_base64) const; |
+ |
+ // Fills a FindFullHashesRequest protocol buffer for an API_ABUSE request. |
+ // Returns the serialized and base 64 encoded request as a string. |
+ std::string GetHashWithApisRequest(const std::vector<SBPrefix>& prefixes); |
+ |
// Composes a ChunkUrl based on input string. |
GURL NextChunkUrl(const std::string& input) const; |
@@ -333,6 +352,7 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
std::deque<ChunkUrl> chunk_request_urls_; |
HashRequests hash_requests_; |
+ HashRequests hash_api_requests_; |
// True if the service has been given an add/sub chunk but it hasn't been |
// added to the database yet. |