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 routines to kill processes and get the exit code and | 5 // This file contains routines to kill processes and get the exit code and |
6 // termination status. | 6 // termination status. |
7 | 7 |
8 #ifndef BASE_PROCESS_KILL_H_ | 8 #ifndef BASE_PROCESS_KILL_H_ |
9 #define BASE_PROCESS_KILL_H_ | 9 #define BASE_PROCESS_KILL_H_ |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Used for the case when oom-killer kills a process on ChromeOS. | 30 // Used for the case when oom-killer kills a process on ChromeOS. |
31 TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM, | 31 TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM, |
32 #endif | 32 #endif |
33 #if defined(OS_ANDROID) | 33 #if defined(OS_ANDROID) |
34 // On Android processes are spawned from the system Zygote and we do not get | 34 // On Android processes are spawned from the system Zygote and we do not get |
35 // the termination status. We can't know if the termination was a crash or an | 35 // the termination status. We can't know if the termination was a crash or an |
36 // oom kill for sure, but we can use status of the strong process bindings as | 36 // oom kill for sure, but we can use status of the strong process bindings as |
37 // a hint. | 37 // a hint. |
38 TERMINATION_STATUS_OOM_PROTECTED, // child was protected from oom kill | 38 TERMINATION_STATUS_OOM_PROTECTED, // child was protected from oom kill |
39 #endif | 39 #endif |
| 40 TERMINATION_STATUS_LAUNCH_FAILED, // child process never launched |
40 TERMINATION_STATUS_MAX_ENUM | 41 TERMINATION_STATUS_MAX_ENUM |
41 }; | 42 }; |
42 | 43 |
43 // Attempts to kill all the processes on the current machine that were launched | 44 // Attempts to kill all the processes on the current machine that were launched |
44 // from the given executable name, ending them with the given exit code. If | 45 // from the given executable name, ending them with the given exit code. If |
45 // filter is non-null, then only processes selected by the filter are killed. | 46 // filter is non-null, then only processes selected by the filter are killed. |
46 // Returns true if all processes were able to be killed off, false if at least | 47 // Returns true if all processes were able to be killed off, false if at least |
47 // one couldn't be killed. | 48 // one couldn't be killed. |
48 BASE_EXPORT bool KillProcesses(const FilePath::StringType& executable_name, | 49 BASE_EXPORT bool KillProcesses(const FilePath::StringType& executable_name, |
49 int exit_code, | 50 int exit_code, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 125 |
125 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 126 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
126 // The nicer version of EnsureProcessTerminated() that is patient and will | 127 // The nicer version of EnsureProcessTerminated() that is patient and will |
127 // wait for |pid| to finish and then reap it. | 128 // wait for |pid| to finish and then reap it. |
128 BASE_EXPORT void EnsureProcessGetsReaped(ProcessId pid); | 129 BASE_EXPORT void EnsureProcessGetsReaped(ProcessId pid); |
129 #endif | 130 #endif |
130 | 131 |
131 } // namespace base | 132 } // namespace base |
132 | 133 |
133 #endif // BASE_PROCESS_KILL_H_ | 134 #endif // BASE_PROCESS_KILL_H_ |
OLD | NEW |