Home | History | Annotate | Download | only in process

Lines Matching full:process

5 #include "base/process/kill.h"
14 #include "base/process/process_iterator.h"
28 // process. It's value is obviously not that unique, and it's
32 // process goes away.
35 // Maximum amount of time (in milliseconds) to wait for the process to exit.
40 explicit TimerExpiredTask(ProcessHandle process);
51 // The process that we are watching.
59 TimerExpiredTask::TimerExpiredTask(ProcessHandle process) : process_(process) {
79 // Stop watching the process handle since we're killing it.
82 // OK, time to get frisky. We don't actually care when the process
88 // Now, just cleanup as if the process exited normally.
94 bool KillProcess(ProcessHandle process, int exit_code, bool wait) {
95 bool result = (TerminateProcess(process, exit_code) != FALSE);
97 // The process may not end immediately due to pending I/O
98 if (WAIT_OBJECT_0 != WaitForSingleObject(process, 60 * 1000))
99 DPLOG(ERROR) << "Error waiting for process exit";
101 DPLOG(ERROR) << "Unable to terminate process";
106 // Attempts to kill the process identified by the given process
110 HANDLE process = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE,
113 if (!process) {
114 DPLOG(ERROR) << "Unable to open process " << process_id;
117 bool ret = KillProcess(process, exit_code, wait);
118 CloseHandle(process);
130 // process doesn't have permission to get the exit code, or
156 // Strange, the process used 0x103 (STILL_ACTIVE) as exit code.
171 case kDebuggerTerminatedExitCode: // Debugger terminated process.
211 HANDLE process = OpenProcess(SYNCHRONIZE,
214 DWORD wait_result = WaitForSingleObject(process, remaining_wait);
215 CloseHandle(process);
239 void EnsureProcessTerminated(ProcessHandle process) {
240 DCHECK(process != GetCurrentProcess());
243 if (WaitForSingleObject(process, 0) == WAIT_OBJECT_0) {
244 CloseHandle(process);
251 base::Owned(new TimerExpiredTask(process))),