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

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

Issue 1556613002: Adds SB V4 response handler to Protocol Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@osb-pm-1
Patch Set: Created 4 years, 11 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 // Utilities for the SafeBrowsing DB code. 5 // Utilities for the SafeBrowsing DB code.
6 6
7 #ifndef COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ 7 #ifndef COMPONENTS_SAFE_BROWSING_DB_UTIL_H_
8 #define COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ 8 #define COMPONENTS_SAFE_BROWSING_DB_UTIL_H_
9 9
10 #include <cstring> 10 #include <cstring>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 char full_hash[32]; 57 char full_hash[32];
58 SBPrefix prefix; 58 SBPrefix prefix;
59 }; 59 };
60 60
61 // Used when we get a gethash response. 61 // Used when we get a gethash response.
62 struct SBFullHashResult { 62 struct SBFullHashResult {
63 SBFullHash hash; 63 SBFullHash hash;
64 // TODO(shess): Refactor to allow ListType here. 64 // TODO(shess): Refactor to allow ListType here.
65 int list_id; 65 int list_id;
66 std::string metadata; 66 std::string metadata;
67 // Used only for V4 results.
awoz 2015/12/30 18:23:13 Can you briefly explain how this duration is used?
kcarattini 2016/01/04 00:52:01 Done.
68 base::TimeDelta cache_duration;
67 }; 69 };
68 70
69 // Caches individual response from GETHASH request. 71 // Caches individual response from GETHASH request.
70 struct SBCachedFullHashResult { 72 struct SBCachedFullHashResult {
71 SBCachedFullHashResult(); 73 SBCachedFullHashResult();
72 explicit SBCachedFullHashResult(const base::Time& in_expire_after); 74 explicit SBCachedFullHashResult(const base::Time& in_expire_after);
73 ~SBCachedFullHashResult(); 75 ~SBCachedFullHashResult();
74 76
75 base::Time expire_after; 77 base::Time expire_after;
76 std::vector<SBFullHashResult> full_hashes; 78 std::vector<SBFullHashResult> full_hashes;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 166
165 // Given a URL, returns all the paths we need to check. 167 // Given a URL, returns all the paths we need to check.
166 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths); 168 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths);
167 169
168 // Given a URL, returns all the patterns we need to check. 170 // Given a URL, returns all the patterns we need to check.
169 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls); 171 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls);
170 172
171 } // namespace safe_browsing 173 } // namespace safe_browsing
172 174
173 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ 175 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698