Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: base/process/kill_win.cc

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/process/kill_win.cc
diff --git a/base/process/kill_win.cc b/base/process/kill_win.cc
index 3c93047f5b04b3d0d5eb747f0021912c717a2ce1..0da3a26ae4f78e9af924609904e81db7872958e2 100644
--- a/base/process/kill_win.cc
+++ b/base/process/kill_win.cc
@@ -38,12 +38,12 @@ static const int kWaitInterval = 2000;
class TimerExpiredTask : public win::ObjectWatcher::Delegate {
public:
explicit TimerExpiredTask(Process process);
- ~TimerExpiredTask();
+ ~TimerExpiredTask() override;
void TimedOut();
// MessageLoop::Watcher -----------------------------------------------------
- virtual void OnObjectSignaled(HANDLE object);
+ void OnObjectSignaled(HANDLE object) override;
private:
void KillProcess();
@@ -81,7 +81,7 @@ void TimerExpiredTask::KillProcess() {
// terminates. We just care that it eventually terminates, and that's what
// TerminateProcess should do for us. Don't check for the result code since
// it fails quite often. This should be investigated eventually.
- base::KillProcess(process_.Handle(), kProcessKilledExitCode, false);
+ process_.Terminate(kProcessKilledExitCode, false);
// Now, just cleanup as if the process exited normally.
OnObjectSignaled(process_.Handle());
@@ -89,18 +89,6 @@ void TimerExpiredTask::KillProcess() {
} // namespace
-bool KillProcess(ProcessHandle process, int exit_code, bool wait) {
- bool result = (TerminateProcess(process, exit_code) != FALSE);
- if (result && wait) {
- // The process may not end immediately due to pending I/O
- if (WAIT_OBJECT_0 != WaitForSingleObject(process, 60 * 1000))
- DPLOG(ERROR) << "Error waiting for process exit";
- } else if (!result) {
- DPLOG(ERROR) << "Unable to terminate process";
- }
- return result;
-}
-
TerminationStatus GetTerminationStatus(ProcessHandle handle, int* exit_code) {
DWORD tmp_exit_code = 0;

Powered by Google App Engine
This is Rietveld 408576698