Chromium Code Reviews| 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 63a151fa18fdbe6702c218b3f1c56d38797754fd..c6f7bb2ddb4bffc71a0cf766ac7ea8401ae96913 100644 |
| --- a/chrome/browser/safe_browsing/protocol_manager.h |
| +++ b/chrome/browser/safe_browsing/protocol_manager.h |
| @@ -88,6 +88,7 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
| // argument when the results are retrieved. The callback may be invoked |
| // synchronously. Uses the V4 Safe Browsing protocol. |
| virtual void GetV4FullHashes(const std::vector<SBPrefix>& prefixes, |
| + const std::vector<PlatformType>& platforms, |
| ThreatType threat_type, |
|
awoz
2016/01/05 17:20:10
How about a vector of threat types as well? That w
|
| FullHashCallback callback); |
| @@ -203,6 +204,14 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
| FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
| TestGetV4HashRequest); |
| FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
| + TestParseV4HashResponse); |
| + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
| + TestParseV4HashResponseWrongThreatEntryType); |
| + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
| + TestParseV4HashResponseSocialEngineeringThreatType); |
| + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
| + TestParseV4HashResponseNonPermissionMetadata); |
| + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
| TestGetHashBackOffTimes); |
| FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestNextChunkUrl); |
| FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestUpdateUrl); |
| @@ -243,11 +252,21 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
| // encoded in base 64. |
| GURL GetV4HashUrl(const std::string& request_base64) const; |
| - // Fills a FindFullHashesRequest protocol buffer for an API_ABUSE request. |
| + // Fills a FindFullHashesRequest protocol buffer for a V4 request. |
| // Returns the serialized and base 64 encoded request as a string. |
| std::string GetV4HashRequest(const std::vector<SBPrefix>& prefixes, |
| + const std::vector<PlatformType>& platforms, |
| ThreatType threat_type); |
| + // Parses a FindFullHashesResponse protocol buffer and fills the results in |
| + // |full_hashes| and |negative_cache_duration|. |data| is a serialized |
| + // FindFullHashes protocol buffer. |negative_cache_duration| is the duration |
| + // to cache the response for entities that did not match the threat list. |
| + // Returns true if parsing is successful, false otherwise. |
| + bool ParseV4HashResponse(const std::string& data_base64, |
| + std::vector<SBFullHashResult>* full_hashes, |
| + base::TimeDelta* negative_cache_duration); |
| + |
| // Composes a ChunkUrl based on input string. |
| GURL NextChunkUrl(const std::string& input) const; |