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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 // rlim_max. This pointer is owned by the caller and must live through | 107 // rlim_max. This pointer is owned by the caller and must live through |
108 // the call to LaunchProcess(). | 108 // the call to LaunchProcess(). |
109 const std::vector<int>* maximize_rlimits; | 109 const std::vector<int>* maximize_rlimits; |
110 | 110 |
111 // If true, start the process in a new process group, instead of | 111 // If true, start the process in a new process group, instead of |
112 // inheriting the parent's process group. The pgid of the child process | 112 // inheriting the parent's process group. The pgid of the child process |
113 // will be the same as its pid. | 113 // will be the same as its pid. |
114 bool new_process_group; | 114 bool new_process_group; |
115 | 115 |
116 #if defined(OS_LINUX) | 116 #if defined(OS_LINUX) |
117 // If non-zero, start the process using clone(), using flags as provided. | 117 // If non-zero, start the process using clone(), using flags as provided. Note |
118 // that it is not safe to start a process with non-zero clone_flags if | |
119 // multiple threads are running. | |
jln (very slow on Chromium)
2015/01/06 00:22:31
1. Explain that the clone flags may not include a
rickyz (no longer on Chrome)
2015/01/06 02:45:37
Done.
| |
118 int clone_flags; | 120 int clone_flags; |
119 | 121 |
120 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If | 122 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If |
121 // true, then this bit will not be set in the new child process. | 123 // true, then this bit will not be set in the new child process. |
122 bool allow_new_privs; | 124 bool allow_new_privs; |
123 #endif // defined(OS_LINUX) | 125 #endif // defined(OS_LINUX) |
124 | 126 |
125 #if defined(OS_CHROMEOS) | 127 #if defined(OS_CHROMEOS) |
126 // If non-negative, the specified file descriptor will be set as the launched | 128 // If non-negative, the specified file descriptor will be set as the launched |
127 // process' controlling terminal. | 129 // process' controlling terminal. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 void ReplaceBootstrapPort(const std::string& replacement_bootstrap_name); | 265 void ReplaceBootstrapPort(const std::string& replacement_bootstrap_name); |
264 #endif // defined(OS_MACOSX) | 266 #endif // defined(OS_MACOSX) |
265 | 267 |
266 // Creates a LaunchOptions object suitable for launching processes in a test | 268 // Creates a LaunchOptions object suitable for launching processes in a test |
267 // binary. This should not be called in production/released code. | 269 // binary. This should not be called in production/released code. |
268 BASE_EXPORT LaunchOptions LaunchOptionsForTest(); | 270 BASE_EXPORT LaunchOptions LaunchOptionsForTest(); |
269 | 271 |
270 } // namespace base | 272 } // namespace base |
271 | 273 |
272 #endif // BASE_PROCESS_LAUNCH_H_ | 274 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |