| 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 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/process/process.h" | |
| 13 #include "base/process/process_handle.h" | 12 #include "base/process/process_handle.h" |
| 14 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 15 | 14 |
| 16 namespace base { | 15 namespace base { |
| 17 | 16 |
| 18 class ProcessFilter; | 17 class ProcessFilter; |
| 19 | 18 |
| 20 // Return status values from GetTerminationStatus. Don't use these as | 19 // Return status values from GetTerminationStatus. Don't use these as |
| 21 // exit code arguments to KillProcess*(), use platform/application | 20 // exit code arguments to KillProcess*(), use platform/application |
| 22 // specific values instead. | 21 // specific values instead. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // then it closes the given process handle. | 139 // then it closes the given process handle. |
| 141 // | 140 // |
| 142 // It assumes that the process has already been signalled to exit, and it | 141 // It assumes that the process has already been signalled to exit, and it |
| 143 // begins by waiting a small amount of time for it to exit. If the process | 142 // begins by waiting a small amount of time for it to exit. If the process |
| 144 // does not appear to have exited, then this function starts to become | 143 // does not appear to have exited, then this function starts to become |
| 145 // aggressive about ensuring that the process terminates. | 144 // aggressive about ensuring that the process terminates. |
| 146 // | 145 // |
| 147 // On Linux this method does not block the calling thread. | 146 // On Linux this method does not block the calling thread. |
| 148 // On OS X this method may block for up to 2 seconds. | 147 // On OS X this method may block for up to 2 seconds. |
| 149 // | 148 // |
| 150 // NOTE: The process must have been opened with the PROCESS_TERMINATE and | 149 // NOTE: The process handle must have been opened with the PROCESS_TERMINATE |
| 151 // SYNCHRONIZE permissions. | 150 // and SYNCHRONIZE permissions. |
| 152 // | 151 // |
| 153 BASE_EXPORT void EnsureProcessTerminated(Process process); | 152 BASE_EXPORT void EnsureProcessTerminated(ProcessHandle process_handle); |
| 154 | 153 |
| 155 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 154 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 156 // The nicer version of EnsureProcessTerminated() that is patient and will | 155 // The nicer version of EnsureProcessTerminated() that is patient and will |
| 157 // wait for |process_handle| to finish and then reap it. | 156 // wait for |process_handle| to finish and then reap it. |
| 158 BASE_EXPORT void EnsureProcessGetsReaped(ProcessHandle process_handle); | 157 BASE_EXPORT void EnsureProcessGetsReaped(ProcessHandle process_handle); |
| 159 #endif | 158 #endif |
| 160 | 159 |
| 161 } // namespace base | 160 } // namespace base |
| 162 | 161 |
| 163 #endif // BASE_PROCESS_KILL_H_ | 162 #endif // BASE_PROCESS_KILL_H_ |
| OLD | NEW |