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 <string> | 10 #include <string> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // that is sent to the parent when the child dies. The termination signal will | 137 // that is sent to the parent when the child dies. The termination signal will |
138 // always be set to SIGCHLD. | 138 // always be set to SIGCHLD. |
139 int clone_flags; | 139 int clone_flags; |
140 | 140 |
141 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If | 141 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If |
142 // true, then this bit will not be set in the new child process. | 142 // true, then this bit will not be set in the new child process. |
143 bool allow_new_privs; | 143 bool allow_new_privs; |
144 #endif // defined(OS_LINUX) | 144 #endif // defined(OS_LINUX) |
145 | 145 |
146 #if defined(OS_POSIX) | 146 #if defined(OS_POSIX) |
| 147 // If not empty, change to this directory before execing the new process. |
| 148 base::FilePath current_directory; |
| 149 |
147 // If non-null, a delegate to be run immediately prior to executing the new | 150 // If non-null, a delegate to be run immediately prior to executing the new |
148 // program in the child process. | 151 // program in the child process. |
149 // | 152 // |
150 // WARNING: If LaunchProcess is called in the presence of multiple threads, | 153 // WARNING: If LaunchProcess is called in the presence of multiple threads, |
151 // code running in this delegate essentially needs to be async-signal safe | 154 // code running in this delegate essentially needs to be async-signal safe |
152 // (see man 7 signal for a list of allowed functions). | 155 // (see man 7 signal for a list of allowed functions). |
153 PreExecDelegate* pre_exec_delegate; | 156 PreExecDelegate* pre_exec_delegate; |
154 #endif // defined(OS_POSIX) | 157 #endif // defined(OS_POSIX) |
155 | 158 |
156 #if defined(OS_CHROMEOS) | 159 #if defined(OS_CHROMEOS) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // multiple threads are running, since at the time the fork happened, the | 309 // multiple threads are running, since at the time the fork happened, the |
307 // threads could have been in any state (potentially holding locks, etc.). | 310 // threads could have been in any state (potentially holding locks, etc.). |
308 // Callers should most likely call execve() in the child soon after calling | 311 // Callers should most likely call execve() in the child soon after calling |
309 // this. | 312 // this. |
310 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); | 313 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); |
311 #endif | 314 #endif |
312 | 315 |
313 } // namespace base | 316 } // namespace base |
314 | 317 |
315 #endif // BASE_PROCESS_LAUNCH_H_ | 318 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |