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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 // Create an instance of the safe browsing v4 protocol manager. | 61 // Create an instance of the safe browsing v4 protocol manager. |
62 static V4GetHashProtocolManager* Create( | 62 static V4GetHashProtocolManager* Create( |
63 net::URLRequestContextGetter* request_context_getter, | 63 net::URLRequestContextGetter* request_context_getter, |
64 const V4ProtocolConfig& config); | 64 const V4ProtocolConfig& config); |
65 | 65 |
66 // net::URLFetcherDelegate interface. | 66 // net::URLFetcherDelegate interface. |
67 void OnURLFetchComplete(const net::URLFetcher* source) override; | 67 void OnURLFetchComplete(const net::URLFetcher* source) override; |
68 | 68 |
69 // Retrieve the full hash for a set of prefixes, and invoke the callback | 69 // Retrieve the full hash for a set of prefixes, and invoke the callback |
70 // argument when the results are retrieved. The callback may be invoked | 70 // argument when the results are retrieved. The callback may be invoked |
71 // synchronously. | 71 // synchronously. Works with V3 data structures. |
kcarattini
2016/08/19 03:30:56
Is this method going away eventually after the cac
| |
72 virtual void GetFullHashes(const std::vector<SBPrefix>& prefixes, | 72 virtual void GetFullHashes(const std::vector<SBPrefix>& prefixes, |
73 const std::vector<PlatformType>& platforms, | 73 const std::vector<PlatformType>& platforms, |
74 ThreatType threat_type, | 74 ThreatType threat_type, |
75 FullHashCallback callback); | 75 FullHashCallback callback); |
76 | 76 |
77 // Retrieve the full hash for a set of prefixes, and invoke the callback | |
78 // argument when the results are retrieved. The callback may be invoked | |
79 // synchronously. Works with data types and structures for PVer4. | |
80 virtual void GetFullHashes(const base::hash_set<HashPrefix>& prefixes, | |
81 const PlatformTypeSet& platforms, | |
82 const ThreatEntryTypeSet& threat_entry_types, | |
83 const ThreatTypeSet& threat_types, | |
84 FullHashCallback callback); | |
85 | |
77 // Retrieve the full hash and API metadata for a set of prefixes, and invoke | 86 // Retrieve the full hash and API metadata for a set of prefixes, and invoke |
78 // the callback argument when the results are retrieved. The callback may be | 87 // the callback argument when the results are retrieved. The callback may be |
79 // invoked synchronously. | 88 // invoked synchronously. |
80 virtual void GetFullHashesWithApis(const std::vector<SBPrefix>& prefixes, | 89 virtual void GetFullHashesWithApis(const std::vector<SBPrefix>& prefixes, |
kcarattini
2016/08/19 03:30:56
Does this method need to be updated too?
| |
81 FullHashCallback callback); | 90 FullHashCallback callback); |
82 | 91 |
83 // Overrides the clock used to check the time. | 92 // Overrides the clock used to check the time. |
84 void SetClockForTests(std::unique_ptr<base::Clock> clock); | 93 void SetClockForTests(std::unique_ptr<base::Clock> clock); |
85 | 94 |
86 protected: | 95 protected: |
87 // Constructs a V4GetHashProtocolManager that issues | 96 // Constructs a V4GetHashProtocolManager that issues |
88 // network requests using |request_context_getter|. | 97 // network requests using |request_context_getter|. |
89 V4GetHashProtocolManager(net::URLRequestContextGetter* request_context_getter, | 98 V4GetHashProtocolManager(net::URLRequestContextGetter* request_context_getter, |
90 const V4ProtocolConfig& config); | 99 const V4ProtocolConfig& config); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 net::URLRequestContextGetter* request_context_getter, | 196 net::URLRequestContextGetter* request_context_getter, |
188 const V4ProtocolConfig& config) = 0; | 197 const V4ProtocolConfig& config) = 0; |
189 | 198 |
190 private: | 199 private: |
191 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); | 200 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); |
192 }; | 201 }; |
193 | 202 |
194 } // namespace safe_browsing | 203 } // namespace safe_browsing |
195 | 204 |
196 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ | 205 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ |
OLD | NEW |