| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // were no matches, and that the resource is safe. | 45 // were no matches, and that the resource is safe. |
| 46 // - The negative cache duration of the result. | 46 // - The negative cache duration of the result. |
| 47 typedef base::Callback<void(const std::vector<SBFullHashResult>&, | 47 typedef base::Callback<void(const std::vector<SBFullHashResult>&, |
| 48 const base::TimeDelta&)> | 48 const base::TimeDelta&)> |
| 49 FullHashCallback; | 49 FullHashCallback; |
| 50 | 50 |
| 51 ~V4GetHashProtocolManager() override; | 51 ~V4GetHashProtocolManager() override; |
| 52 | 52 |
| 53 // Makes the passed |factory| the factory used to instantiate | 53 // Makes the passed |factory| the factory used to instantiate |
| 54 // a V4GetHashProtocolManager. Useful for tests. | 54 // a V4GetHashProtocolManager. Useful for tests. |
| 55 static void RegisterFactory(V4GetHashProtocolManagerFactory* factory) { | 55 static void RegisterFactory( |
| 56 factory_ = factory; | 56 std::unique_ptr<V4GetHashProtocolManagerFactory> factory); |
| 57 } | |
| 58 | 57 |
| 59 // Create an instance of the safe browsing v4 protocol manager. | 58 // Create an instance of the safe browsing v4 protocol manager. |
| 60 static V4GetHashProtocolManager* Create( | 59 static V4GetHashProtocolManager* Create( |
| 61 net::URLRequestContextGetter* request_context_getter, | 60 net::URLRequestContextGetter* request_context_getter, |
| 62 const V4ProtocolConfig& config); | 61 const V4ProtocolConfig& config); |
| 63 | 62 |
| 64 // net::URLFetcherDelegate interface. | 63 // net::URLFetcherDelegate interface. |
| 65 void OnURLFetchComplete(const net::URLFetcher* source) override; | 64 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 66 | 65 |
| 67 // Retrieve the full hash for a set of prefixes, and invoke the callback | 66 // Retrieve the full hash for a set of prefixes, and invoke the callback |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 net::URLRequestContextGetter* request_context_getter, | 177 net::URLRequestContextGetter* request_context_getter, |
| 179 const V4ProtocolConfig& config) = 0; | 178 const V4ProtocolConfig& config) = 0; |
| 180 | 179 |
| 181 private: | 180 private: |
| 182 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); | 181 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); |
| 183 }; | 182 }; |
| 184 | 183 |
| 185 } // namespace safe_browsing | 184 } // namespace safe_browsing |
| 186 | 185 |
| 187 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ | 186 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ |
| OLD | NEW |