| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <cstring> | 11 #include <cstring> |
| 12 #include <deque> | 12 #include <deque> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "chrome/browser/safe_browsing/chunk_range.h" | 17 #include "chrome/browser/safe_browsing/chunk_range.h" |
| 18 | 18 |
| 19 class GURL; | 19 class GURL; |
| 20 | 20 |
| 21 class SBEntry; | 21 class SBEntry; |
| 22 | 22 |
| 23 // A truncated hash's type. | 23 // A truncated hash's type. |
| 24 typedef int SBPrefix; | 24 typedef int32 SBPrefix; |
| 25 | 25 |
| 26 // Container for holding a chunk URL and the MAC of the contents of the URL. | 26 // Container for holding a chunk URL and the MAC of the contents of the URL. |
| 27 struct ChunkUrl { | 27 struct ChunkUrl { |
| 28 std::string url; | 28 std::string url; |
| 29 std::string mac; | 29 std::string mac; |
| 30 std::string list_name; | 30 std::string list_name; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 // A full hash. | 33 // A full hash. |
| 34 union SBFullHash { | 34 union SBFullHash { |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 int data_length); | 317 int data_length); |
| 318 | 318 |
| 319 GURL GeneratePhishingReportUrl(const std::string& report_page, | 319 GURL GeneratePhishingReportUrl(const std::string& report_page, |
| 320 const std::string& url_to_report); | 320 const std::string& url_to_report); |
| 321 | 321 |
| 322 void StringToSBFullHash(const std::string& hash_in, SBFullHash* hash_out); | 322 void StringToSBFullHash(const std::string& hash_in, SBFullHash* hash_out); |
| 323 std::string SBFullHashToString(const SBFullHash& hash_out); | 323 std::string SBFullHashToString(const SBFullHash& hash_out); |
| 324 } // namespace safe_browsing_util | 324 } // namespace safe_browsing_util |
| 325 | 325 |
| 326 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 326 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
| OLD | NEW |