| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // http://goo.gl/3XBhqw ). | 94 // http://goo.gl/3XBhqw ). |
| 95 // See http://http://unicode.org/reports/tr46/ and references therein | 95 // See http://http://unicode.org/reports/tr46/ and references therein |
| 96 // for more details. | 96 // for more details. |
| 97 struct UIDNAWrapper { | 97 struct UIDNAWrapper { |
| 98 UIDNAWrapper() { | 98 UIDNAWrapper() { |
| 99 UErrorCode err = U_ZERO_ERROR; | 99 UErrorCode err = U_ZERO_ERROR; |
| 100 // TODO(jungshik): Change options as different parties (browsers, | 100 // TODO(jungshik): Change options as different parties (browsers, |
| 101 // registrars, search engines) converge toward a consensus. | 101 // registrars, search engines) converge toward a consensus. |
| 102 value = uidna_openUTS46(UIDNA_CHECK_BIDI, &err); | 102 value = uidna_openUTS46(UIDNA_CHECK_BIDI, &err); |
| 103 if (U_FAILURE(err)) { | 103 if (U_FAILURE(err)) { |
| 104 CHECK(false) << "failed to open UTS46 data with error: " << err; | 104 // Failed to open UTS46 data with error. |
| 105 CHECK(false); |
| 105 value = NULL; | 106 value = NULL; |
| 106 } | 107 } |
| 107 } | 108 } |
| 108 | 109 |
| 109 UIDNA* value; | 110 UIDNA* value; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 } // namespace | 113 } // namespace |
| 113 | 114 |
| 114 ICUCharsetConverter::ICUCharsetConverter(UConverter* converter) | 115 ICUCharsetConverter::ICUCharsetConverter(UConverter* converter) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // if necessary. | 182 // if necessary. |
| 182 if (err != U_BUFFER_OVERFLOW_ERROR || info.errors != 0) | 183 if (err != U_BUFFER_OVERFLOW_ERROR || info.errors != 0) |
| 183 return false; // Unknown error, give up. | 184 return false; // Unknown error, give up. |
| 184 | 185 |
| 185 // Not enough room in our buffer, expand. | 186 // Not enough room in our buffer, expand. |
| 186 output->Resize(output_length); | 187 output->Resize(output_length); |
| 187 } | 188 } |
| 188 } | 189 } |
| 189 | 190 |
| 190 } // namespace url | 191 } // namespace url |
| OLD | NEW |