Index: base/task_scheduler/task_traits.cc |
diff --git a/base/task_scheduler/task_traits.cc b/base/task_scheduler/task_traits.cc |
index 9ebe821c827954be33cca6645924469db7495857..3cd6a61da69d2ada418db6e05f9d810f4a29be8b 100644 |
--- a/base/task_scheduler/task_traits.cc |
+++ b/base/task_scheduler/task_traits.cc |
@@ -17,23 +17,31 @@ namespace base { |
// the header; anything else is subject to change. Tasks should explicitly |
// request defaults if the behavior is critical to the task. |
gab
2016/12/19 20:20:14
Move this comment and member initialization to mem
fdoray
2016/12/19 21:22:43
Unfortunately, these is an include cycle if I incl
|
TaskTraits::TaskTraits() |
- : with_file_io_(false), |
- with_wait_(false), |
+ : may_block_(false), |
+ with_sync_primitives_(false), |
priority_(internal::GetTaskPriorityForCurrentThread()), |
shutdown_behavior_(TaskShutdownBehavior::SKIP_ON_SHUTDOWN) {} |
TaskTraits::~TaskTraits() = default; |
-TaskTraits& TaskTraits::WithFileIO() { |
- with_file_io_ = true; |
+TaskTraits& TaskTraits::MayBlock() { |
+ may_block_ = true; |
return *this; |
} |
-TaskTraits& TaskTraits::WithWait() { |
- with_wait_ = true; |
+TaskTraits& TaskTraits::WithSyncPrimitives() { |
+ with_sync_primitives_ = true; |
return *this; |
} |
+TaskTraits& TaskTraits::WithFileIO() { |
+ return MayBlock(); |
+} |
+ |
+TaskTraits& TaskTraits::WithWait() { |
+ return MayBlock().WithSyncPrimitives(); |
+} |
+ |
TaskTraits& TaskTraits::WithPriority(TaskPriority priority) { |
priority_ = priority; |
return *this; |