OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 file contains functions for launching subprocesses. | 5 // This file contains functions for launching subprocesses. |
6 | 6 |
7 #ifndef BASE_PROCESS_LAUNCH_H_ | 7 #ifndef BASE_PROCESS_LAUNCH_H_ |
8 #define BASE_PROCESS_LAUNCH_H_ | 8 #define BASE_PROCESS_LAUNCH_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 BASE_EXPORT bool GetAppOutput(const StringPiece16& cl, std::string* output); | 250 BASE_EXPORT bool GetAppOutput(const StringPiece16& cl, std::string* output); |
251 #endif | 251 #endif |
252 | 252 |
253 #if defined(OS_POSIX) | 253 #if defined(OS_POSIX) |
254 // A POSIX-specific version of GetAppOutput that takes an argv array | 254 // A POSIX-specific version of GetAppOutput that takes an argv array |
255 // instead of a CommandLine. Useful for situations where you need to | 255 // instead of a CommandLine. Useful for situations where you need to |
256 // control the command line arguments directly. | 256 // control the command line arguments directly. |
257 BASE_EXPORT bool GetAppOutput(const std::vector<std::string>& argv, | 257 BASE_EXPORT bool GetAppOutput(const std::vector<std::string>& argv, |
258 std::string* output); | 258 std::string* output); |
259 | 259 |
260 // A restricted version of |GetAppOutput()| which (a) clears the environment, | |
261 // and (b) stores at most |max_output| bytes; also, it doesn't search the path | |
262 // for the command. | |
263 BASE_EXPORT bool GetAppOutputRestricted(const CommandLine& cl, | |
264 std::string* output, size_t max_output); | |
265 | |
266 // A version of |GetAppOutput()| which also returns the exit code of the | 260 // A version of |GetAppOutput()| which also returns the exit code of the |
267 // executed command. Returns true if the application runs and exits cleanly. If | 261 // executed command. Returns true if the application runs and exits cleanly. If |
268 // this is the case the exit code of the application is available in | 262 // this is the case the exit code of the application is available in |
269 // |*exit_code|. | 263 // |*exit_code|. |
270 BASE_EXPORT bool GetAppOutputWithExitCode(const CommandLine& cl, | 264 BASE_EXPORT bool GetAppOutputWithExitCode(const CommandLine& cl, |
271 std::string* output, int* exit_code); | 265 std::string* output, int* exit_code); |
272 #endif // defined(OS_POSIX) | 266 #endif // defined(OS_POSIX) |
273 | 267 |
274 // If supported on the platform, and the user has sufficent rights, increase | 268 // If supported on the platform, and the user has sufficent rights, increase |
275 // the current process's scheduling priority to a high priority. | 269 // the current process's scheduling priority to a high priority. |
(...skipping 29 matching lines...) Expand all Loading... |
305 // multiple threads are running, since at the time the fork happened, the | 299 // multiple threads are running, since at the time the fork happened, the |
306 // threads could have been in any state (potentially holding locks, etc.). | 300 // threads could have been in any state (potentially holding locks, etc.). |
307 // Callers should most likely call execve() in the child soon after calling | 301 // Callers should most likely call execve() in the child soon after calling |
308 // this. | 302 // this. |
309 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); | 303 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); |
310 #endif | 304 #endif |
311 | 305 |
312 } // namespace base | 306 } // namespace base |
313 | 307 |
314 #endif // BASE_PROCESS_LAUNCH_H_ | 308 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |