summaryrefslogtreecommitdiffstats
path: root/net/base/escape.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 20:39:41 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 20:39:41 +0000
commit48f619d8bd9a264f14ce4b62a935e05df015432b (patch)
tree6b62dab3f626a126ed41a80960f3dc9a417cf550 /net/base/escape.h
parent27773dfa39409674a0c319b527950369d2e82b75 (diff)
downloadchromium_src-48f619d8bd9a264f14ce4b62a935e05df015432b.zip
chromium_src-48f619d8bd9a264f14ce4b62a935e05df015432b.tar.gz
chromium_src-48f619d8bd9a264f14ce4b62a935e05df015432b.tar.bz2
Remove std::wstring from most of net/base/escape.h.
I left the one API because based on the comment, it should eventually be removed. Updated the callers to use UTF16ToWideHack until more work can be done to remove std::wstring. I also updated net/base/escape_unittest.cc to use the same hack until a proper solution can be coded. Original patch submission here: http://codereview.chromium.org/402085 Patch by Patrick Scott (phanna@android.com) R=darin BUG=23581 TEST=escape_unittest Review URL: http://codereview.chromium.org/452015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/escape.h')
-rw-r--r--net/base/escape.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/net/base/escape.h b/net/base/escape.h
index 9ff17b6..5476d9c 100644
--- a/net/base/escape.h
+++ b/net/base/escape.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/string16.h"
// Escaping --------------------------------------------------------------------
@@ -35,7 +36,7 @@ void AppendEscapedCharForHTML(char c, std::string* output);
// Escape chars that might cause this text to be interpretted as HTML tags.
std::string EscapeForHTML(const std::string& text);
-std::wstring EscapeForHTML(const std::wstring& text);
+string16 EscapeForHTML(const string16& text);
// Unescaping ------------------------------------------------------------------
@@ -95,29 +96,29 @@ std::string UnescapeURLComponent(const std::string& escaped_text,
// 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
-// be converted into a wide string and returned.
+// be converted into a string16 and returned.
//
// |offset_for_adjustment| may be NULL; if not, it is an offset into |text| that
// will be adjusted to point at the same logical place in the result string. If
// this isn't possible because it points into the middle of an escape sequence
-// or past the end of the string, it will be set to std::wstring::npos.
-std::wstring UnescapeAndDecodeUTF8URLComponent(const std::string& text,
- UnescapeRule::Type rules,
- size_t* offset_for_adjustment);
+// or past the end of the string, it will be set to string16::npos.
+string16 UnescapeAndDecodeUTF8URLComponent(const std::string& text,
+ UnescapeRule::Type rules,
+ size_t* offset_for_adjustment);
// Deprecated ------------------------------------------------------------------
// Escapes characters in text suitable for use as a query parameter value.
// We %XX everything except alphanumerics and -_.!~*'()
// This is basically the same as encodeURIComponent in javascript.
-// For the wstring version, we do a conversion to charset before encoding the
+// For the string16 version, we do a conversion to charset before encoding the
// string. If the charset doesn't exist, we return false.
//
// TODO(brettw) bug 1201094: This function should be removed. See the bug for
// why and what callers should do instead.
std::string EscapeQueryParamValue(const std::string& text);
-bool EscapeQueryParamValue(const std::wstring& text, const char* codepage,
- std::wstring* escaped);
+bool EscapeQueryParamValue(const string16& text, const char* codepage,
+ string16* escaped);
// A specialized version of EscapeQueryParamValue for wide strings that
// assumes the codepage is UTF8. This is provided as a convenience.