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

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

Issue 2345573002: Each DatabaseManager gets to decide which stores to track (Closed)
Patch Set: Incorporated nparker@ feedback 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // request, and the error code, when there is. 200 // request, and the error code, when there is.
201 // |metric_name| is the name of the UMA metric to record the response code or 201 // |metric_name| is the name of the UMA metric to record the response code or
202 // error code against, |status| represents the status of the HTTP request, and 202 // error code against, |status| represents the status of the HTTP request, and
203 // |response code| represents the HTTP response code received from the server. 203 // |response code| represents the HTTP response code received from the server.
204 static void RecordHttpResponseOrErrorCode(const char* metric_name, 204 static void RecordHttpResponseOrErrorCode(const char* metric_name,
205 const net::URLRequestStatus& status, 205 const net::URLRequestStatus& status,
206 int response_code); 206 int response_code);
207 207
208 // Generate the set of FullHashes to check for |url|. 208 // Generate the set of FullHashes to check for |url|.
209 static void UrlToFullHashes(const GURL& url, 209 static void UrlToFullHashes(const GURL& url,
210 base::hash_set<FullHash>* full_hashes); 210 std::unordered_set<FullHash>* full_hashes);
211 211
212 static bool FullHashToHashPrefix(const FullHash& full_hash, 212 static bool FullHashToHashPrefix(const FullHash& full_hash,
213 PrefixSize prefix_size, 213 PrefixSize prefix_size,
214 HashPrefix* hash_prefix); 214 HashPrefix* hash_prefix);
215 215
216 static bool FullHashToSmallestHashPrefix(const FullHash& full_hash, 216 static bool FullHashToSmallestHashPrefix(const FullHash& full_hash,
217 HashPrefix* hash_prefix); 217 HashPrefix* hash_prefix);
218 218
219 static bool FullHashMatchesHashPrefix(const FullHash& full_hash, 219 static bool FullHashMatchesHashPrefix(const FullHash& full_hash,
220 const HashPrefix& hash_prefix); 220 const HashPrefix& hash_prefix);
(...skipping 58 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