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

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

Issue 1092863002: Apply automated fixits for Chrome clang plugin to base_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix format Created 5 years, 8 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_win.h ('k') | base/sync_socket.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 20 matching lines...) Expand all
31 // indication that the task manager has killed something if the 31 // indication that the task manager has killed something if the
32 // process goes away. 32 // process goes away.
33 const DWORD kProcessKilledExitCode = 1; 33 const DWORD kProcessKilledExitCode = 1;
34 34
35 // Maximum amount of time (in milliseconds) to wait for the process to exit. 35 // Maximum amount of time (in milliseconds) to wait for the process to exit.
36 static const int kWaitInterval = 2000; 36 static const int kWaitInterval = 2000;
37 37
38 class TimerExpiredTask : public win::ObjectWatcher::Delegate { 38 class TimerExpiredTask : public win::ObjectWatcher::Delegate {
39 public: 39 public:
40 explicit TimerExpiredTask(Process process); 40 explicit TimerExpiredTask(Process process);
41 ~TimerExpiredTask(); 41 ~TimerExpiredTask() override;
42 42
43 void TimedOut(); 43 void TimedOut();
44 44
45 // MessageLoop::Watcher ----------------------------------------------------- 45 // MessageLoop::Watcher -----------------------------------------------------
46 virtual void OnObjectSignaled(HANDLE object); 46 void OnObjectSignaled(HANDLE object) override;
47 47
48 private: 48 private:
49 void KillProcess(); 49 void KillProcess();
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);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 MessageLoop::current()->PostDelayedTask( 191 MessageLoop::current()->PostDelayedTask(
192 FROM_HERE, 192 FROM_HERE,
193 Bind(&TimerExpiredTask::TimedOut, 193 Bind(&TimerExpiredTask::TimedOut,
194 Owned(new TimerExpiredTask(process.Pass()))), 194 Owned(new TimerExpiredTask(process.Pass()))),
195 TimeDelta::FromMilliseconds(kWaitInterval)); 195 TimeDelta::FromMilliseconds(kWaitInterval));
196 } 196 }
197 197
198 } // namespace base 198 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_win.h ('k') | base/sync_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698