diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-02 23:05:08 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-02 23:05:08 +0000 |
commit | 48797906a6bba708e777908049b8496035ed860f (patch) | |
tree | c3b9f76f773e92ad70e0f3352ff5d518be1b17d3 /net/base | |
parent | 2cec759bc34b3f3e7fb3a624474f8ea188a3c975 (diff) | |
download | chromium_src-48797906a6bba708e777908049b8496035ed860f.zip chromium_src-48797906a6bba708e777908049b8496035ed860f.tar.gz chromium_src-48797906a6bba708e777908049b8496035ed860f.tar.bz2 |
net: Move UnescapeURLComponent() functions into net namespace.
BUG=64263
TEST=None
R=willchan@chromium.org
Review URL: http://codereview.chromium.org/8109004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/escape.cc | 21 | ||||
-rw-r--r-- | net/base/escape.h | 4 |
2 files changed, 12 insertions, 13 deletions
diff --git a/net/base/escape.cc b/net/base/escape.cc index 893d032..3ca41f9 100644 --- a/net/base/escape.cc +++ b/net/base/escape.cc @@ -230,17 +230,6 @@ std::string EscapeExternalHandlerValue(const std::string& text) { return Escape(text, kExternalHandlerCharmap, false); } -std::string UnescapeURLComponent(const std::string& escaped_text, - UnescapeRule::Type rules) { - return UnescapeURLWithOffsetsImpl(escaped_text, rules, NULL); -} - -string16 UnescapeURLComponent(const string16& escaped_text, - UnescapeRule::Type rules) { - return UnescapeURLWithOffsetsImpl(escaped_text, rules, NULL); -} - - template <class str> void AppendEscapedCharForHTMLImpl(typename str::value_type c, str* output) { static const struct { @@ -291,6 +280,16 @@ string16 EscapeForHTML(const string16& input) { namespace net { +std::string UnescapeURLComponent(const std::string& escaped_text, + UnescapeRule::Type rules) { + return UnescapeURLWithOffsetsImpl(escaped_text, rules, NULL); +} + +string16 UnescapeURLComponent(const string16& escaped_text, + UnescapeRule::Type rules) { + return UnescapeURLWithOffsetsImpl(escaped_text, rules, NULL); +} + string16 UnescapeAndDecodeUTF8URLComponent(const std::string& text, UnescapeRule::Type rules, size_t* offset_for_adjustment) { diff --git a/net/base/escape.h b/net/base/escape.h index 1e4594c..eede454 100644 --- a/net/base/escape.h +++ b/net/base/escape.h @@ -85,6 +85,8 @@ class UnescapeRule { }; }; +namespace net { + // Unescapes |escaped_text| and returns the result. // Unescaping consists of looking for the exact pattern "%XX", where each X is // a hex digit, and converting to the character with the numerical value of @@ -100,8 +102,6 @@ NET_EXPORT std::string UnescapeURLComponent(const std::string& escaped_text, NET_EXPORT string16 UnescapeURLComponent(const string16& escaped_text, UnescapeRule::Type rules); -namespace net { - // Unescapes the given substring as a URL, and then tries to interpret the // result as being encoded as UTF-8. If the result is convertable into UTF-8, it // will be returned as converted. If it is not, the original escaped string will |