Chromium Code Reviews| Index: chrome/common/net/x509_certificate_model.cc |
| =================================================================== |
| --- chrome/common/net/x509_certificate_model.cc (revision 224523) |
| +++ chrome/common/net/x509_certificate_model.cc (working copy) |
| @@ -18,28 +18,7 @@ |
| input16.reserve(input.length()); |
| input16.insert(input16.end(), input.begin(), input.end()); |
| - string16 output16; |
| - output16.resize(input.length()); |
| - |
| - UErrorCode status = U_ZERO_ERROR; |
| - int output_chars = uidna_IDNToUnicode(input16.data(), input.length(), |
| - &output16[0], output16.length(), |
| - UIDNA_DEFAULT, NULL, &status); |
| - if (status == U_ZERO_ERROR) { |
| - output16.resize(output_chars); |
| - } else if (status != U_BUFFER_OVERFLOW_ERROR) { |
| - return input; |
| - } else { |
| - output16.resize(output_chars); |
| - output_chars = uidna_IDNToUnicode(input16.data(), input.length(), |
| - &output16[0], output16.length(), |
| - UIDNA_DEFAULT, NULL, &status); |
| - if (status != U_ZERO_ERROR) |
| - return input; |
| - DCHECK_EQ(static_cast<size_t>(output_chars), output16.length()); |
| - output16.resize(output_chars); // Just to be safe. |
| - } |
| - |
| + string16 output16 = IDNToUnicode(input, std::string()); |
|
Ryan Sleevi
2013/09/21 00:46:14
IWYU: include net/base/net_util.h on line 10/11
n
jungshik at Google
2013/09/23 17:54:54
Done.
Absolutely. I realized that on the way hom
|
| if (input16 == output16) |
| return input; // Input did not contain any encoded data. |
| @@ -89,5 +68,5 @@ |
| } |
| #endif // USE_NSS |
| -} // x509_certificate_model |
| +} // namespace x509_certificate_model |