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

Side by Side Diff: base/process/kill_win.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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 unified diff | Download patch
OLDNEW
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 #include "base/process/kill.h" 5 #include "base/process/kill.h"
6 6
7 #include <io.h> 7 #include <io.h>
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // The process that we are watching. 51 // The process that we are watching.
52 Process process_; 52 Process process_;
53 53
54 win::ObjectWatcher watcher_; 54 win::ObjectWatcher watcher_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(TimerExpiredTask); 56 DISALLOW_COPY_AND_ASSIGN(TimerExpiredTask);
57 }; 57 };
58 58
59 TimerExpiredTask::TimerExpiredTask(Process process) : process_(process.Pass()) { 59 TimerExpiredTask::TimerExpiredTask(Process process) : process_(process.Pass()) {
60 watcher_.StartWatching(process_.Handle(), this); 60 watcher_.StartWatching(process_.Handle(), this, false);
61 } 61 }
62 62
63 TimerExpiredTask::~TimerExpiredTask() { 63 TimerExpiredTask::~TimerExpiredTask() {
64 TimedOut(); 64 TimedOut();
65 } 65 }
66 66
67 void TimerExpiredTask::TimedOut() { 67 void TimerExpiredTask::TimedOut() {
68 if (process_.IsValid()) 68 if (process_.IsValid())
69 KillProcess(); 69 KillProcess();
70 } 70 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 MessageLoop::current()->PostDelayedTask( 188 MessageLoop::current()->PostDelayedTask(
189 FROM_HERE, 189 FROM_HERE,
190 Bind(&TimerExpiredTask::TimedOut, 190 Bind(&TimerExpiredTask::TimedOut,
191 Owned(new TimerExpiredTask(process.Pass()))), 191 Owned(new TimerExpiredTask(process.Pass()))),
192 TimeDelta::FromMilliseconds(kWaitInterval)); 192 TimeDelta::FromMilliseconds(kWaitInterval));
193 } 193 }
194 194
195 } // namespace base 195 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698