summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 22:54:41 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 22:54:41 +0000
commitab926d553d2fbab7f170826afa811a253a8a65c8 (patch)
tree76c577b278544269f2ee04412b9661528d57856e /base
parent02e60209512e8013f962d33c0916613b796cad84 (diff)
downloadchromium_src-ab926d553d2fbab7f170826afa811a253a8a65c8.zip
chromium_src-ab926d553d2fbab7f170826afa811a253a8a65c8.tar.gz
chromium_src-ab926d553d2fbab7f170826afa811a253a8a65c8.tar.bz2
Deprecate PathService::Get(..., wstring*) and use FilePath instead.
I tried fixing all the Windows code but there's a *ton* of it. This change will at least prevent people from adding new code that uses the deprecated version (as that won't compile on Lin/Mac). BUG=24672 Review URL: http://codereview.chromium.org/293013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/base_paths_win.cc6
-rw-r--r--base/i18n/icu_util.cc7
-rw-r--r--base/path_service.cc2
-rw-r--r--base/path_service.h2
4 files changed, 9 insertions, 8 deletions
diff --git a/base/base_paths_win.cc b/base/base_paths_win.cc
index 89c2ff3..bc8566c 100644
--- a/base/base_paths_win.cc
+++ b/base/base_paths_win.cc
@@ -102,10 +102,8 @@ bool PathProviderWin(int key, FilePath* result) {
case base::DIR_SOURCE_ROOT:
// On Windows, unit tests execute two levels deep from the source root.
// For example: chrome/{Debug|Release}/ui_tests.exe
- PathService::Get(base::DIR_EXE, &wstring_path);
- file_util::UpOneDirectory(&wstring_path);
- file_util::UpOneDirectory(&wstring_path);
- cur = FilePath(wstring_path);
+ PathService::Get(base::DIR_EXE, &cur);
+ cur = cur.DirName().DirName();
break;
default:
return false;
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
index 6239a01..bccc1ab 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -56,12 +56,11 @@ bool Initialize() {
#if (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_SHARED)
// We expect to find the ICU data module alongside the current module.
- std::wstring data_path;
+ FilePath data_path;
PathService::Get(base::DIR_MODULE, &data_path);
- file_util::AppendToPath(&data_path,
- ASCIIToWide(ICU_UTIL_DATA_SHARED_MODULE_NAME));
+ data_path = data_path.AppendASCII(ICU_UTIL_DATA_SHARED_MODULE_NAME);
- HMODULE module = LoadLibrary(data_path.c_str());
+ HMODULE module = LoadLibrary(data_path.value().c_str());
if (!module) {
LOG(ERROR) << "Failed to load " << ICU_UTIL_DATA_SHARED_MODULE_NAME;
return false;
diff --git a/base/path_service.cc b/base/path_service.cc
index da172b3..4a4c100 100644
--- a/base/path_service.cc
+++ b/base/path_service.cc
@@ -188,6 +188,7 @@ bool PathService::Get(int key, FilePath* result) {
return true;
}
+#if defined(OS_WIN)
// static
bool PathService::Get(int key, std::wstring* result) {
// Deprecated compatibility function.
@@ -197,6 +198,7 @@ bool PathService::Get(int key, std::wstring* result) {
*result = path.ToWStringHack();
return true;
}
+#endif
bool PathService::IsOverridden(int key) {
PathData* path_data = GetPathData();
diff --git a/base/path_service.h b/base/path_service.h
index 39aaa2a..b0e51e4 100644
--- a/base/path_service.h
+++ b/base/path_service.h
@@ -26,9 +26,11 @@ class PathService {
// Returns true if the directory or file was successfully retrieved. On
// failure, 'path' will not be changed.
static bool Get(int key, FilePath* path);
+#if defined(OS_WIN)
// This version, producing a wstring, is deprecated and only kept around
// until we can fix all callers.
static bool Get(int key, std::wstring* path);
+#endif
// Overrides the path to a special directory or file. This cannot be used to
// change the value of DIR_CURRENT, but that should be obvious. Also, if the