| 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 #include "base/base_paths.h" | 5 #include "base/base_paths.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 #if defined(OS_FREEBSD) | 8 #if defined(OS_FREEBSD) |
| 9 #include <sys/param.h> | 9 #include <sys/param.h> |
| 10 #include <sys/sysctl.h> | 10 #include <sys/sysctl.h> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // drive) try assuming the current directory is the source root. | 98 // drive) try assuming the current directory is the source root. |
| 99 if (file_util::GetCurrentDirectory(&path) && | 99 if (file_util::GetCurrentDirectory(&path) && |
| 100 file_util::PathExists(path.Append(kThisSourceFile))) { | 100 file_util::PathExists(path.Append(kThisSourceFile))) { |
| 101 *result = path; | 101 *result = path; |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 LOG(ERROR) << "Couldn't find your source root. " | 104 LOG(ERROR) << "Couldn't find your source root. " |
| 105 << "Try running from your chromium/src directory."; | 105 << "Try running from your chromium/src directory."; |
| 106 return false; | 106 return false; |
| 107 } | 107 } |
| 108 case base::DIR_CACHE: | 108 case base::DIR_USER_CACHE: |
| 109 scoped_ptr<base::Environment> env(base::Environment::Create()); | 109 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 110 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", | 110 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", |
| 111 ".cache")); | 111 ".cache")); |
| 112 *result = cache_dir; | 112 *result = cache_dir; |
| 113 return true; | 113 return true; |
| 114 } | 114 } |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace base | 118 } // namespace base |
| OLD | NEW |