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

Unified Diff: base/task_scheduler/task_tracker_posix.h

Issue 2427963002: Support FileDescriptorWatcher in TaskScheduler. (Closed)
Patch Set: fix build error (add BASE_EXPORT) 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_tracker.cc ('k') | base/task_scheduler/task_tracker_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_tracker_posix.h
diff --git a/base/task_scheduler/task_tracker_posix.h b/base/task_scheduler/task_tracker_posix.h
new file mode 100644
index 0000000000000000000000000000000000000000..f957e4c0daf4d8b402a9b0ef413365b48955be90
--- /dev/null
+++ b/base/task_scheduler/task_tracker_posix.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_
+#define BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_
+
+#include <memory>
+
+#include "base/base_export.h"
+#include "base/macros.h"
+#include "base/task_scheduler/task_tracker.h"
+
+namespace base {
+
+class MessageLoopForIO;
+
+namespace internal {
+
+struct Task;
+
+// A TaskTracker that instantiates a FileDescriptorWatcher in the scope in which
+// a task runs. Used on all POSIX platforms except NaCl SFI.
+class BASE_EXPORT TaskTrackerPosix : public TaskTracker {
+ public:
+ // |watch_file_descriptor_message_loop| is used to setup FileDescriptorWatcher
+ // in the scope in which a Task runs.
+ TaskTrackerPosix(MessageLoopForIO* watch_file_descriptor_message_loop);
+ ~TaskTrackerPosix();
+
+ private:
+ // TaskTracker:
+ void PerformRunTask(std::unique_ptr<Task> task) override;
+
+ MessageLoopForIO* const watch_file_descriptor_message_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(TaskTrackerPosix);
+};
+
+} // namespace internal
+} // namespace base
+
+#endif // BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_
« no previous file with comments | « base/task_scheduler/task_tracker.cc ('k') | base/task_scheduler/task_tracker_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698