| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 std::string metadata; | 71 std::string metadata; |
| 72 // Used only for V4 results. The cache lifetime for this result. The response | 72 // Used only for V4 results. The cache lifetime for this result. The response |
| 73 // must not be cached for more than this duration to avoid false positives. | 73 // must not be cached for more than this duration to avoid false positives. |
| 74 base::TimeDelta cache_duration; | 74 base::TimeDelta cache_duration; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 // Caches individual response from GETHASH request. | 77 // Caches individual response from GETHASH request. |
| 78 struct SBCachedFullHashResult { | 78 struct SBCachedFullHashResult { |
| 79 SBCachedFullHashResult(); | 79 SBCachedFullHashResult(); |
| 80 explicit SBCachedFullHashResult(const base::Time& in_expire_after); | 80 explicit SBCachedFullHashResult(const base::Time& in_expire_after); |
| 81 SBCachedFullHashResult(const SBCachedFullHashResult& other); |
| 81 ~SBCachedFullHashResult(); | 82 ~SBCachedFullHashResult(); |
| 82 | 83 |
| 83 base::Time expire_after; | 84 base::Time expire_after; |
| 84 std::vector<SBFullHashResult> full_hashes; | 85 std::vector<SBFullHashResult> full_hashes; |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 // SafeBrowsing list names. | 88 // SafeBrowsing list names. |
| 88 extern const char kMalwareList[]; | 89 extern const char kMalwareList[]; |
| 89 extern const char kPhishingList[]; | 90 extern const char kPhishingList[]; |
| 90 // Binary Download list name. | 91 // Binary Download list name. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 179 |
| 179 // Given a URL, returns all the paths we need to check. | 180 // Given a URL, returns all the paths we need to check. |
| 180 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths); | 181 void GeneratePathsToCheck(const GURL& url, std::vector<std::string>* paths); |
| 181 | 182 |
| 182 // Given a URL, returns all the patterns we need to check. | 183 // Given a URL, returns all the patterns we need to check. |
| 183 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls); | 184 void GeneratePatternsToCheck(const GURL& url, std::vector<std::string>* urls); |
| 184 | 185 |
| 185 } // namespace safe_browsing | 186 } // namespace safe_browsing |
| 186 | 187 |
| 187 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ | 188 #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_ |
| OLD | NEW |