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

Unified Diff: net/base/escape.cc

Issue 747773002: Upstream "nsurl_util.{h,mm}" from Chrome on iOS repository. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from mmenke. Created 6 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
Index: net/base/escape.cc
diff --git a/net/base/escape.cc b/net/base/escape.cc
index 7a068f87ee571ce555d5f063b7a0101ef280d1de..63e5be9e3391165cd4ea5e54153349b848d7a0d2 100644
--- a/net/base/escape.cc
+++ b/net/base/escape.cc
@@ -318,6 +318,12 @@ static const Charmap kPathCharmap = {{
0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL
}};
+// non-printable, non-7bit, and (including space) "#%<>[\]^`{|}
+static const Charmap kNSURLCharmap = {{
+ 0xffffffffL, 0x5000002dL, 0x78000000L, 0xb8000001L,
+ 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL
+}};
+
// non-printable, non-7bit, and (including space) ?>=<;+'&%$#"![\]^`{|}
static const Charmap kUrlEscape = {{
0xffffffffL, 0xf80008fdL, 0x78000001L, 0xb8000001L,
@@ -347,6 +353,10 @@ std::string EscapePath(const std::string& path) {
return Escape(path, kPathCharmap, false);
}
+std::string EscapeNSURLPrecursor(const std::string& precursor) {
+ return Escape(precursor, kNSURLCharmap, false, true);
+}
+
std::string EscapeUrlEncodedData(const std::string& path, bool use_plus) {
return Escape(path, kUrlEscape, use_plus);
}

Powered by Google App Engine
This is Rietveld 408576698