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

Unified Diff: base/process/kill_win.cc

Issue 2598483004: Use TaskScheduler in EnsureProcessTerminated(). (Closed)
Patch Set: Created 4 years 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..dff7ad0e814bf72d280522b6675743887797edbb 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,14 +196,15 @@ 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)))),
- TimeDelta::FromMilliseconds(kWaitInterval));
+ CreateTaskRunnerWithTraits(
gab 2016/12/22 20:23:02 Should we add PostDelayedTaskWithTraits()?
fdoray 2017/01/06 17:36:48 Done.
+ TaskTraits().WithPriority(TaskPriority::BACKGROUND))
+ ->PostDelayedTask(FROM_HERE,
+ Bind(&TimerExpiredTask::TimedOut,
+ Owned(new TimerExpiredTask(std::move(process)))),
+ TimeDelta::FromMilliseconds(kWaitInterval));
}
} // namespace base
« 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