| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // Empties the cache. | 158 // Empties the cache. |
| 159 void ClearCache(); | 159 void ClearCache(); |
| 160 | 160 |
| 161 // Retrieve the full hash for a set of prefixes, and invoke the callback | 161 // Retrieve the full hash for a set of prefixes, and invoke the callback |
| 162 // argument when the results are retrieved. The callback may be invoked | 162 // argument when the results are retrieved. The callback may be invoked |
| 163 // synchronously. | 163 // synchronously. |
| 164 virtual void GetFullHashes(const FullHashToStoreAndHashPrefixesMap& | 164 virtual void GetFullHashes(const FullHashToStoreAndHashPrefixesMap& |
| 165 full_hash_to_matching_hash_prefixes, | 165 full_hash_to_matching_hash_prefixes, |
| 166 FullHashCallback callback); | 166 FullHashCallback callback); |
| 167 | 167 |
| 168 // Retrieve the full hash and API metadata for a URL, and invoke the callback | 168 // Retrieve the full hash and API metadata for the origin of |url|, and invoke |
| 169 // argument when the results are retrieved. The callback may be invoked | 169 // the callback argument when the results are retrieved. The callback may be |
| 170 // synchronously. | 170 // invoked synchronously. |
| 171 // GetFullHashesWithApis is a special case of GetFullHashes. It is here | 171 // GetFullHashesWithApis is a special case of GetFullHashes. It is here |
| 172 // primarily for legacy reasons: so that DatabaseManager, which speaks PVer3, | 172 // primarily for legacy reasons: so that DatabaseManager, which speaks PVer3, |
| 173 // and V4LocalDatabaseManager, which speaks PVer4, can both use this class to | 173 // and V4LocalDatabaseManager, which speaks PVer4, can both use this class to |
| 174 // perform API lookups. Once PVer4 migration is complete, DatabaseManager | 174 // perform API lookups. Once PVer4 migration is complete, DatabaseManager |
| 175 // should be deleted and then this method can be moved to the | 175 // should be deleted and then this method can be moved to the |
| 176 // V4LocalDatabaseManager class. | 176 // V4LocalDatabaseManager class. |
| 177 // TODO(vakh): Move this method to V4LocalDatabaseManager after launching | 177 // TODO(vakh): Move this method to V4LocalDatabaseManager after launching |
| 178 // PVer4 in Chromium. | 178 // PVer4 in Chromium. |
| 179 virtual void GetFullHashesWithApis(const GURL& url, | 179 virtual void GetFullHashesWithApis(const GURL& url, |
| 180 ThreatMetadataForApiCallback api_callback); | 180 ThreatMetadataForApiCallback api_callback); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); | 351 DISALLOW_COPY_AND_ASSIGN(V4GetHashProtocolManagerFactory); |
| 352 }; | 352 }; |
| 353 | 353 |
| 354 #ifndef NDEBUG | 354 #ifndef NDEBUG |
| 355 std::ostream& operator<<(std::ostream& os, const FullHashInfo& id); | 355 std::ostream& operator<<(std::ostream& os, const FullHashInfo& id); |
| 356 #endif | 356 #endif |
| 357 | 357 |
| 358 } // namespace safe_browsing | 358 } // namespace safe_browsing |
| 359 | 359 |
| 360 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ | 360 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_GET_HASH_PROTOCOL_MANAGER_H_ |
| OLD | NEW |