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

Unified Diff: base/process/kill_win.cc

Issue 2598483004: Use TaskScheduler in EnsureProcessTerminated(). (Closed)
Patch Set: Use PostDelayedTaskWithTraits. Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/kill_win.cc
diff --git a/base/process/kill_win.cc b/base/process/kill_win.cc
index ecb08421cfa2309e455f428174b8112ed7891561..7b0921d5b3594382dd781d35fac84c6c54e3db8b 100644
--- a/base/process/kill_win.cc
+++ b/base/process/kill_win.cc
@@ -17,7 +17,7 @@
#include "base/macros.h"
#include "base/process/memory.h"
#include "base/process/process_iterator.h"
-#include "base/threading/thread_task_runner_handle.h"
+#include "base/task_scheduler/post_task.h"
#include "base/win/object_watcher.h"
namespace base {
@@ -196,13 +196,16 @@ void EnsureProcessTerminated(Process process) {
DCHECK(!process.is_current());
// If already signaled, then we are done!
- if (WaitForSingleObject(process.Handle(), 0) == WAIT_OBJECT_0) {
+ if (WaitForSingleObject(process.Handle(), 0) == WAIT_OBJECT_0)
return;
- }
- ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, Bind(&TimerExpiredTask::TimedOut,
- Owned(new TimerExpiredTask(std::move(process)))),
gab 2017/01/09 17:36:38 TimerExpiredTask::watcher_::task_runner_ is set to
fdoray 2017/01/09 21:16:49 Done.
+ PostDelayedTaskWithTraits(
+ FROM_HERE,
+ TaskTraits()
+ .WithPriority(TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ Bind(&TimerExpiredTask::TimedOut,
+ Owned(new TimerExpiredTask(std::move(process)))),
gab 2017/01/09 17:36:38 Passed(MakeUnique(...)) instead of Owned(new ...)
fdoray 2017/01/09 21:16:49 n/a
TimeDelta::FromMilliseconds(kWaitInterval));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698