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

Side by Side Diff: net/proxy/proxy_resolver_v8.cc

Issue 111373008: Update some uses of char16 to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_auth_handler_ntlm_portable.cc ('k') | ppapi/proxy/pdf_resource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "net/proxy/proxy_resolver_v8.h" 5 #include "net/proxy/proxy_resolver_v8.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstdio> 8 #include <cstdio>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 const base::string16 hostname_utf16 = V8StringToUTF16(args[0]->ToString()); 216 const base::string16 hostname_utf16 = V8StringToUTF16(args[0]->ToString());
217 217
218 // If the hostname is already in ASCII, simply return it as is. 218 // If the hostname is already in ASCII, simply return it as is.
219 if (IsStringASCII(hostname_utf16)) { 219 if (IsStringASCII(hostname_utf16)) {
220 *hostname = UTF16ToASCII(hostname_utf16); 220 *hostname = UTF16ToASCII(hostname_utf16);
221 return true; 221 return true;
222 } 222 }
223 223
224 // Otherwise try to convert it from IDN to punycode. 224 // Otherwise try to convert it from IDN to punycode.
225 const int kInitialBufferSize = 256; 225 const int kInitialBufferSize = 256;
226 url_canon::RawCanonOutputT<char16, kInitialBufferSize> punycode_output; 226 url_canon::RawCanonOutputT<base::char16, kInitialBufferSize> punycode_output;
227 if (!url_canon::IDNToASCII(hostname_utf16.data(), 227 if (!url_canon::IDNToASCII(hostname_utf16.data(),
228 hostname_utf16.length(), 228 hostname_utf16.length(),
229 &punycode_output)) { 229 &punycode_output)) {
230 return false; 230 return false;
231 } 231 }
232 232
233 // |punycode_output| should now be ASCII; convert it to a std::string. 233 // |punycode_output| should now be ASCII; convert it to a std::string.
234 // (We could use UTF16ToASCII() instead, but that requires an extra string 234 // (We could use UTF16ToASCII() instead, but that requires an extra string
235 // copy. Since ASCII is a subset of UTF8 the following is equivalent). 235 // copy. Since ASCII is a subset of UTF8 the following is equivalent).
236 bool success = base::UTF16ToUTF8(punycode_output.data(), 236 bool success = base::UTF16ToUTF8(punycode_output.data(),
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 return 0; 824 return 0;
825 825
826 v8::Locker locked(g_default_isolate_); 826 v8::Locker locked(g_default_isolate_);
827 v8::Isolate::Scope isolate_scope(g_default_isolate_); 827 v8::Isolate::Scope isolate_scope(g_default_isolate_);
828 v8::HeapStatistics heap_statistics; 828 v8::HeapStatistics heap_statistics;
829 g_default_isolate_->GetHeapStatistics(&heap_statistics); 829 g_default_isolate_->GetHeapStatistics(&heap_statistics);
830 return heap_statistics.used_heap_size(); 830 return heap_statistics.used_heap_size();
831 } 831 }
832 832
833 } // namespace net 833 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_ntlm_portable.cc ('k') | ppapi/proxy/pdf_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698