OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/namespace contains utility functions for enumerating, ending and | 5 // This file/namespace contains utility functions for enumerating, ending and |
6 // computing statistics of processes. | 6 // computing statistics of processes. |
7 | 7 |
8 #ifndef BASE_PROCESS_UTIL_H_ | 8 #ifndef BASE_PROCESS_UTIL_H_ |
9 #define BASE_PROCESS_UTIL_H_ | 9 #define BASE_PROCESS_UTIL_H_ |
10 | 10 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 typedef int* LaunchSynchronizationHandle; | 233 typedef int* LaunchSynchronizationHandle; |
234 #endif // defined(OS_MACOSX) | 234 #endif // defined(OS_MACOSX) |
235 | 235 |
236 // Options for launching a subprocess that are passed to LaunchProcess(). | 236 // Options for launching a subprocess that are passed to LaunchProcess(). |
237 // The default constructor constructs the object with default options. | 237 // The default constructor constructs the object with default options. |
238 struct LaunchOptions { | 238 struct LaunchOptions { |
239 LaunchOptions() : wait(false), | 239 LaunchOptions() : wait(false), |
240 #if defined(OS_WIN) | 240 #if defined(OS_WIN) |
241 start_hidden(false), inherit_handles(false), as_user(NULL), | 241 start_hidden(false), inherit_handles(false), as_user(NULL), |
242 empty_desktop_name(false), job_handle(NULL), | 242 empty_desktop_name(false), job_handle(NULL), |
| 243 stdin_handle(NULL), |
| 244 stdout_handle(NULL), |
| 245 stderr_handle(NULL), |
243 force_breakaway_from_job_(false) | 246 force_breakaway_from_job_(false) |
244 #else | 247 #else |
245 environ(NULL), fds_to_remap(NULL), maximize_rlimits(NULL), | 248 environ(NULL), fds_to_remap(NULL), maximize_rlimits(NULL), |
246 new_process_group(false) | 249 new_process_group(false) |
247 #if defined(OS_LINUX) | 250 #if defined(OS_LINUX) |
248 , clone_flags(0) | 251 , clone_flags(0) |
249 #endif // OS_LINUX | 252 #endif // OS_LINUX |
250 #if defined(OS_CHROMEOS) | 253 #if defined(OS_CHROMEOS) |
251 , ctrl_terminal_fd(-1) | 254 , ctrl_terminal_fd(-1) |
252 #endif // OS_CHROMEOS | 255 #endif // OS_CHROMEOS |
(...skipping 22 matching lines...) Expand all Loading... |
275 UserTokenHandle as_user; | 278 UserTokenHandle as_user; |
276 | 279 |
277 // If true, use an empty string for the desktop name. | 280 // If true, use an empty string for the desktop name. |
278 bool empty_desktop_name; | 281 bool empty_desktop_name; |
279 | 282 |
280 // If non-NULL, launches the application in that job object. The process will | 283 // If non-NULL, launches the application in that job object. The process will |
281 // be terminated immediately and LaunchProcess() will fail if assignment to | 284 // be terminated immediately and LaunchProcess() will fail if assignment to |
282 // the job object fails. | 285 // the job object fails. |
283 HANDLE job_handle; | 286 HANDLE job_handle; |
284 | 287 |
| 288 // Handles for the redirection of stdin, stdout and stderr. |
| 289 HANDLE stdin_handle; |
| 290 HANDLE stdout_handle; |
| 291 HANDLE stderr_handle; |
| 292 |
285 // If set to true, ensures that the child process is launched with the | 293 // If set to true, ensures that the child process is launched with the |
286 // CREATE_BREAKAWAY_FROM_JOB flag which allows it to breakout of the parent | 294 // CREATE_BREAKAWAY_FROM_JOB flag which allows it to breakout of the parent |
287 // job if any. | 295 // job if any. |
288 bool force_breakaway_from_job_; | 296 bool force_breakaway_from_job_; |
289 #else | 297 #else |
290 // If non-NULL, set/unset environment variables. | 298 // If non-NULL, set/unset environment variables. |
291 // See documentation of AlterEnvironment(). | 299 // See documentation of AlterEnvironment(). |
292 // This pointer is owned by the caller and must live through the | 300 // This pointer is owned by the caller and must live through the |
293 // call to LaunchProcess(). | 301 // call to LaunchProcess(). |
294 const EnvironmentVector* environ; | 302 const EnvironmentVector* environ; |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 // YOUR CODE IS LIKELY TO BE REVERTED. THANK YOU. | 882 // YOUR CODE IS LIKELY TO BE REVERTED. THANK YOU. |
875 // | 883 // |
876 // TODO(shess): Weird place to put it, but this is where the OOM | 884 // TODO(shess): Weird place to put it, but this is where the OOM |
877 // killer currently lives. | 885 // killer currently lives. |
878 BASE_EXPORT void* UncheckedMalloc(size_t size); | 886 BASE_EXPORT void* UncheckedMalloc(size_t size); |
879 #endif // defined(OS_MACOSX) | 887 #endif // defined(OS_MACOSX) |
880 | 888 |
881 } // namespace base | 889 } // namespace base |
882 | 890 |
883 #endif // BASE_PROCESS_UTIL_H_ | 891 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |