| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/base_paths.h" | 5 #include "base/base_paths.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 namespace base { | 26 namespace base { |
| 27 | 27 |
| 28 #if defined(OS_LINUX) | 28 #if defined(OS_LINUX) |
| 29 const char kSelfExe[] = "/proc/self/exe"; | 29 const char kSelfExe[] = "/proc/self/exe"; |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 // The name of this file relative to the source root. This is used for checking | 32 // The name of this file relative to the source root. This is used for checking |
| 33 // that the source checkout is in the correct place. | 33 // that the source checkout is in the correct place. |
| 34 static const char kThisSourceFile[] = "base/base_paths_linux.cc"; | 34 static const char kThisSourceFile[] = "base/base_paths_posix.cc"; |
| 35 | 35 |
| 36 bool PathProviderPosix(int key, FilePath* result) { | 36 bool PathProviderPosix(int key, FilePath* result) { |
| 37 FilePath path; | 37 FilePath path; |
| 38 switch (key) { | 38 switch (key) { |
| 39 case base::FILE_EXE: | 39 case base::FILE_EXE: |
| 40 case base::FILE_MODULE: { // TODO(evanm): is this correct? | 40 case base::FILE_MODULE: { // TODO(evanm): is this correct? |
| 41 #if defined(OS_LINUX) | 41 #if defined(OS_LINUX) |
| 42 FilePath bin_dir; | 42 FilePath bin_dir; |
| 43 if (!file_util::ReadSymbolicLink(FilePath(kSelfExe), &bin_dir)) { | 43 if (!file_util::ReadSymbolicLink(FilePath(kSelfExe), &bin_dir)) { |
| 44 NOTREACHED() << "Unable to resolve " << kSelfExe << "."; | 44 NOTREACHED() << "Unable to resolve " << kSelfExe << "."; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 scoped_ptr<base::Environment> env(base::Environment::Create()); | 126 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 127 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", | 127 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", |
| 128 ".cache")); | 128 ".cache")); |
| 129 *result = cache_dir; | 129 *result = cache_dir; |
| 130 return true; | 130 return true; |
| 131 } | 131 } |
| 132 return false; | 132 return false; |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace base | 135 } // namespace base |
| OLD | NEW |