OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 // Frees the entry's memory. | 151 // Frees the entry's memory. |
152 void Destroy(); | 152 void Destroy(); |
153 | 153 |
154 void set_list_id(int list_id) { data_.list_id = list_id; } | 154 void set_list_id(int list_id) { data_.list_id = list_id; } |
155 int list_id() const { return data_.list_id; } | 155 int list_id() const { return data_.list_id; } |
156 void set_chunk_id(int chunk_id) { data_.chunk_id = chunk_id; } | 156 void set_chunk_id(int chunk_id) { data_.chunk_id = chunk_id; } |
157 int chunk_id() const { return data_.chunk_id; } | 157 int chunk_id() const { return data_.chunk_id; } |
158 int prefix_count() const { return data_.prefix_count; } | 158 int prefix_count() const { return data_.prefix_count; } |
159 | 159 |
160 // Returns a new entry that is larger by the given number of prefixes, with | |
161 // all the existing data already copied over. The old entry is destroyed. | |
162 SBEntry* Enlarge(int extra_prefixes); | |
163 | |
164 // Returns true if this is a prefix as opposed to a full hash. | 160 // Returns true if this is a prefix as opposed to a full hash. |
165 bool IsPrefix() const { | 161 bool IsPrefix() const { |
166 return type() == ADD_PREFIX || type() == SUB_PREFIX; | 162 return type() == ADD_PREFIX || type() == SUB_PREFIX; |
167 } | 163 } |
168 | 164 |
169 // Returns true if this is an add entry. | 165 // Returns true if this is an add entry. |
170 bool IsAdd() const { | 166 bool IsAdd() const { |
171 return type() == ADD_PREFIX || type() == ADD_FULL_HASH; | 167 return type() == ADD_PREFIX || type() == ADD_FULL_HASH; |
172 } | 168 } |
173 | 169 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 const std::string& mac, | 304 const std::string& mac, |
309 const char* data, | 305 const char* data, |
310 int data_length); | 306 int data_length); |
311 | 307 |
312 GURL GeneratePhishingReportUrl(const std::string& report_page, | 308 GURL GeneratePhishingReportUrl(const std::string& report_page, |
313 const std::string& url_to_report); | 309 const std::string& url_to_report); |
314 | 310 |
315 } // namespace safe_browsing_util | 311 } // namespace safe_browsing_util |
316 | 312 |
317 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 313 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
OLD | NEW |