diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-24 21:01:40 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-24 21:01:40 +0000 |
commit | 883844f40f19b80880e0730a8e2836e6383d1400 (patch) | |
tree | 5b3204961a403e7396fe48b45930b5b6528839f0 /base | |
parent | c5884ad724ec7303e0cac77622607cf0160b5bd0 (diff) | |
download | chromium_src-883844f40f19b80880e0730a8e2836e6383d1400.zip chromium_src-883844f40f19b80880e0730a8e2836e6383d1400.tar.gz chromium_src-883844f40f19b80880e0730a8e2836e6383d1400.tar.bz2 |
Revert 184353
> Move WideToASCII to the base namespace.
>
> I accidentally changed some callers to use "base::" for this call. Since the
> plan is to move this to the base namespace eventually, I went ahead and added
> it with a "using" (to keep the non-converted code compiling) rather than revert
> my other changes.
>
> TBR=sky
> Review URL: https://codereview.chromium.org/12330103
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/12326094
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/string_util.cc | 8 | ||||
-rw-r--r-- | base/string_util.h | 6 |
2 files changed, 2 insertions, 12 deletions
diff --git a/base/string_util.cc b/base/string_util.cc index efc15f3..91a1c4c 100644 --- a/base/string_util.cc +++ b/base/string_util.cc @@ -415,20 +415,16 @@ bool ContainsOnlyChars(const std::string& input, return ContainsOnlyCharsT(input, characters); } -namespace base { - std::string WideToASCII(const std::wstring& wide) { - DCHECK(IsStringASCII(wide)) << WideToUTF8(wide); + DCHECK(IsStringASCII(wide)) << wide; return std::string(wide.begin(), wide.end()); } std::string UTF16ToASCII(const string16& utf16) { - DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16); + DCHECK(IsStringASCII(utf16)) << utf16; return std::string(utf16.begin(), utf16.end()); } -} // namespace base - // Latin1 is just the low range of Unicode, so we can copy directly to convert. bool WideToLatin1(const std::wstring& wide, std::string* latin1) { std::string output; diff --git a/base/string_util.h b/base/string_util.h index b9301c6..367eaa8 100644 --- a/base/string_util.h +++ b/base/string_util.h @@ -275,14 +275,8 @@ BASE_EXPORT bool ContainsOnlyChars(const std::string& input, // Converts to 7-bit ASCII by truncating. The result must be known to be ASCII // beforehand. -namespace base { BASE_EXPORT std::string WideToASCII(const std::wstring& wide); BASE_EXPORT std::string UTF16ToASCII(const string16& utf16); -} // namespace base -// TODO(brettw) convert this entier file to using the base namespace and remove -// this using. -using base::WideToASCII; -using base::UTF16ToASCII; // Converts the given wide string to the corresponding Latin1. This will fail // (return false) if any characters are more than 255. |