OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
6 | 6 |
7 #include "base/hmac.h" | 7 #include "base/hmac.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/sha2.h" | 9 #include "base/sha2.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 while (!chunks->front().hosts.empty()) { | 186 while (!chunks->front().hosts.empty()) { |
187 chunks->front().hosts.front().entry->Destroy(); | 187 chunks->front().hosts.front().entry->Destroy(); |
188 chunks->front().hosts.pop_front(); | 188 chunks->front().hosts.pop_front(); |
189 } | 189 } |
190 chunks->pop_front(); | 190 chunks->pop_front(); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 GURL GeneratePhishingReportUrl(const std::string& report_page, | 194 GURL GeneratePhishingReportUrl(const std::string& report_page, |
195 const std::string& url_to_report) { | 195 const std::string& url_to_report) { |
196 Locale locale = Locale::getDefault(); | 196 icu::Locale locale = icu::Locale::getDefault(); |
197 const char* lang = locale.getLanguage(); | 197 const char* lang = locale.getLanguage(); |
198 if (!lang) | 198 if (!lang) |
199 lang = "en"; // fallback | 199 lang = "en"; // fallback |
200 const std::string continue_esc = | 200 const std::string continue_esc = |
201 EscapeQueryParamValue(StringPrintf(kContinueUrlFormat, lang)); | 201 EscapeQueryParamValue(StringPrintf(kContinueUrlFormat, lang)); |
202 const std::string current_esc = EscapeQueryParamValue(url_to_report); | 202 const std::string current_esc = EscapeQueryParamValue(url_to_report); |
203 const std::string format = report_page + kReportParams; | 203 const std::string format = report_page + kReportParams; |
204 GURL report_url(StringPrintf(format.c_str(), | 204 GURL report_url(StringPrintf(format.c_str(), |
205 continue_esc.c_str(), | 205 continue_esc.c_str(), |
206 current_esc.c_str())); | 206 current_esc.c_str())); |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 630 |
631 // Validate that the next entry is wholly contained inside of |data_|. | 631 // Validate that the next entry is wholly contained inside of |data_|. |
632 const char* end = data_.get() + size_; | 632 const char* end = data_.get() + size_; |
633 if (next + SBEntry::kMinSize <= end && next + next_entry->Size() <= end) { | 633 if (next + SBEntry::kMinSize <= end && next + next_entry->Size() <= end) { |
634 *entry = next_entry; | 634 *entry = next_entry; |
635 return true; | 635 return true; |
636 } | 636 } |
637 | 637 |
638 return false; | 638 return false; |
639 } | 639 } |
OLD | NEW |