summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 22:13:17 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 22:13:17 +0000
commit59d49aa8b39fd45a206549b7d19b4d02908af9a8 (patch)
treea05fe94babcacce1e2ee82ee4603ca49c670a612 /net
parent62fd5af1aac8b2a80bf6336a7f7a10cad1086c3e (diff)
downloadchromium_src-59d49aa8b39fd45a206549b7d19b4d02908af9a8.zip
chromium_src-59d49aa8b39fd45a206549b7d19b4d02908af9a8.tar.gz
chromium_src-59d49aa8b39fd45a206549b7d19b4d02908af9a8.tar.bz2
Cleanup: Convert net::StripWWW to string16 and fix up the callsites.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3360023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59159 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/net_util.cc4
-rw-r--r--net/base/net_util.h2
-rw-r--r--net/base/net_util_unittest.cc8
3 files changed, 7 insertions, 7 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 4dd357f..ff812eb 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1306,8 +1306,8 @@ std::string GetDirectoryListingEntry(const string16& name,
return result;
}
-std::wstring StripWWW(const std::wstring& text) {
- const std::wstring www(L"www.");
+string16 StripWWW(const string16& text) {
+ const string16 www(ASCIIToUTF16("www."));
return (text.compare(0, www.length(), www) == 0) ?
text.substr(www.length()) : text;
}
diff --git a/net/base/net_util.h b/net/base/net_util.h
index af3bd0a..f5a6151 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -233,7 +233,7 @@ std::string GetDirectoryListingEntry(const string16& name,
// If text starts with "www." it is removed, otherwise text is returned
// unmodified.
-std::wstring StripWWW(const std::wstring& text);
+string16 StripWWW(const string16& text);
// Gets the filename from the raw Content-Disposition header (as read from the
// network). Otherwise uses the last path component name or hostname from
diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc
index 4975a68..fdf5f07 100644
--- a/net/base/net_util_unittest.cc
+++ b/net/base/net_util_unittest.cc
@@ -912,10 +912,10 @@ TEST(NetUtilTest, CompliantHost) {
}
TEST(NetUtilTest, StripWWW) {
- EXPECT_EQ(L"", net::StripWWW(L""));
- EXPECT_EQ(L"", net::StripWWW(L"www."));
- EXPECT_EQ(L"blah", net::StripWWW(L"www.blah"));
- EXPECT_EQ(L"blah", net::StripWWW(L"blah"));
+ EXPECT_EQ(string16(), net::StripWWW(string16()));
+ EXPECT_EQ(string16(), net::StripWWW(ASCIIToUTF16("www.")));
+ EXPECT_EQ(ASCIIToUTF16("blah"), net::StripWWW(ASCIIToUTF16("www.blah")));
+ EXPECT_EQ(ASCIIToUTF16("blah"), net::StripWWW(ASCIIToUTF16("blah")));
}
TEST(NetUtilTest, GetSuggestedFilename) {