Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: base/base_paths_posix.cc

Issue 3029062: base: rename Environment::GetEnv to Environment::GetVar. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/environment.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(OS_FREEBSD) 10 #if defined(OS_FREEBSD)
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 bin_dir[strlen(bin_dir)] = 0; 56 bin_dir[strlen(bin_dir)] = 0;
57 *result = FilePath(bin_dir); 57 *result = FilePath(bin_dir);
58 return true; 58 return true;
59 #endif 59 #endif
60 } 60 }
61 case base::DIR_SOURCE_ROOT: { 61 case base::DIR_SOURCE_ROOT: {
62 // Allow passing this in the environment, for more flexibility in build 62 // Allow passing this in the environment, for more flexibility in build
63 // tree configurations (sub-project builds, gyp --output_dir, etc.) 63 // tree configurations (sub-project builds, gyp --output_dir, etc.)
64 scoped_ptr<base::Environment> env(base::Environment::Create()); 64 scoped_ptr<base::Environment> env(base::Environment::Create());
65 std::string cr_source_root; 65 std::string cr_source_root;
66 if (env->GetEnv("CR_SOURCE_ROOT", &cr_source_root)) { 66 if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) {
67 path = FilePath(cr_source_root); 67 path = FilePath(cr_source_root);
68 if (file_util::PathExists(path.Append("base/base_paths_posix.cc"))) { 68 if (file_util::PathExists(path.Append("base/base_paths_posix.cc"))) {
69 *result = path; 69 *result = path;
70 return true; 70 return true;
71 } else { 71 } else {
72 LOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not " 72 LOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not "
73 << "point to the correct source root directory."; 73 << "point to the correct source root directory.";
74 } 74 }
75 } 75 }
76 // On POSIX, unit tests execute two levels deep from the source root. 76 // On POSIX, unit tests execute two levels deep from the source root.
(...skipping 30 matching lines...) Expand all
107 scoped_ptr<base::Environment> env(base::Environment::Create()); 107 scoped_ptr<base::Environment> env(base::Environment::Create());
108 FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", 108 FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME",
109 ".cache")); 109 ".cache"));
110 *result = cache_dir; 110 *result = cache_dir;
111 return true; 111 return true;
112 } 112 }
113 return false; 113 return false;
114 } 114 }
115 115
116 } // namespace base 116 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698