Chromium Code Reviews| 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..29de748d2d0d31ff55643058487d7da93b6e0cdf |
| --- /dev/null |
| +++ b/base/task_scheduler/task_tracker_posix.h |
| @@ -0,0 +1,42 @@ |
| +// 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/macros.h" |
| +#include "base/task_scheduler/task_tracker.h" |
| + |
| +namespace base { |
| + |
| +class MessageLoopForIO; |
| + |
| +namespace internal { |
| + |
| +struct Task; |
| + |
| +// A TaskTracker that performs POSIX-specific work before running a task. |
| +class BASE_EXPORT TaskTrackerPosix : public TaskTracker { |
|
robliao
2016/10/20 00:59:40
Is a BASE_EXPORT currently required for TaskTracke
fdoray
2016/10/21 12:29:43
Done.
|
| + 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); |
| + |
|
robliao
2016/10/20 00:59:40
Nit: No line break needed here.
fdoray
2016/10/21 12:29:43
Done.
|
| + ~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_ |