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

Unified Diff: base/task_scheduler/task_traits.cc

Issue 2531663003: TaskScheduler: Add TaskTraits::WithWait(). (Closed)
Patch Set: CR danakj #22 (AssertWaitAllowed) Created 4 years, 1 month 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 | « base/task_scheduler/task_traits.h ('k') | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_traits.cc
diff --git a/base/task_scheduler/task_traits.cc b/base/task_scheduler/task_traits.cc
index 10cbe68efcfc4c97d14be08848ad54ba7d68ce95..437189c05d44fa824ba471a8f42b0fabde647b23 100644
--- a/base/task_scheduler/task_traits.cc
+++ b/base/task_scheduler/task_traits.cc
@@ -17,6 +17,7 @@ namespace base {
// request defaults if the behavior is critical to the task.
TaskTraits::TaskTraits()
: with_file_io_(false),
+ with_wait_(false),
priority_(TaskPriority::BACKGROUND),
shutdown_behavior_(TaskShutdownBehavior::SKIP_ON_SHUTDOWN) {}
@@ -27,6 +28,11 @@ TaskTraits& TaskTraits::WithFileIO() {
return *this;
}
+TaskTraits& TaskTraits::WithWait() {
+ with_wait_ = true;
+ return *this;
+}
+
TaskTraits& TaskTraits::WithPriority(TaskPriority priority) {
priority_ = priority;
return *this;
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698