Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: base/path_service.cc

Issue 11252: Move more code to using FilePath. (Closed)
Patch Set: rebased Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/path_service.h ('k') | chrome/common/chrome_paths.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/path_service.cc
diff --git a/base/path_service.cc b/base/path_service.cc
index 407715f4842548e6034f74246b6030e0e7bc1630..56f254c6d7c73558728905d00331045ba43e1e4d 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;
« no previous file with comments | « base/path_service.h ('k') | chrome/common/chrome_paths.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698