OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // ICU integration functions. | 5 // ICU integration functions. |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // It also closely matches what IE 10 does except for the BiDi check ( | 92 // It also closely matches what IE 10 does except for the BiDi check ( |
93 // http://goo.gl/3XBhqw ). | 93 // http://goo.gl/3XBhqw ). |
94 // See http://http://unicode.org/reports/tr46/ and references therein | 94 // See http://http://unicode.org/reports/tr46/ and references therein |
95 // for more details. | 95 // for more details. |
96 struct UIDNAWrapper { | 96 struct UIDNAWrapper { |
97 UIDNAWrapper() { | 97 UIDNAWrapper() { |
98 UErrorCode err = U_ZERO_ERROR; | 98 UErrorCode err = U_ZERO_ERROR; |
99 // TODO(jungshik): Change options as different parties (browsers, | 99 // TODO(jungshik): Change options as different parties (browsers, |
100 // registrars, search engines) converge toward a consensus. | 100 // registrars, search engines) converge toward a consensus. |
101 value = uidna_openUTS46(UIDNA_CHECK_BIDI, &err); | 101 value = uidna_openUTS46(UIDNA_CHECK_BIDI, &err); |
102 if (U_FAILURE(err)) | 102 if (U_FAILURE(err)) { |
| 103 CHECK(false) << "failed to open UTS46 data with error: " << err; |
103 value = NULL; | 104 value = NULL; |
| 105 } |
104 } | 106 } |
105 | 107 |
106 UIDNA* value; | 108 UIDNA* value; |
107 }; | 109 }; |
108 | 110 |
109 } // namespace | 111 } // namespace |
110 | 112 |
111 ICUCharsetConverter::ICUCharsetConverter(UConverter* converter) | 113 ICUCharsetConverter::ICUCharsetConverter(UConverter* converter) |
112 : converter_(converter) { | 114 : converter_(converter) { |
113 } | 115 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // if necessary. | 180 // if necessary. |
179 if (err != U_BUFFER_OVERFLOW_ERROR || info.errors != 0) | 181 if (err != U_BUFFER_OVERFLOW_ERROR || info.errors != 0) |
180 return false; // Unknown error, give up. | 182 return false; // Unknown error, give up. |
181 | 183 |
182 // Not enough room in our buffer, expand. | 184 // Not enough room in our buffer, expand. |
183 output->Resize(output_length); | 185 output->Resize(output_length); |
184 } | 186 } |
185 } | 187 } |
186 | 188 |
187 } // namespace url | 189 } // namespace url |
OLD | NEW |