summaryrefslogtreecommitdiffstats
path: root/base/string_util.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 18:26:11 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 18:26:11 +0000
commitef122393f32e86fb5312d373136d99de62274bf8 (patch)
tree645665e7b050dc4810032d7d13ff03a8c45fb53c /base/string_util.h
parenta6c898d9732a133867229811c43e88274898d93f (diff)
downloadchromium_src-ef122393f32e86fb5312d373136d99de62274bf8.zip
chromium_src-ef122393f32e86fb5312d373136d99de62274bf8.tar.gz
chromium_src-ef122393f32e86fb5312d373136d99de62274bf8.tar.bz2
This CL addresses 2 issues:
- we were not computing the max request text size correctly in some cases (by forgetting the size of the &q= string) causing assertions. - the translate server might send inconsistent response in some cases, this CL makes sure we deal with them. A common case is when sending separators only strings, which we are not doing now anymore. Other more complicated case are less clear. BUG=35055 TEST=Visit www.spiegel.de and translate the page. The page should be translated correctly. Review URL: http://codereview.chromium.org/594023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38637 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.h')
-rw-r--r--base/string_util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/string_util.h b/base/string_util.h
index 60f4f25..9e0da1e 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -217,6 +217,13 @@ std::string CollapseWhitespaceASCII(const std::string& text,
bool ContainsOnlyWhitespaceASCII(const std::string& str);
bool ContainsOnlyWhitespace(const string16& str);
+// Returns true if |input| is empty or contains only characters found in
+// |characters|.
+bool ContainsOnlyChars(const std::wstring& input,
+ const std::wstring& characters);
+bool ContainsOnlyChars(const string16& input, const string16& characters);
+bool ContainsOnlyChars(const std::string& input, const std::string& characters);
+
// These convert between ASCII (7-bit) and Wide/UTF16 strings.
std::string WideToASCII(const std::wstring& wide);
std::wstring ASCIIToWide(const base::StringPiece& ascii);