OLD | NEW |
---|---|
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 <stdint.h> | 10 #include <stdint.h> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 char full_hash[32]; | 58 char full_hash[32]; |
59 SBPrefix prefix; | 59 SBPrefix prefix; |
60 }; | 60 }; |
61 | 61 |
62 // Used when we get a gethash response. | 62 // Used when we get a gethash response. |
63 struct SBFullHashResult { | 63 struct SBFullHashResult { |
64 SBFullHash hash; | 64 SBFullHash hash; |
65 // TODO(shess): Refactor to allow ListType here. | 65 // TODO(shess): Refactor to allow ListType here. |
66 int list_id; | 66 int list_id; |
67 std::string metadata; | 67 std::string metadata; |
68 // Used only for V4 results. The cache lifetime for this result. The response | |
69 // must not be cached for more than this duration to avoid false positives. | |
70 base::TimeDelta cache_duration; | |
Nathan Parker
2016/01/11 23:50:32
How does this relate to the SBCachedFullHashResult
kcarattini
2016/01/12 00:43:34
SBCachedFullHashResult is used by the database, an
| |
68 }; | 71 }; |
69 | 72 |
70 // Caches individual response from GETHASH request. | 73 // Caches individual response from GETHASH request. |
71 struct SBCachedFullHashResult { | 74 struct SBCachedFullHashResult { |
72 SBCachedFullHashResult(); | 75 SBCachedFullHashResult(); |
73 explicit SBCachedFullHashResult(const base::Time& in_expire_after); | 76 explicit SBCachedFullHashResult(const base::Time& in_expire_after); |
74 ~SBCachedFullHashResult(); | 77 ~SBCachedFullHashResult(); |
75 | 78 |
76 base::Time expire_after; | 79 base::Time expire_after; |
77 std::vector<SBFullHashResult> full_hashes; | 80 std::vector<SBFullHashResult> full_hashes; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 | 168 |
166 // Given a URL, returns all the paths we need to check. | 169 // Given a URL, returns all the paths we need to check. |
167 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths); | 170 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths); |
168 | 171 |
169 // Given a URL, returns all the patterns we need to check. | 172 // Given a URL, returns all the patterns we need to check. |
170 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls); | 173 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls); |
171 | 174 |
172 } // namespace safe_browsing | 175 } // namespace safe_browsing |
173 | 176 |
174 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ | 177 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ |
OLD | NEW |