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 #include "base/environment.h" | 5 #include "base/environment.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 } // namespace | 123 } // namespace |
124 | 124 |
125 namespace env_vars { | 125 namespace env_vars { |
126 | 126 |
127 #if defined(OS_POSIX) | 127 #if defined(OS_POSIX) |
128 // On Posix systems, this variable contains the location of the user's home | 128 // On Posix systems, this variable contains the location of the user's home |
129 // directory. (e.g, /home/username/). | 129 // directory. (e.g, /home/username/). |
130 const char kHome[] = "HOME"; | 130 const char kHome[] = "HOME"; |
| 131 const char kTempDir[] = "TMPDIR"; |
131 #endif | 132 #endif |
132 | 133 |
133 } // namespace env_vars | 134 } // namespace env_vars |
134 | 135 |
135 Environment::~Environment() {} | 136 Environment::~Environment() {} |
136 | 137 |
137 // static | 138 // static |
138 std::unique_ptr<Environment> Environment::Create() { | 139 std::unique_ptr<Environment> Environment::Create() { |
139 return MakeUnique<EnvironmentImpl>(); | 140 return MakeUnique<EnvironmentImpl>(); |
140 } | 141 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 for (size_t i = 0; i < result_indices.size(); i++) | 232 for (size_t i = 0; i < result_indices.size(); i++) |
232 result[i] = &storage_data[result_indices[i]]; | 233 result[i] = &storage_data[result_indices[i]]; |
233 result[result_indices.size()] = 0; // Null terminator. | 234 result[result_indices.size()] = 0; // Null terminator. |
234 | 235 |
235 return result; | 236 return result; |
236 } | 237 } |
237 | 238 |
238 #endif // OS_POSIX | 239 #endif // OS_POSIX |
239 | 240 |
240 } // namespace base | 241 } // namespace base |
OLD | NEW |