OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This is really Posix minus Mac. Mac code is in base_paths_mac.mm. | 5 // This is really Posix minus Mac. Mac code is in base_paths_mac.mm. |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 | 8 |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
11 #include "base/env_var.h" | 11 #include "base/env_var.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/linux_util.h" | |
15 #include "base/logging.h" | 14 #include "base/logging.h" |
16 #include "base/path_service.h" | 15 #include "base/path_service.h" |
17 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
18 #include "base/sys_string_conversions.h" | 17 #include "base/sys_string_conversions.h" |
| 18 #include "base/xdg_util.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 | 21 |
22 #if defined(OS_LINUX) | 22 #if defined(OS_LINUX) |
23 const char kSelfExe[] = "/proc/self/exe"; | 23 const char kSelfExe[] = "/proc/self/exe"; |
24 #elif defined(OS_SOLARIS) | 24 #elif defined(OS_SOLARIS) |
25 const char kSelfExe[] = getexecname(); | 25 const char kSelfExe[] = getexecname(); |
26 #elif defined(OS_FREEBSD) | 26 #elif defined(OS_FREEBSD) |
27 const char kSelfExe[] = "/proc/curproc/file"; | 27 const char kSelfExe[] = "/proc/curproc/file"; |
28 #endif | 28 #endif |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); | 81 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); |
82 FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", | 82 FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", |
83 ".cache")); | 83 ".cache")); |
84 *result = cache_dir; | 84 *result = cache_dir; |
85 return true; | 85 return true; |
86 } | 86 } |
87 return false; | 87 return false; |
88 } | 88 } |
89 | 89 |
90 } // namespace base | 90 } // namespace base |
OLD | NEW |