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

Unified Diff: url/url_canon_icu_alternatives_ios.mm

Issue 1839803002: Remove net & url small, iOS ICU alternatives, unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed GN on iOS Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« net/net.gyp ('K') | « url/url.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_icu_alternatives_ios.mm
diff --git a/url/url_canon_icu_alternatives_ios.mm b/url/url_canon_icu_alternatives_ios.mm
new file mode 100644
index 0000000000000000000000000000000000000000..4f0d8da8ba6925130997a93706a8e1ef1e0e94f9
--- /dev/null
+++ b/url/url_canon_icu_alternatives_ios.mm
@@ -0,0 +1,26 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string.h>
+
+#include "base/strings/string16.h"
+#include "base/strings/string_piece.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
+#include "url/url_canon_internal.h"
+
+namespace url {
+
+// Only allow ASCII in Cronet on iOS to avoid ICU dependency. Use NSString+IDN
xunjieli 2016/03/31 13:59:41 Can we be more general and not mention Cronet in t
kapishnikov 2016/03/31 16:25:52 Done.
+// to convert non-ASCII URL prior to passing to API.
+bool IDNToASCII(const base::char16* src, int src_len, CanonOutputW* output) {
+ if (base::IsStringASCII(base::StringPiece16(src, src_len))) {
+ output->Append(src, src_len);
+ return true;
+ }
+ DCHECK(false) << "IDN URL support is not available.";
+ return false;
+}
+
+} // namespace url
« net/net.gyp ('K') | « url/url.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698