| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ |
| 6 #define BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/base_export.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/task_scheduler/task_tracker.h" |
| 13 |
| 14 namespace base { |
| 15 |
| 16 class MessageLoopForIO; |
| 17 |
| 18 namespace internal { |
| 19 |
| 20 struct Task; |
| 21 |
| 22 // A TaskTracker that instantiates a FileDescriptorWatcher in the scope in which |
| 23 // a task runs. Used on all POSIX platforms except NaCl SFI. |
| 24 class BASE_EXPORT TaskTrackerPosix : public TaskTracker { |
| 25 public: |
| 26 // |watch_file_descriptor_message_loop| is used to setup FileDescriptorWatcher |
| 27 // in the scope in which a Task runs. |
| 28 TaskTrackerPosix(MessageLoopForIO* watch_file_descriptor_message_loop); |
| 29 ~TaskTrackerPosix(); |
| 30 |
| 31 private: |
| 32 // TaskTracker: |
| 33 void PerformRunTask(std::unique_ptr<Task> task) override; |
| 34 |
| 35 MessageLoopForIO* const watch_file_descriptor_message_loop_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(TaskTrackerPosix); |
| 38 }; |
| 39 |
| 40 } // namespace internal |
| 41 } // namespace base |
| 42 |
| 43 #endif // BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ |
| OLD | NEW |