Chromium Code Reviews| 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 #include "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 UErrorCode status = U_ZERO_ERROR; | 195 UErrorCode status = U_ZERO_ERROR; |
| 196 #ifdef U_WCHAR_IS_UTF16 | 196 #ifdef U_WCHAR_IS_UTF16 |
| 197 icu::UnicodeSet dangerous_characters(icu::UnicodeString( | 197 icu::UnicodeSet dangerous_characters(icu::UnicodeString( |
| 198 L"[[\\ \u00ad\u00bc\u00bd\u01c3\u0337\u0338" | 198 L"[[\\ \u00ad\u00bc\u00bd\u01c3\u0337\u0338" |
| 199 L"\u05c3\u05f4\u06d4\u0702\u115f\u1160][\u2000-\u200b]" | 199 L"\u05c3\u05f4\u06d4\u0702\u115f\u1160][\u2000-\u200b]" |
| 200 L"[\u2024\u2027\u2028\u2029\u2039\u203a\u2044\u205f]" | 200 L"[\u2024\u2027\u2028\u2029\u2039\u203a\u2044\u205f]" |
| 201 L"[\u2154-\u2156][\u2159-\u215b][\u215f\u2215\u23ae" | 201 L"[\u2154-\u2156][\u2159-\u215b][\u215f\u2215\u23ae" |
| 202 L"\u29f6\u29f8\u2afb\u2afd][\u2ff0-\u2ffb][\u3014" | 202 L"\u29f6\u29f8\u2afb\u2afd][\u2ff0-\u2ffb][\u3014" |
| 203 L"\u3015\u3033\u3164\u321d\u321e\u33ae\u33af\u33c6\u33df\ufe14" | 203 L"\u3015\u3033\u3164\u321d\u321e\u33ae\u33af\u33c6\u33df\ufe14" |
| 204 L"\ufe15\ufe3f\ufe5d\ufe5e\ufeff\uff0e\uff06\uff61\uffa0\ufff9]" | 204 L"\ufe15\ufe3f\ufe5d\ufe5e\ufeff\uff0e\uff06\uff61\uffa0\ufff9]" |
| 205 L"[\ufffa-\ufffd]]"), status); | 205 L"[\ufffa-\ufffd]\ud83d\udd0f\ud83d\udd10\ud83d\udd12\ud83d\udd13]"), |
| 206 status); | |
|
mmenke
2015/06/05 15:08:06
status is indented strangely here - should just li
Matt Giuca
2015/06/09 04:10:34
Lining up with the previous L is incorrect (it wou
| |
| 206 DCHECK(U_SUCCESS(status)); | 207 DCHECK(U_SUCCESS(status)); |
| 207 icu::RegexMatcher dangerous_patterns(icu::UnicodeString( | 208 icu::RegexMatcher dangerous_patterns(icu::UnicodeString( |
| 208 // Lone katakana no, so, or n | 209 // Lone katakana no, so, or n |
| 209 L"[^\\p{Katakana}][\u30ce\u30f3\u30bd][^\\p{Katakana}]" | 210 L"[^\\p{Katakana}][\u30ce\u30f3\u30bd][^\\p{Katakana}]" |
| 210 // Repeating Japanese accent characters | 211 // Repeating Japanese accent characters |
| 211 L"|[\u3099\u309a\u309b\u309c][\u3099\u309a\u309b\u309c]"), | 212 L"|[\u3099\u309a\u309b\u309c][\u3099\u309a\u309b\u309c]"), |
| 212 0, status); | 213 0, status); |
| 213 #else | 214 #else |
| 214 icu::UnicodeSet dangerous_characters(icu::UnicodeString( | 215 icu::UnicodeSet dangerous_characters(icu::UnicodeString( |
| 215 "[[\\u0020\\u00ad\\u00bc\\u00bd\\u01c3\\u0337\\u0338" | 216 "[[\\u0020\\u00ad\\u00bc\\u00bd\\u01c3\\u0337\\u0338" |
| 216 "\\u05c3\\u05f4\\u06d4\\u0702\\u115f\\u1160][\\u2000-\\u200b]" | 217 "\\u05c3\\u05f4\\u06d4\\u0702\\u115f\\u1160][\\u2000-\\u200b]" |
| 217 "[\\u2024\\u2027\\u2028\\u2029\\u2039\\u203a\\u2044\\u205f]" | 218 "[\\u2024\\u2027\\u2028\\u2029\\u2039\\u203a\\u2044\\u205f]" |
| 218 "[\\u2154-\\u2156][\\u2159-\\u215b][\\u215f\\u2215\\u23ae" | 219 "[\\u2154-\\u2156][\\u2159-\\u215b][\\u215f\\u2215\\u23ae" |
| 219 "\\u29f6\\u29f8\\u2afb\\u2afd][\\u2ff0-\\u2ffb][\\u3014" | 220 "\\u29f6\\u29f8\\u2afb\\u2afd][\\u2ff0-\\u2ffb][\\u3014" |
| 220 "\\u3015\\u3033\\u3164\\u321d\\u321e\\u33ae\\u33af\\u33c6\\u33df\\ufe14" | 221 "\\u3015\\u3033\\u3164\\u321d\\u321e\\u33ae\\u33af\\u33c6\\u33df\\ufe14" |
| 221 "\\ufe15\\ufe3f\\ufe5d\\ufe5e\\ufeff\\uff0e\\uff06\\uff61\\uffa0\\ufff9]" | 222 "\\ufe15\\ufe3f\\ufe5d\\ufe5e\\ufeff\\uff0e\\uff06\\uff61\\uffa0\\ufff9]" |
| 222 "[\\ufffa-\\ufffd]]", -1, US_INV), status); | 223 "[\\ufffa-\\ufffd]\\ud83d\\udd0f\\ud83d\\udd10\\ud83d\\udd12" |
| 224 "\\ud83d\\udd13]", -1, US_INV), status); | |
| 223 DCHECK(U_SUCCESS(status)); | 225 DCHECK(U_SUCCESS(status)); |
| 224 icu::RegexMatcher dangerous_patterns(icu::UnicodeString( | 226 icu::RegexMatcher dangerous_patterns(icu::UnicodeString( |
| 225 // Lone katakana no, so, or n | 227 // Lone katakana no, so, or n |
| 226 "[^\\p{Katakana}][\\u30ce\\u30f3\\u30bd][^\\p{Katakana}]" | 228 "[^\\p{Katakana}][\\u30ce\\u30f3\\u30bd][^\\p{Katakana}]" |
| 227 // Repeating Japanese accent characters | 229 // Repeating Japanese accent characters |
| 228 "|[\\u3099\\u309a\\u309b\\u309c][\\u3099\\u309a\\u309b\\u309c]"), | 230 "|[\\u3099\\u309a\\u309b\\u309c][\\u3099\\u309a\\u309b\\u309c]"), |
| 229 0, status); | 231 0, status); |
| 230 #endif | 232 #endif |
| 231 DCHECK(U_SUCCESS(status)); | 233 DCHECK(U_SUCCESS(status)); |
| 232 icu::UnicodeSet component_characters; | 234 icu::UnicodeSet component_characters; |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 823 if (offset_for_adjustment) | 825 if (offset_for_adjustment) |
| 824 offsets.push_back(*offset_for_adjustment); | 826 offsets.push_back(*offset_for_adjustment); |
| 825 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, | 827 base::string16 result = FormatUrlWithOffsets(url, languages, format_types, |
| 826 unescape_rules, new_parsed, prefix_end, &offsets); | 828 unescape_rules, new_parsed, prefix_end, &offsets); |
| 827 if (offset_for_adjustment) | 829 if (offset_for_adjustment) |
| 828 *offset_for_adjustment = offsets[0]; | 830 *offset_for_adjustment = offsets[0]; |
| 829 return result; | 831 return result; |
| 830 } | 832 } |
| 831 | 833 |
| 832 } // namespace net | 834 } // namespace net |
| OLD | NEW |