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

Unified Diff: base/task_scheduler/task_tracker.h

Issue 2427963002: Support FileDescriptorWatcher in TaskScheduler. (Closed)
Patch Set: nacl Created 4 years, 2 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 | « base/task_scheduler/task_scheduler_impl.cc ('k') | base/task_scheduler/task_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « base/task_scheduler/task_scheduler_impl.cc ('k') | base/task_scheduler/task_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698