summaryrefslogtreecommitdiffstats
path: root/base/base_paths_linux.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-30 23:54:04 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-30 23:54:04 +0000
commit640517fdd23e08ed95cf129d27457db817ee6124 (patch)
tree2674bc857b9d1b566e05bcfa1dd5c8cfd1897dbf /base/base_paths_linux.cc
parentf92ed219c9aeeed79993d1d32f34e5d5c9888dbe (diff)
downloadchromium_src-640517fdd23e08ed95cf129d27457db817ee6124.zip
chromium_src-640517fdd23e08ed95cf129d27457db817ee6124.tar.gz
chromium_src-640517fdd23e08ed95cf129d27457db817ee6124.tar.bz2
Begin the first small step towards using FilePath everywhere:
- Add some transition APIs. - Start migrating some code to transition APIs. Review URL: http://codereview.chromium.org/8825 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_linux.cc')
-rw-r--r--base/base_paths_linux.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/base/base_paths_linux.cc b/base/base_paths_linux.cc
index abbc91e..d161114 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;