OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 code. | 5 // Utilities for the SafeBrowsing code. |
6 | 6 |
7 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 7 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
8 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 8 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
9 | 9 |
10 #include <cstring> | 10 #include <cstring> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 scoped_ptr<safe_browsing::ChunkData> chunk_data_; | 83 scoped_ptr<safe_browsing::ChunkData> chunk_data_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(SBChunkData); | 85 DISALLOW_COPY_AND_ASSIGN(SBChunkData); |
86 }; | 86 }; |
87 | 87 |
88 // Used when we get a gethash response. | 88 // Used when we get a gethash response. |
89 struct SBFullHashResult { | 89 struct SBFullHashResult { |
90 SBFullHash hash; | 90 SBFullHash hash; |
91 // TODO(shess): Refactor to allow ListType here. | 91 // TODO(shess): Refactor to allow ListType here. |
92 int list_id; | 92 int list_id; |
| 93 std::string metadata; |
93 }; | 94 }; |
94 | 95 |
95 // Caches individual response from GETHASH request. | 96 // Caches individual response from GETHASH request. |
96 struct SBCachedFullHashResult { | 97 struct SBCachedFullHashResult { |
97 SBCachedFullHashResult(); | 98 SBCachedFullHashResult(); |
98 explicit SBCachedFullHashResult(const base::Time& in_expire_after); | 99 explicit SBCachedFullHashResult(const base::Time& in_expire_after); |
99 ~SBCachedFullHashResult(); | 100 ~SBCachedFullHashResult(); |
100 | 101 |
101 base::Time expire_after; | 102 base::Time expire_after; |
102 std::vector<SBFullHashResult> full_hashes; | 103 std::vector<SBFullHashResult> full_hashes; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 GURL GeneratePhishingReportUrl(const std::string& report_page, | 220 GURL GeneratePhishingReportUrl(const std::string& report_page, |
220 const std::string& url_to_report, | 221 const std::string& url_to_report, |
221 bool is_client_side_detection); | 222 bool is_client_side_detection); |
222 | 223 |
223 SBFullHash StringToSBFullHash(const std::string& hash_in); | 224 SBFullHash StringToSBFullHash(const std::string& hash_in); |
224 std::string SBFullHashToString(const SBFullHash& hash_out); | 225 std::string SBFullHashToString(const SBFullHash& hash_out); |
225 | 226 |
226 } // namespace safe_browsing_util | 227 } // namespace safe_browsing_util |
227 | 228 |
228 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 229 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
OLD | NEW |