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

Unified Diff: base/base_paths_linux.cc

Issue 8825: Begin the first small step towards using FilePath everywhere: (Closed)
Patch Set: works on windows Created 12 years, 2 months 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/base_paths.cc ('k') | base/file_path.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths_linux.cc
diff --git a/base/base_paths_linux.cc b/base/base_paths_linux.cc
index abbc91e0a97439810633ff913773327dfc6973cc..d161114b99ae367c84166d8d997bd1b2e15ae4a7 100644
--- a/base/base_paths_linux.cc
+++ b/base/base_paths_linux.cc
@@ -6,6 +6,7 @@
#include <unistd.h>
+#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
@@ -15,7 +16,7 @@
namespace base {
bool PathProviderLinux(int key, std::wstring* result) {
- std::wstring cur;
+ FilePath path;
switch (key) {
case base::FILE_EXE:
case base::FILE_MODULE: { // TODO(evanm): is this correct?
@@ -32,10 +33,11 @@ bool PathProviderLinux(int key, std::wstring* result) {
case base::DIR_SOURCE_ROOT:
// On linux, unit tests execute two levels deep from the source root.
// For example: chrome/{Debug|Hammer}/net_unittest
- PathService::Get(base::DIR_EXE, &cur);
- file_util::UpOneDirectory(&cur);
- file_util::UpOneDirectory(&cur);
- *result = cur;
+ if (!PathService::Get(base::DIR_EXE, &path))
+ return false;
+ path = path.Append(FilePath::kParentDirectory)
+ .Append(FilePath::kParentDirectory);
+ *result = path.ToWStringHack();
return true;
}
return false;
« no previous file with comments | « base/base_paths.cc ('k') | base/file_path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698