| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 // The clock used to vend times. | 329 // The clock used to vend times. |
| 330 std::unique_ptr<base::Clock> clock_; | 330 std::unique_ptr<base::Clock> clock_; |
| 331 | 331 |
| 332 // A cache of full hash results. | 332 // A cache of full hash results. |
| 333 FullHashCache full_hash_cache_; | 333 FullHashCache full_hash_cache_; |
| 334 | 334 |
| 335 // The following sets represent the combination of lists that we would always | 335 // The following sets represent the combination of lists that we would always |
| 336 // request from the server, irrespective of which list we found the hash | 336 // request from the server, irrespective of which list we found the hash |
| 337 // prefix match in. | 337 // prefix match in. |
| 338 std::unordered_set<PlatformType> platform_types_; | 338 std::vector<PlatformType> platform_types_; |
| 339 std::unordered_set<ThreatEntryType> threat_entry_types_; | 339 std::vector<ThreatEntryType> threat_entry_types_; |
| 340 std::unordered_set<ThreatType> threat_types_; | 340 std::vector<ThreatType> threat_types_; |
| 341 | 341 |
| 342 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManager); | 342 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManager); |
| 343 }; | 343 }; |
| 344 | 344 |
| 345 // Interface of a factory to create V4GetHashProtocolManager. Useful for tests. | 345 // Interface of a factory to create V4GetHashProtocolManager. Useful for tests. |
| 346 class V4GetHashProtocolManagerFactory { | 346 class V4GetHashProtocolManagerFactory { |
| 347 public: | 347 public: |
| 348 V4GetHashProtocolManagerFactory() {} | 348 V4GetHashProtocolManagerFactory() {} |
| 349 virtual ~V4GetHashProtocolManagerFactory() {} | 349 virtual ~V4GetHashProtocolManagerFactory() {} |
| 350 virtual std::unique_ptr<V4GetHashProtocolManager> CreateProtocolManager( | 350 virtual std::unique_ptr<V4GetHashProtocolManager> CreateProtocolManager( |
| 351 net::URLRequestContextGetter* request_context_getter, | 351 net::URLRequestContextGetter* request_context_getter, |
| 352 const StoresToCheck& stores_to_check, | 352 const StoresToCheck& stores_to_check, |
| 353 const V4ProtocolConfig& config) = 0; | 353 const V4ProtocolConfig& config) = 0; |
| 354 | 354 |
| 355 private: | 355 private: |
| 356 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); | 356 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); |
| 357 }; | 357 }; |
| 358 | 358 |
| 359 #ifndef NDEBUG | 359 #ifndef NDEBUG |
| 360 std::ostream& operator<<(std::ostream& os, const FullHashInfo& id); | 360 std::ostream& operator<<(std::ostream& os, const FullHashInfo& id); |
| 361 #endif | 361 #endif |
| 362 | 362 |
| 363 } // namespace safe_browsing | 363 } // namespace safe_browsing |
| 364 | 364 |
| 365 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ | 365 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ |
| OLD | NEW |