Chromium Code Reviews| 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 <stdbool.h> | |
| 7 #include <stdint.h> | 8 #include <stdint.h> |
| 8 #include <stdlib.h> | 9 #include <stdlib.h> |
| 9 #include <string.h> | 10 #include <string.h> |
| 11 #include <ostream> | |
| 10 | 12 |
| 11 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 12 #include "base/logging.h" | 14 #include "base/logging.h" |
| 13 #include "third_party/icu/source/common/unicode/ucnv.h" | 15 #include "third_party/icu/source/common/unicode/ucnv.h" |
| 14 #include "third_party/icu/source/common/unicode/ucnv_cb.h" | 16 #include "third_party/icu/source/common/unicode/ucnv_cb.h" |
| 15 #include "third_party/icu/source/common/unicode/uidna.h" | 17 #include "third_party/icu/source/common/unicode/uidna.h" |
| 18 #include "unicode/umachine.h" | |
| 19 #include "unicode/urename.h" | |
| 20 #include "unicode/utypes.h" | |
|
Łukasz Anforowicz
2016/01/07 00:16:17
Ooops - these should be relative to Chromium root
| |
| 16 #include "url/url_canon_icu.h" | 21 #include "url/url_canon_icu.h" |
| 17 #include "url/url_canon_internal.h" // for _itoa_s | 22 #include "url/url_canon_internal.h" // for _itoa_s |
| 18 | 23 |
| 19 namespace url { | 24 namespace url { |
| 20 | 25 |
| 21 namespace { | 26 namespace { |
| 22 | 27 |
| 23 // Called when converting a character that can not be represented, this will | 28 // Called when converting a character that can not be represented, this will |
| 24 // append an escaped version of the numerical character reference for that code | 29 // append an escaped version of the numerical character reference for that code |
| 25 // point. It is of the form "Ӓ" and we will escape the non-digits to | 30 // point. It is of the form "Ӓ" and we will escape the non-digits to |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 // if necessary. | 186 // if necessary. |
| 182 if (err != U_BUFFER_OVERFLOW_ERROR || info.errors != 0) | 187 if (err != U_BUFFER_OVERFLOW_ERROR || info.errors != 0) |
| 183 return false; // Unknown error, give up. | 188 return false; // Unknown error, give up. |
| 184 | 189 |
| 185 // Not enough room in our buffer, expand. | 190 // Not enough room in our buffer, expand. |
| 186 output->Resize(output_length); | 191 output->Resize(output_length); |
| 187 } | 192 } |
| 188 } | 193 } |
| 189 | 194 |
| 190 } // namespace url | 195 } // namespace url |
| OLD | NEW |