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

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

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « base/message_loop/message_pump_android.h ('k') | base/process/process.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 void TimerExpiredTask::TimedOut() { 68 void TimerExpiredTask::TimedOut() {
69 if (process_.IsValid()) 69 if (process_.IsValid())
70 KillProcess(); 70 KillProcess();
71 } 71 }
72 72
73 void TimerExpiredTask::OnObjectSignaled(HANDLE object) { 73 void TimerExpiredTask::OnObjectSignaled(HANDLE object) {
74 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. 74 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed.
75 tracked_objects::ScopedTracker tracking_profile( 75 tracked_objects::ScopedTracker tracking_profile(
76 FROM_HERE_WITH_EXPLICIT_FUNCTION("TimerExpiredTask_OnObjectSignaled")); 76 FROM_HERE_WITH_EXPLICIT_FUNCTION(
77 "418183 TimerExpiredTask::OnObjectSignaled"));
77 78
78 process_.Close(); 79 process_.Close();
79 } 80 }
80 81
81 void TimerExpiredTask::KillProcess() { 82 void TimerExpiredTask::KillProcess() {
82 // Stop watching the process handle since we're killing it. 83 // Stop watching the process handle since we're killing it.
83 watcher_.StopWatching(); 84 watcher_.StopWatching();
84 85
85 // OK, time to get frisky. We don't actually care when the process 86 // OK, time to get frisky. We don't actually care when the process
86 // terminates. We just care that it eventually terminates, and that's what 87 // terminates. We just care that it eventually terminates, and that's what
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 249 }
249 250
250 MessageLoop::current()->PostDelayedTask( 251 MessageLoop::current()->PostDelayedTask(
251 FROM_HERE, 252 FROM_HERE,
252 base::Bind(&TimerExpiredTask::TimedOut, 253 base::Bind(&TimerExpiredTask::TimedOut,
253 base::Owned(new TimerExpiredTask(process.Pass()))), 254 base::Owned(new TimerExpiredTask(process.Pass()))),
254 base::TimeDelta::FromMilliseconds(kWaitInterval)); 255 base::TimeDelta::FromMilliseconds(kWaitInterval));
255 } 256 }
256 257
257 } // namespace base 258 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_android.h ('k') | base/process/process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698