summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:23:14 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:23:14 +0000
commit0da011cfec84c36f706d991ac7e3a497b9a20e4a (patch)
treec712e851515eac33cad325796fc7e425d28b45ae
parent705097651f83b400621be7bd553052636adad05a (diff)
downloadchromium_src-0da011cfec84c36f706d991ac7e3a497b9a20e4a.zip
chromium_src-0da011cfec84c36f706d991ac7e3a497b9a20e4a.tar.gz
chromium_src-0da011cfec84c36f706d991ac7e3a497b9a20e4a.tar.bz2
wstring: remove some simple uses of FromWStringHack
BUG=76112 Review URL: http://codereview.chromium.org/6695008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78247 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/test/test_file_util.h1
-rw-r--r--base/test/test_file_util_posix.cc3
-rw-r--r--base/test/test_file_util_win.cc3
-rw-r--r--chrome/app/chrome_main_win.cc3
-rw-r--r--chrome/default_plugin/plugin_database_handler.cc2
-rw-r--r--net/base/net_util_unittest.cc2
-rw-r--r--tools/memory_watcher/memory_watcher.cc3
7 files changed, 11 insertions, 6 deletions
diff --git a/base/test/test_file_util.h b/base/test/test_file_util.h
index e59456a..9b9389d 100644
--- a/base/test/test_file_util.h
+++ b/base/test/test_file_util.h
@@ -47,6 +47,7 @@ bool HasInternetZoneIdentifier(const FilePath& full_path);
// string16 elsewhere for Unicode strings, but in tests it is frequently
// convenient to be able to compare paths to literals like L"foobar".
std::wstring FilePathAsWString(const FilePath& path);
+FilePath WStringAsFilePath(const std::wstring& path);
} // namespace file_util
diff --git a/base/test/test_file_util_posix.cc b/base/test/test_file_util_posix.cc
index 430e52e..5adbcc2 100644
--- a/base/test/test_file_util_posix.cc
+++ b/base/test/test_file_util_posix.cc
@@ -113,5 +113,8 @@ bool EvictFileFromSystemCache(const FilePath& file) {
std::wstring FilePathAsWString(const FilePath& path) {
return UTF8ToWide(path.value());
}
+FilePath WStringAsFilePath(const std::wstring& path) {
+ return FilePath(WideToUTF8(path));
+}
} // namespace file_util
diff --git a/base/test/test_file_util_win.cc b/base/test/test_file_util_win.cc
index 1f20740..0159d2e 100644
--- a/base/test/test_file_util_win.cc
+++ b/base/test/test_file_util_win.cc
@@ -220,5 +220,8 @@ bool HasInternetZoneIdentifier(const FilePath& full_path) {
std::wstring FilePathAsWString(const FilePath& path) {
return path.value();
}
+FilePath WStringAsFilePath(const std::wstring& path) {
+ return FilePath(path);
+}
} // namespace file_util
diff --git a/chrome/app/chrome_main_win.cc b/chrome/app/chrome_main_win.cc
index e10ae76..82544ac 100644
--- a/chrome/app/chrome_main_win.cc
+++ b/chrome/app/chrome_main_win.cc
@@ -83,8 +83,7 @@ bool LoadUserDataDirPolicyFromRegistry(HKEY hive, FilePath* user_data_dir) {
base::win::RegKey hklm_policy_key(hive, policy::kRegistrySubKey, KEY_READ);
if (hklm_policy_key.ReadValue(key_name.c_str(), &value) == ERROR_SUCCESS) {
- *user_data_dir = FilePath::FromWStringHack(
- policy::path_parser::ExpandPathVariables(value));
+ *user_data_dir = FilePath(policy::path_parser::ExpandPathVariables(value));
return true;
}
return false;
diff --git a/chrome/default_plugin/plugin_database_handler.cc b/chrome/default_plugin/plugin_database_handler.cc
index bc2220a..e634ada 100644
--- a/chrome/default_plugin/plugin_database_handler.cc
+++ b/chrome/default_plugin/plugin_database_handler.cc
@@ -48,7 +48,7 @@ bool PluginDatabaseHandler::DownloadPluginsFileIfNeeded(
plugins_file_ = module_path.Append(L"chrome_plugins_file.xml").value();
bool initiate_download = false;
- if (!file_util::PathExists(FilePath::FromWStringHack(plugins_file_))) {
+ if (!file_util::PathExists(FilePath(plugins_file_))) {
initiate_download = true;
} else {
SYSTEMTIME creation_system_time = {0};
diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc
index 4201400..46293a3 100644
--- a/net/base/net_util_unittest.cc
+++ b/net/base/net_util_unittest.cc
@@ -513,7 +513,7 @@ TEST(NetUtilTest, FileURLConversion) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(round_trip_cases); i++) {
// convert to the file URL
GURL file_url(net::FilePathToFileURL(
- FilePath::FromWStringHack(round_trip_cases[i].file)));
+ file_util::WStringAsFilePath(round_trip_cases[i].file)));
EXPECT_EQ(round_trip_cases[i].url, file_url.spec());
// Back to the filename.
diff --git a/tools/memory_watcher/memory_watcher.cc b/tools/memory_watcher/memory_watcher.cc
index 671d2b9..77faa8b 100644
--- a/tools/memory_watcher/memory_watcher.cc
+++ b/tools/memory_watcher/memory_watcher.cc
@@ -82,8 +82,7 @@ void MemoryWatcher::CloseLogFile() {
file_ = NULL;
std::wstring tmp_name = ASCIIToWide(file_name_);
tmp_name += L".tmp";
- file_util::Move(FilePath::FromWStringHack(tmp_name),
- FilePath::FromWStringHack(ASCIIToWide(file_name_)));
+ file_util::Move(FilePath(tmp_name), FilePath(ASCIIToWide(file_name_)));
}
}