OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Defines base::PathProviderPosix, default path provider on POSIX OSes that | 5 // Defines base::PathProviderPosix, default path provider on POSIX OSes that |
6 // don't have their own base_paths_OS.cc implementation (i.e. all but Mac and | 6 // don't have their own base_paths_OS.cc implementation (i.e. all but Mac and |
7 // Android). | 7 // Android). |
8 | 8 |
9 #include <ostream> | 9 #include <ostream> |
10 #include <string> | 10 #include <string> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 return true; | 73 return true; |
74 #endif | 74 #endif |
75 } | 75 } |
76 case base::DIR_SOURCE_ROOT: { | 76 case base::DIR_SOURCE_ROOT: { |
77 // Allow passing this in the environment, for more flexibility in build | 77 // Allow passing this in the environment, for more flexibility in build |
78 // tree configurations (sub-project builds, gyp --output_dir, etc.) | 78 // tree configurations (sub-project builds, gyp --output_dir, etc.) |
79 scoped_ptr<base::Environment> env(base::Environment::Create()); | 79 scoped_ptr<base::Environment> env(base::Environment::Create()); |
80 std::string cr_source_root; | 80 std::string cr_source_root; |
81 if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) { | 81 if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) { |
82 path = FilePath(cr_source_root); | 82 path = FilePath(cr_source_root); |
83 if (file_util::PathExists(path)) { | 83 if (base::PathExists(path)) { |
84 *result = path; | 84 *result = path; |
85 return true; | 85 return true; |
86 } else { | 86 } else { |
87 DLOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not " | 87 DLOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not " |
88 << "point to a directory."; | 88 << "point to a directory."; |
89 } | 89 } |
90 } | 90 } |
91 // On POSIX, unit tests execute two levels deep from the source root. | 91 // On POSIX, unit tests execute two levels deep from the source root. |
92 // For example: out/{Debug|Release}/net_unittest | 92 // For example: out/{Debug|Release}/net_unittest |
93 if (PathService::Get(base::DIR_EXE, &path)) { | 93 if (PathService::Get(base::DIR_EXE, &path)) { |
(...skipping 16 matching lines...) Expand all Loading... |
110 return true; | 110 return true; |
111 } | 111 } |
112 case base::DIR_HOME: | 112 case base::DIR_HOME: |
113 *result = file_util::GetHomeDir(); | 113 *result = file_util::GetHomeDir(); |
114 return true; | 114 return true; |
115 } | 115 } |
116 return false; | 116 return false; |
117 } | 117 } |
118 | 118 |
119 } // namespace base | 119 } // namespace base |
OLD | NEW |