From d13701900a71240fe1b4074b778133ba9a3461e9 Mon Sep 17 00:00:00 2001 From: "mmentovai@google.com" Date: Wed, 27 Aug 2008 20:57:35 +0000 Subject: Move std::string16 to base::string16. Don't pollute the std namespace. Don't assume that all string types can be represented as std::basic_string. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1464 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/net_util.cc | 6 +++--- net/base/net_util_unittest.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'net') diff --git a/net/base/net_util.cc b/net/base/net_util.cc index c558787..df012a2 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -568,7 +568,7 @@ bool IsIDNComponentSafe(const char16* str, void IDNToUnicodeOneComponent(const char16* comp, int comp_len, const std::wstring& languages, - std::string16* out) { + string16* out) { DCHECK(comp_len >= 0); if (comp_len == 0) return; @@ -696,12 +696,12 @@ void IDNToUnicode(const char* host, const std::wstring& languages, std::wstring* out) { // Convert the ASCII input to a wide string for ICU. - std::string16 input16; + string16 input16; input16.reserve(host_len); for (int i = 0; i < host_len; i++) input16.push_back(host[i]); - std::string16 out16; + string16 out16; // The output string is appended to, so convert what's already there if // needed. #if defined(WCHAR_T_IS_UTF32) diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc index 40dce3a..94017fc 100644 --- a/net/base/net_util_unittest.cc +++ b/net/base/net_util_unittest.cc @@ -124,7 +124,7 @@ TEST(NetUtilTest, FileURLConversion) { #endif }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(url_cases); i++) { - net::FileURLToFilePath(GURL(WideToUTF16(url_cases[i].url)), &output); + net::FileURLToFilePath(GURL(WideToUTF8(url_cases[i].url)), &output); EXPECT_EQ(std::wstring(url_cases[i].file), output); } @@ -137,7 +137,7 @@ TEST(NetUtilTest, FileURLConversion) { #elif defined(OS_POSIX) const wchar_t wide[] = L"/d:/Chinese/\xe6\x89\x80\xe6\x9c\x89\xe4\xb8\xad\xe6\x96\x87\xe7\xbd\x91\xe9\xa1\xb5.doc"; #endif - EXPECT_TRUE(net::FileURLToFilePath(GURL(WideToUTF16(utf8)), &output)); + EXPECT_TRUE(net::FileURLToFilePath(GURL(WideToUTF8(utf8)), &output)); EXPECT_EQ(std::wstring(wide), output); // Unfortunately, UTF8ToWide discards invalid UTF8 input. -- cgit v1.1