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

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

Issue 2859053006: Use constexpr TaskTraits constructor in base (part 2). (Closed)
Patch Set: self-review Created 3 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 unified diff | Download patch
« no previous file with comments | « base/observer_list_unittest.cc ('k') | base/task_scheduler/post_task.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 <windows.h> 7 #include <windows.h>
8 #include <io.h> 8 #include <io.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 void EnsureProcessTerminated(Process process) { 138 void EnsureProcessTerminated(Process process) {
139 DCHECK(!process.is_current()); 139 DCHECK(!process.is_current());
140 140
141 // If already signaled, then we are done! 141 // If already signaled, then we are done!
142 if (WaitForSingleObject(process.Handle(), 0) == WAIT_OBJECT_0) 142 if (WaitForSingleObject(process.Handle(), 0) == WAIT_OBJECT_0)
143 return; 143 return;
144 144
145 PostDelayedTaskWithTraits( 145 PostDelayedTaskWithTraits(
146 FROM_HERE, 146 FROM_HERE,
147 TaskTraits() 147 {TaskPriority::BACKGROUND, TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
148 .WithPriority(TaskPriority::BACKGROUND)
149 .WithShutdownBehavior(TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
150 Bind( 148 Bind(
151 [](Process process) { 149 [](Process process) {
152 if (WaitForSingleObject(process.Handle(), 0) == WAIT_OBJECT_0) 150 if (WaitForSingleObject(process.Handle(), 0) == WAIT_OBJECT_0)
153 return; 151 return;
154 process.Terminate(kProcessKilledExitCode, false); 152 process.Terminate(kProcessKilledExitCode, false);
155 }, 153 },
156 Passed(&process)), 154 Passed(&process)),
157 TimeDelta::FromSeconds(2)); 155 TimeDelta::FromSeconds(2));
158 } 156 }
159 157
160 } // namespace base 158 } // namespace base
OLDNEW
« no previous file with comments | « base/observer_list_unittest.cc ('k') | base/task_scheduler/post_task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698