OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // for the process to be actually terminated before returning. | 249 // for the process to be actually terminated before returning. |
250 // Returns true if this is successful, false otherwise. | 250 // Returns true if this is successful, false otherwise. |
251 bool KillProcess(ProcessHandle process, int exit_code, bool wait); | 251 bool KillProcess(ProcessHandle process, int exit_code, bool wait); |
252 #if defined(OS_WIN) | 252 #if defined(OS_WIN) |
253 bool KillProcessById(ProcessId process_id, int exit_code, bool wait); | 253 bool KillProcessById(ProcessId process_id, int exit_code, bool wait); |
254 #endif | 254 #endif |
255 | 255 |
256 // Get the termination status (exit code) of the process and return true if the | 256 // Get the termination status (exit code) of the process and return true if the |
257 // status indicates the process crashed. |child_exited| is set to true iff the | 257 // status indicates the process crashed. |child_exited| is set to true iff the |
258 // child process has terminated. (|child_exited| may be NULL.) | 258 // child process has terminated. (|child_exited| may be NULL.) |
259 // | |
260 // On Windows, it is an error to call this if the process hasn't terminated | |
261 // yet. On POSIX, |child_exited| is set correctly since we detect terminate in | |
262 // a different manner on POSIX. | |
263 bool DidProcessCrash(bool* child_exited, ProcessHandle handle); | 259 bool DidProcessCrash(bool* child_exited, ProcessHandle handle); |
264 | 260 |
265 // Waits for process to exit. In POSIX systems, if the process hasn't been | 261 // Waits for process to exit. In POSIX systems, if the process hasn't been |
266 // signaled then puts the exit code in |exit_code|; otherwise it's considered | 262 // signaled then puts the exit code in |exit_code|; otherwise it's considered |
267 // a failure. On Windows |exit_code| is always filled. Returns true on success, | 263 // a failure. On Windows |exit_code| is always filled. Returns true on success, |
268 // and closes |handle| in any case. | 264 // and closes |handle| in any case. |
269 bool WaitForExitCode(ProcessHandle handle, int* exit_code); | 265 bool WaitForExitCode(ProcessHandle handle, int* exit_code); |
270 | 266 |
271 // Waits for process to exit. If it did exit within |timeout_milliseconds|, | 267 // Waits for process to exit. If it did exit within |timeout_milliseconds|, |
272 // then puts the exit code in |exit_code|, closes |handle|, and returns true. | 268 // then puts the exit code in |exit_code|, closes |handle|, and returns true. |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // instance running inside the parent. The parent's Breakpad instance should | 539 // instance running inside the parent. The parent's Breakpad instance should |
544 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 540 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
545 // in the child after forking will restore the standard exception handler. | 541 // in the child after forking will restore the standard exception handler. |
546 // See http://crbug.com/20371/ for more details. | 542 // See http://crbug.com/20371/ for more details. |
547 void RestoreDefaultExceptionHandler(); | 543 void RestoreDefaultExceptionHandler(); |
548 #endif | 544 #endif |
549 | 545 |
550 } // namespace base | 546 } // namespace base |
551 | 547 |
552 #endif // BASE_PROCESS_UTIL_H_ | 548 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |