summaryrefslogtreecommitdiffstats
path: root/base/string_util.h
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 03:41:51 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 03:41:51 +0000
commit90f933a3b3ce799ebd2f1e04c8906ba0c6f514d9 (patch)
tree6baaad8528a0bc8cf45df75ef3dd69c60ccb99a4 /base/string_util.h
parent3a164a1633cc2c8136aa385223a8ebdbda407150 (diff)
downloadchromium_src-90f933a3b3ce799ebd2f1e04c8906ba0c6f514d9.zip
chromium_src-90f933a3b3ce799ebd2f1e04c8906ba0c6f514d9.tar.gz
chromium_src-90f933a3b3ce799ebd2f1e04c8906ba0c6f514d9.tar.bz2
Fixes Issue 7377: Regression: Omnibox trims URL ending with 0x85 (Take 2)
This is the same change as "http://codereview.chromium.org/20219/show", which I reverted it because it caused build breaks on sandbox. To investigate this build break, it seems this build break is somehow caused by "base/string_util.cc" that includes the TrimWhiteSpaceUTF8() function. To fix this build break, I moved the TrimWhiteSpaceUTF8() function to "base/string_util_icu.cc". BUG=7377 Review URL: http://codereview.chromium.org/28310 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.h')
-rw-r--r--base/string_util.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/base/string_util.h b/base/string_util.h
index 3f905fe..a688828 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -130,9 +130,13 @@ bool TrimString(const std::string& input,
std::string* output);
// Trims any whitespace from either end of the input string. Returns where
-// whitespace was found. The non-wide version of this function only looks for
-// ASCII whitespace; UTF-8 code-points are not searched for (use the wide
-// version instead).
+// whitespace was found.
+// The non-wide version has two functions:
+// * TrimWhitespaceASCII()
+// This function is for ASCII strings and only looks for ASCII whitespace;
+// * TrimWhitespaceUTF8()
+// This function is for UTF-8 strings and looks for Unicode whitespace.
+// Please choose the best one according to your usage.
// NOTE: Safe to use the same variable for both input and output.
enum TrimPositions {
TRIM_NONE = 0,
@@ -143,6 +147,15 @@ enum TrimPositions {
TrimPositions TrimWhitespace(const std::wstring& input,
TrimPositions positions,
std::wstring* output);
+TrimPositions TrimWhitespaceASCII(const std::string& input,
+ TrimPositions positions,
+ std::string* output);
+TrimPositions TrimWhitespaceUTF8(const std::string& input,
+ TrimPositions positions,
+ std::string* output);
+
+// Deprecated. This function is only for backward compatibility and calls
+// TrimWhitespaceASCII().
TrimPositions TrimWhitespace(const std::string& input,
TrimPositions positions,
std::string* output);