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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 const std::vector<int>* maximize_rlimits; | 104 const std::vector<int>* maximize_rlimits; |
105 | 105 |
106 // If true, start the process in a new process group, instead of | 106 // If true, start the process in a new process group, instead of |
107 // inheriting the parent's process group. The pgid of the child process | 107 // inheriting the parent's process group. The pgid of the child process |
108 // will be the same as its pid. | 108 // will be the same as its pid. |
109 bool new_process_group; | 109 bool new_process_group; |
110 | 110 |
111 #if defined(OS_LINUX) | 111 #if defined(OS_LINUX) |
112 // If non-zero, start the process using clone(), using flags as provided. | 112 // If non-zero, start the process using clone(), using flags as provided. |
113 int clone_flags; | 113 int clone_flags; |
| 114 |
| 115 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If |
| 116 // true, then this bit will not be set in the new child process. |
| 117 bool allow_new_privs; |
114 #endif // defined(OS_LINUX) | 118 #endif // defined(OS_LINUX) |
115 | 119 |
116 #if defined(OS_CHROMEOS) | 120 #if defined(OS_CHROMEOS) |
117 // If non-negative, the specified file descriptor will be set as the launched | 121 // If non-negative, the specified file descriptor will be set as the launched |
118 // process' controlling terminal. | 122 // process' controlling terminal. |
119 int ctrl_terminal_fd; | 123 int ctrl_terminal_fd; |
120 #endif // defined(OS_CHROMEOS) | 124 #endif // defined(OS_CHROMEOS) |
121 | 125 |
122 #endif // !defined(OS_WIN) | 126 #endif // !defined(OS_WIN) |
123 }; | 127 }; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // Restore the default exception handler, setting it to Apple Crash Reporter | 240 // Restore the default exception handler, setting it to Apple Crash Reporter |
237 // (ReportCrash). When forking and execing a new process, the child will | 241 // (ReportCrash). When forking and execing a new process, the child will |
238 // inherit the parent's exception ports, which may be set to the Breakpad | 242 // inherit the parent's exception ports, which may be set to the Breakpad |
239 // instance running inside the parent. The parent's Breakpad instance should | 243 // instance running inside the parent. The parent's Breakpad instance should |
240 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 244 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
241 // in the child after forking will restore the standard exception handler. | 245 // in the child after forking will restore the standard exception handler. |
242 // See http://crbug.com/20371/ for more details. | 246 // See http://crbug.com/20371/ for more details. |
243 void RestoreDefaultExceptionHandler(); | 247 void RestoreDefaultExceptionHandler(); |
244 #endif // defined(OS_MACOSX) | 248 #endif // defined(OS_MACOSX) |
245 | 249 |
| 250 // Creates a LaunchOptions object suitable for launching processes in a test |
| 251 // binary. This should not be called in production/released code. |
| 252 BASE_EXPORT LaunchOptions LaunchOptionsForTest(); |
| 253 |
246 } // namespace base | 254 } // namespace base |
247 | 255 |
248 #endif // BASE_PROCESS_LAUNCH_H_ | 256 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |