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

Side by Side Diff: url/url_canon_icu_alternatives_ios.cc

Issue 1858483002: Cronet for iOS with C API for GRPC support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@small
Patch Set: Make it syncable Created 4 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <string.h> 5 #include <string.h>
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "url/url_canon_internal.h" 11 #include "url/url_canon_internal.h"
12 12
13 namespace url { 13 namespace url {
14 14
15 // Only allow ASCII to avoid ICU dependency. Use NSString+IDN 15 // Only allow ASCII to avoid ICU dependency. Use NSString+IDN
16 // to convert non-ASCII URL prior to passing to API. 16 // to convert non-ASCII URL prior to passing to API.
17 bool IDNToASCII(const base::char16* src, int src_len, CanonOutputW* output) { 17 bool IDNToASCII(const base::char16* src, int src_len, CanonOutputW* output) {
18 if (base::IsStringASCII(base::StringPiece16(src, src_len))) { 18 if (base::IsStringASCII(base::StringPiece16(src, src_len))) {
19 output->Append(src, src_len); 19 output->Append(src, src_len);
20 return true; 20 return true;
21 } 21 }
22 DCHECK(false) << "IDN URL support is not available."; 22 DCHECK(false) << "IDN URL support is not available.";
23 return false; 23 return false;
24 } 24 }
25 25
26 } // namespace url 26 } // namespace url
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698