| 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_PROTOCOL_MANAGER_UTIL_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_PROTOCOL_MANAGER_UTIL_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_PROTOCOL_MANAGER_UTIL_H_ | 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_PROTOCOL_MANAGER_UTIL_H_ |
| 7 | 7 |
| 8 // A class that implements the stateless methods used by the GetHashUpdate and | 8 // A class that implements the stateless methods used by the GetHashUpdate and |
| 9 // GetFullHash stubby calls made by Chrome using the SafeBrowsing V4 protocol. | 9 // GetFullHash stubby calls made by Chrome using the SafeBrowsing V4 protocol. |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 bool operator!=(const UpdateListIdentifier& other) const; | 82 bool operator!=(const UpdateListIdentifier& other) const; |
| 83 size_t hash() const; | 83 size_t hash() const; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 UpdateListIdentifier(); | 86 UpdateListIdentifier(); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 std::ostream& operator<<(std::ostream& os, const UpdateListIdentifier& id); | 89 std::ostream& operator<<(std::ostream& os, const UpdateListIdentifier& id); |
| 90 | 90 |
| 91 PlatformType GetCurrentPlatformType(); | 91 PlatformType GetCurrentPlatformType(); |
| 92 const UpdateListIdentifier GetChromeUrlApiId(); |
| 92 const UpdateListIdentifier GetUrlMalwareId(); | 93 const UpdateListIdentifier GetUrlMalwareId(); |
| 93 const UpdateListIdentifier GetUrlSocEngId(); | 94 const UpdateListIdentifier GetUrlSocEngId(); |
| 94 const UpdateListIdentifier GetChromeUrlApiId(); | |
| 95 | 95 |
| 96 // Represents the state of each store. | 96 // Represents the state of each store. |
| 97 typedef base::hash_map<UpdateListIdentifier, std::string> StoreStateMap; | 97 typedef base::hash_map<UpdateListIdentifier, std::string> StoreStateMap; |
| 98 | 98 |
| 99 // Sever response, parsed in vector form. | 99 // Sever response, parsed in vector form. |
| 100 typedef std::vector<std::unique_ptr<ListUpdateResponse>> ParsedServerResponse; | 100 typedef std::vector<std::unique_ptr<ListUpdateResponse>> ParsedServerResponse; |
| 101 | 101 |
| 102 // TODO(vakh): Consider using a std::pair for this. | 102 // TODO(vakh): Consider using a std::pair for this. |
| 103 // Holds the hash prefix and the store that it matched in. | 103 // Holds the hash prefix and the store that it matched in. |
| 104 struct StoreAndHashPrefix { | 104 struct StoreAndHashPrefix { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 template <> | 283 template <> |
| 284 struct hash<safe_browsing::UpdateListIdentifier> { | 284 struct hash<safe_browsing::UpdateListIdentifier> { |
| 285 std::size_t operator()(const safe_browsing::UpdateListIdentifier& id) const { | 285 std::size_t operator()(const safe_browsing::UpdateListIdentifier& id) const { |
| 286 return id.hash(); | 286 return id.hash(); |
| 287 } | 287 } |
| 288 }; | 288 }; |
| 289 } | 289 } |
| 290 | 290 |
| 291 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_PROTOCOL_MANAGER_UTIL_H_ | 291 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_PROTOCOL_MANAGER_UTIL_H_ |
| OLD | NEW |