Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Unified Diff: net/proxy/proxy_resolver_v8.cc

Issue 109863003: Use StringPiece for UTF string conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | ppapi/proxy/pdf_resource_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_v8.cc
diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc
index 3de1c7a9f1de3bb4df3146647bf586c41422be7e..c55a6b35c49775adcb90f5b0af23f90062252217 100644
--- a/net/proxy/proxy_resolver_v8.cc
+++ b/net/proxy/proxy_resolver_v8.cc
@@ -223,7 +223,7 @@ bool GetHostnameArgument(const v8::FunctionCallbackInfo<v8::Value>& args,
// Otherwise try to convert it from IDN to punycode.
const int kInitialBufferSize = 256;
- url_canon::RawCanonOutputT<char16, kInitialBufferSize> punycode_output;
+ url_canon::RawCanonOutputT<base::char16, kInitialBufferSize> punycode_output;
if (!url_canon::IDNToASCII(hostname_utf16.data(),
hostname_utf16.length(),
&punycode_output)) {
@@ -233,9 +233,9 @@ bool GetHostnameArgument(const v8::FunctionCallbackInfo<v8::Value>& args,
// |punycode_output| should now be ASCII; convert it to a std::string.
// (We could use UTF16ToASCII() instead, but that requires an extra string
// copy. Since ASCII is a subset of UTF8 the following is equivalent).
- bool success = UTF16ToUTF8(punycode_output.data(),
- punycode_output.length(),
- hostname);
+ bool success = base::UTF16ToUTF8(
+ base::StringPiece16(punycode_output.data(), punycode_output.length()),
+ hostname);
DCHECK(success);
DCHECK(IsStringASCII(*hostname));
return success;
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | ppapi/proxy/pdf_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698