OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <set> | 10 #include <set> |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 const LaunchOptions& options, | 157 const LaunchOptions& options, |
158 ProcessHandle* process_handle); | 158 ProcessHandle* process_handle); |
159 | 159 |
160 // Close all file descriptors, except those which are a destination in the | 160 // Close all file descriptors, except those which are a destination in the |
161 // given multimap. Only call this function in a child process where you know | 161 // given multimap. Only call this function in a child process where you know |
162 // that there aren't any other threads. | 162 // that there aren't any other threads. |
163 BASE_EXPORT void CloseSuperfluousFds(const InjectiveMultimap& saved_map); | 163 BASE_EXPORT void CloseSuperfluousFds(const InjectiveMultimap& saved_map); |
164 #endif // defined(OS_POSIX) | 164 #endif // defined(OS_POSIX) |
165 | 165 |
166 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
167 // Set JOBOBJECT_EXTENDED_LIMIT_INFORMATION to JobObject |job_object|. | 167 // Set |job_object|'s JOBOBJECT_EXTENDED_LIMIT_INFORMATION |
168 // As its limit_info.BasicLimitInformation.LimitFlags has | 168 // BasicLimitInformation.LimitFlags to |limit_flags|. |
169 // JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. | 169 BASE_EXPORT bool SetJobObjectLimitFlags(HANDLE job_object, DWORD limit_flags); |
170 // When the provide JobObject |job_object| is closed, the binded process will | |
171 // be terminated. | |
172 BASE_EXPORT bool SetJobObjectAsKillOnJobClose(HANDLE job_object); | |
173 | 170 |
174 // Output multi-process printf, cout, cerr, etc to the cmd.exe console that ran | 171 // Output multi-process printf, cout, cerr, etc to the cmd.exe console that ran |
175 // chrome. This is not thread-safe: only call from main thread. | 172 // chrome. This is not thread-safe: only call from main thread. |
176 BASE_EXPORT void RouteStdioToConsole(); | 173 BASE_EXPORT void RouteStdioToConsole(); |
177 #endif // defined(OS_WIN) | 174 #endif // defined(OS_WIN) |
178 | 175 |
179 // Executes the application specified by |cl| and wait for it to exit. Stores | 176 // Executes the application specified by |cl| and wait for it to exit. Stores |
180 // the output (stdout) in |output|. Redirects stderr to /dev/null. Returns true | 177 // the output (stdout) in |output|. Redirects stderr to /dev/null. Returns true |
181 // on success (application launched and exited cleanly, with exit code | 178 // on success (application launched and exited cleanly, with exit code |
182 // indicating success). | 179 // indicating success). |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // instance running inside the parent. The parent's Breakpad instance should | 211 // instance running inside the parent. The parent's Breakpad instance should |
215 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 212 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
216 // in the child after forking will restore the standard exception handler. | 213 // in the child after forking will restore the standard exception handler. |
217 // See http://crbug.com/20371/ for more details. | 214 // See http://crbug.com/20371/ for more details. |
218 void RestoreDefaultExceptionHandler(); | 215 void RestoreDefaultExceptionHandler(); |
219 #endif // defined(OS_MACOSX) | 216 #endif // defined(OS_MACOSX) |
220 | 217 |
221 } // namespace base | 218 } // namespace base |
222 | 219 |
223 #endif // BASE_PROCESS_LAUNCH_H_ | 220 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |