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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 }; | 58 }; |
59 #endif // defined(OS_POSIX) | 59 #endif // defined(OS_POSIX) |
60 | 60 |
61 LaunchOptions(); | 61 LaunchOptions(); |
62 LaunchOptions(const LaunchOptions&); | 62 LaunchOptions(const LaunchOptions&); |
63 ~LaunchOptions(); | 63 ~LaunchOptions(); |
64 | 64 |
65 // If true, wait for the process to complete. | 65 // If true, wait for the process to complete. |
66 bool wait; | 66 bool wait; |
67 | 67 |
| 68 // If not empty, change to this directory before executing the new process. |
| 69 base::FilePath current_directory; |
| 70 |
68 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
69 bool start_hidden; | 72 bool start_hidden; |
70 | 73 |
71 // If non-null, inherit exactly the list of handles in this vector (these | 74 // If non-null, inherit exactly the list of handles in this vector (these |
72 // handles must be inheritable). This is only supported on Vista and higher. | 75 // handles must be inheritable). This is only supported on Vista and higher. |
73 HandlesToInheritVector* handles_to_inherit; | 76 HandlesToInheritVector* handles_to_inherit; |
74 | 77 |
75 // If true, the new process inherits handles from the parent. In production | 78 // If true, the new process inherits handles from the parent. In production |
76 // code this flag should be used only when running short-lived, trusted | 79 // code this flag should be used only when running short-lived, trusted |
77 // binaries, because open handles from other libraries and subsystems will | 80 // binaries, because open handles from other libraries and subsystems will |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 147 |
145 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If | 148 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If |
146 // true, then this bit will not be set in the new child process. | 149 // true, then this bit will not be set in the new child process. |
147 bool allow_new_privs; | 150 bool allow_new_privs; |
148 | 151 |
149 // Sets parent process death signal to SIGKILL. | 152 // Sets parent process death signal to SIGKILL. |
150 bool kill_on_parent_death; | 153 bool kill_on_parent_death; |
151 #endif // defined(OS_LINUX) | 154 #endif // defined(OS_LINUX) |
152 | 155 |
153 #if defined(OS_POSIX) | 156 #if defined(OS_POSIX) |
154 // If not empty, change to this directory before execing the new process. | |
155 base::FilePath current_directory; | |
156 | |
157 // If non-null, a delegate to be run immediately prior to executing the new | 157 // If non-null, a delegate to be run immediately prior to executing the new |
158 // program in the child process. | 158 // program in the child process. |
159 // | 159 // |
160 // WARNING: If LaunchProcess is called in the presence of multiple threads, | 160 // WARNING: If LaunchProcess is called in the presence of multiple threads, |
161 // code running in this delegate essentially needs to be async-signal safe | 161 // code running in this delegate essentially needs to be async-signal safe |
162 // (see man 7 signal for a list of allowed functions). | 162 // (see man 7 signal for a list of allowed functions). |
163 PreExecDelegate* pre_exec_delegate; | 163 PreExecDelegate* pre_exec_delegate; |
164 #endif // defined(OS_POSIX) | 164 #endif // defined(OS_POSIX) |
165 | 165 |
166 #if defined(OS_CHROMEOS) | 166 #if defined(OS_CHROMEOS) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // multiple threads are running, since at the time the fork happened, the | 305 // multiple threads are running, since at the time the fork happened, the |
306 // threads could have been in any state (potentially holding locks, etc.). | 306 // threads could have been in any state (potentially holding locks, etc.). |
307 // Callers should most likely call execve() in the child soon after calling | 307 // Callers should most likely call execve() in the child soon after calling |
308 // this. | 308 // this. |
309 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); | 309 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); |
310 #endif | 310 #endif |
311 | 311 |
312 } // namespace base | 312 } // namespace base |
313 | 313 |
314 #endif // BASE_PROCESS_LAUNCH_H_ | 314 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |