Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: components/safe_browsing_db/v4_protocol_manager_util.h

Issue 2349603003: V4LDBM: Get response from GetHashManager, detect severest result (Closed)
Patch Set: Add test for GetSeverestThreatTypeAndMetadata Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 template <> 280 template <>
281 struct hash<safe_browsing::UpdateListIdentifier> { 281 struct hash<safe_browsing::UpdateListIdentifier> {
282 std::size_t operator()(const safe_browsing::UpdateListIdentifier& id) const { 282 std::size_t operator()(const safe_browsing::UpdateListIdentifier& id) const {
283 return id.hash(); 283 return id.hash();
284 } 284 }
285 }; 285 };
286 } 286 }
287 287
288 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_PROTOCOL_MANAGER_UTIL_H_ 288 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_PROTOCOL_MANAGER_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698