| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 GURL GeneratePhishingReportUrl(const std::string& report_page, | 217 GURL GeneratePhishingReportUrl(const std::string& report_page, |
| 217 const std::string& url_to_report, | 218 const std::string& url_to_report, |
| 218 bool is_client_side_detection); | 219 bool is_client_side_detection); |
| 219 | 220 |
| 220 SBFullHash StringToSBFullHash(const std::string& hash_in); | 221 SBFullHash StringToSBFullHash(const std::string& hash_in); |
| 221 std::string SBFullHashToString(const SBFullHash& hash_out); | 222 std::string SBFullHashToString(const SBFullHash& hash_out); |
| 222 | 223 |
| 223 } // namespace safe_browsing_util | 224 } // namespace safe_browsing_util |
| 224 | 225 |
| 225 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 226 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
| OLD | NEW |