| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ | 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ |
| 7 | 7 |
| 8 // A class that implements Chrome's interface with the SafeBrowsing V4 protocol. | 8 // A class that implements Chrome's interface with the SafeBrowsing V4 protocol. |
| 9 // | 9 // |
| 10 // The V4GetHashProtocolManager handles formatting and making requests of, and | 10 // The V4GetHashProtocolManager handles formatting and making requests of, and |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, | 103 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, |
| 104 TestParseHashResponseInconsistentThreatTypes); | 104 TestParseHashResponseInconsistentThreatTypes); |
| 105 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, | 105 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, |
| 106 TestGetHashErrorHandlingOK); | 106 TestGetHashErrorHandlingOK); |
| 107 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, | 107 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, |
| 108 TestGetHashErrorHandlingNetwork); | 108 TestGetHashErrorHandlingNetwork); |
| 109 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, | 109 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingV4GetHashProtocolManagerTest, |
| 110 TestGetHashErrorHandlingResponseCode); | 110 TestGetHashErrorHandlingResponseCode); |
| 111 friend class V4GetHashProtocolManagerFactoryImpl; | 111 friend class V4GetHashProtocolManagerFactoryImpl; |
| 112 | 112 |
| 113 GURL GetHashUrl(const std::string& request_base64) const; | 113 GURL GetHashUrlAndUpdateHeaders(const std::string& request_base64, |
| 114 net::HttpRequestHeaders* headers) const; |
| 114 | 115 |
| 115 // Fills a FindFullHashesRequest protocol buffer for a request. | 116 // Fills a FindFullHashesRequest protocol buffer for a request. |
| 116 // Returns the serialized and base 64 encoded request as a string. | 117 // Returns the serialized and base 64 encoded request as a string. |
| 117 std::string GetHashRequest(const std::vector<SBPrefix>& prefixes, | 118 std::string GetHashRequest(const std::vector<SBPrefix>& prefixes, |
| 118 const std::vector<PlatformType>& platforms, | 119 const std::vector<PlatformType>& platforms, |
| 119 ThreatType threat_type); | 120 ThreatType threat_type); |
| 120 | 121 |
| 121 // Parses a FindFullHashesResponse protocol buffer and fills the results in | 122 // Parses a FindFullHashesResponse protocol buffer and fills the results in |
| 122 // |full_hashes| and |negative_cache_expire|. |data| is a serialized | 123 // |full_hashes| and |negative_cache_expire|. |data| is a serialized |
| 123 // FindFullHashes protocol buffer. |negative_cache_expire| is the cache expiry | 124 // FindFullHashes protocol buffer. |negative_cache_expire| is the cache expiry |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 net::URLRequestContextGetter* request_context_getter, | 186 net::URLRequestContextGetter* request_context_getter, |
| 186 const V4ProtocolConfig& config) = 0; | 187 const V4ProtocolConfig& config) = 0; |
| 187 | 188 |
| 188 private: | 189 private: |
| 189 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); | 190 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); |
| 190 }; | 191 }; |
| 191 | 192 |
| 192 } // namespace safe_browsing | 193 } // namespace safe_browsing |
| 193 | 194 |
| 194 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ | 195 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ |
| OLD | NEW |