Chromium Code Reviews| Index: base/task_scheduler/task_tracker.h |
| diff --git a/base/task_scheduler/task_tracker.h b/base/task_scheduler/task_tracker.h |
| index 8c19456e8772ed04407d5b078f0aad8753b45f37..5fdc50c6979779be0fa5cc27467e58b3b884ff18 100644 |
| --- a/base/task_scheduler/task_tracker.h |
| +++ b/base/task_scheduler/task_tracker.h |
| @@ -17,20 +17,29 @@ |
| #include "base/task_scheduler/sequence.h" |
| #include "base/task_scheduler/task.h" |
| #include "base/task_scheduler/task_traits.h" |
| +#include "build/build_config.h" |
| namespace base { |
| class ConditionVariable; |
| +class MessageLoopForIO; |
| class SequenceToken; |
| namespace internal { |
| // All tasks go through the scheduler's TaskTracker when they are posted and |
| -// when they are executed. The TaskTracker enforces shutdown semantics and takes |
| -// care of tracing and profiling. This class is thread-safe. |
| +// when they are executed. The TaskTracker sets up the environment to run a |
| +// task, enforces shutdown semantics and takes care of tracing and profiling. |
| +// This class is thread-safe. |
| class BASE_EXPORT TaskTracker { |
| public: |
| - TaskTracker(); |
| + // |watch_file_descriptor_message_loop| is used to initialize a |
| + // FileDescriptorWatcher in the scope in which a Task runs. |
| + TaskTracker( |
| +#if defined(OS_POSIX) && !defined(OS_NACL_SFI) |
| + MessageLoopForIO* watch_file_descriptor_message_loop |
|
gab
2016/10/18 14:40:43
It feels a bit intrusive to add this directly to T
fdoray
2016/10/18 15:30:43
We already register TaskRunner handles from TaskTr
|
| +#endif |
| + ); |
| ~TaskTracker(); |
| // Synchronously shuts down the scheduler. Once this is called, only tasks |
| @@ -131,6 +140,10 @@ class BASE_EXPORT TaskTracker { |
| // Number of BLOCK_SHUTDOWN tasks posted during shutdown. |
| HistogramBase::Sample num_block_shutdown_tasks_posted_during_shutdown_ = 0; |
| +#if defined(OS_POSIX) && !defined(OS_NACL_SFI) |
| + MessageLoopForIO* const watch_file_descriptor_message_loop_; |
| +#endif |
| + |
| DISALLOW_COPY_AND_ASSIGN(TaskTracker); |
| }; |