diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-19 16:50:03 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-19 16:50:03 +0000 |
commit | 4792a2655593ad5fcb436f8b88184540c570a46e (patch) | |
tree | 11d176cb8cbc9f32c79a91433193eb0c7ab018b7 /base/path_service.cc | |
parent | aa075e7d76093df41e33c6866c48080f49daedbd (diff) | |
download | chromium_src-4792a2655593ad5fcb436f8b88184540c570a46e.zip chromium_src-4792a2655593ad5fcb436f8b88184540c570a46e.tar.gz chromium_src-4792a2655593ad5fcb436f8b88184540c570a46e.tar.bz2 |
Move more code to using FilePath.
Review URL: http://codereview.chromium.org/11252
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5679 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/path_service.cc')
-rw-r--r-- | base/path_service.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/base/path_service.cc b/base/path_service.cc index 407715f..56f254c 100644 --- a/base/path_service.cc +++ b/base/path_service.cc @@ -19,13 +19,13 @@ #include "base/string_util.h" namespace base { - bool PathProvider(int key, std::wstring* result); + bool PathProvider(int key, FilePath* result); #if defined(OS_WIN) - bool PathProviderWin(int key, std::wstring* result); + bool PathProviderWin(int key, FilePath* result); #elif defined(OS_MACOSX) - bool PathProviderMac(int key, std::wstring* result); + bool PathProviderMac(int key, FilePath* result); #elif defined(OS_LINUX) - bool PathProviderLinux(int key, std::wstring* result); + bool PathProviderLinux(int key, FilePath* result); #endif } @@ -166,23 +166,22 @@ bool PathService::Get(int key, FilePath* result) { if (GetFromCache(key, result)) return true; - std::wstring path_string; + FilePath path; // search providers for the requested path // NOTE: it should be safe to iterate here without the lock // since RegisterProvider always prepends. Provider* provider = path_data->providers; while (provider) { - if (provider->func(key, &path_string)) + if (provider->func(key, &path)) break; - DCHECK(path_string.empty()) << "provider should not have modified path"; + DCHECK(path.value().empty()) << "provider should not have modified path"; provider = provider->next; } - if (path_string.empty()) + if (path.value().empty()) return false; - FilePath path = FilePath::FromWStringHack(path_string); AddToCache(key, path); *result = path; |