diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-06 14:34:29 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-06 14:34:29 +0000 |
commit | c83d7d18704dff81e58c93b92647fb6600424e74 (patch) | |
tree | 340f9ba8ae94ae757a79ac956ccba1e06da26f57 /net/base/escape.cc | |
parent | 0b512bd7f686c74777a6c3bccf4ef9eab3aca8a9 (diff) | |
download | chromium_src-c83d7d18704dff81e58c93b92647fb6600424e74.zip chromium_src-c83d7d18704dff81e58c93b92647fb6600424e74.tar.gz chromium_src-c83d7d18704dff81e58c93b92647fb6600424e74.tar.bz2 |
net: Move more three Escape() functions into net namespace.
BUG=64263
TEST=None
R=willchan@chromium.org
Review URL: http://codereview.chromium.org/8479021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/escape.cc')
-rw-r--r-- | net/base/escape.cc | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/net/base/escape.cc b/net/base/escape.cc index 8544292..830d5c2 100644 --- a/net/base/escape.cc +++ b/net/base/escape.cc @@ -15,7 +15,7 @@ namespace { -static const char* const kHexString = "0123456789ABCDEF"; +const char kHexString[] = "0123456789ABCDEF"; inline char IntToHex(int i) { DCHECK_GE(i, 0) << i << " not a hex value"; DCHECK_LE(i, 15) << i << " not a hex value"; @@ -219,8 +219,6 @@ str EscapeForHTMLImpl(const str& input) { return result; } -} // namespace - // Everything except alphanumerics and !'()*-._~ // See RFC 2396 for the list of reserved characters. static const Charmap kQueryCharmap( @@ -232,36 +230,39 @@ static const Charmap kPathCharmap( 0xffffffffL, 0xd400002dL, 0x78000000L, 0xb8000001L, 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL); -std::string EscapePath(const std::string& path) { - return Escape(path, kPathCharmap, false); -} - // non-printable, non-7bit, and (including space) ?>=<;+'&%$#"![\]^`{|} static const Charmap kUrlEscape( 0xffffffffL, 0xf80008fdL, 0x78000001L, 0xb8000001L, 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL ); -std::string EscapeUrlEncodedData(const std::string& path, - bool use_plus) { - return Escape(path, kUrlEscape, use_plus); -} - // non-7bit static const Charmap kNonASCIICharmap( 0x00000000L, 0x00000000L, 0x00000000L, 0x00000000L, 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL); -std::string EscapeNonASCII(const std::string& input) { - return Escape(input, kNonASCIICharmap, false); -} - // Everything except alphanumerics, the reserved characters(;/?:@&=+$,) and // !'()*-._~% static const Charmap kExternalHandlerCharmap( 0xffffffffL, 0x5000080dL, 0x68000000L, 0xb8000001L, 0xffffffffL, 0xffffffffL, 0xffffffffL, 0xffffffffL); +} // namespace + +std::string EscapePath(const std::string& path) { + return Escape(path, kPathCharmap, false); +} + +std::string EscapeUrlEncodedData(const std::string& path, bool use_plus) { + return Escape(path, kUrlEscape, use_plus); +} + +namespace net { + +std::string EscapeNonASCII(const std::string& input) { + return Escape(input, kNonASCIICharmap, false); +} + std::string EscapeExternalHandlerValue(const std::string& text) { return Escape(text, kExternalHandlerCharmap, false); } @@ -270,8 +271,6 @@ void AppendEscapedCharForHTML(char c, std::string* output) { AppendEscapedCharForHTMLImpl(c, output); } -namespace net { - std::string EscapeForHTML(const std::string& input) { return EscapeForHTMLImpl(input); } |