OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/task_scheduler/task_tracker_posix.h" | 5 #include "base/task_scheduler/task_tracker_posix.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_descriptor_watcher_posix.h" | 9 #include "base/files/file_descriptor_watcher_posix.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 TaskTrackerPosix::TaskTrackerPosix( | 15 TaskTrackerPosix::TaskTrackerPosix() = default; |
16 MessageLoopForIO* watch_file_descriptor_message_loop) | 16 TaskTrackerPosix::~TaskTrackerPosix() = default; |
17 : watch_file_descriptor_message_loop_(watch_file_descriptor_message_loop) { | 17 |
18 DCHECK(watch_file_descriptor_message_loop_); | 18 void TaskTrackerPosix::Start( |
| 19 MessageLoopForIO* watch_file_descriptor_message_loop) { |
| 20 DCHECK(watch_file_descriptor_message_loop); |
| 21 watch_file_descriptor_message_loop_ = watch_file_descriptor_message_loop_; |
19 } | 22 } |
20 | 23 |
21 TaskTrackerPosix::~TaskTrackerPosix() = default; | |
22 | |
23 void TaskTrackerPosix::PerformRunTask(std::unique_ptr<Task> task) { | 24 void TaskTrackerPosix::PerformRunTask(std::unique_ptr<Task> task) { |
| 25 DCHECK(watch_file_descriptor_message_loop_); |
24 FileDescriptorWatcher file_descriptor_watcher( | 26 FileDescriptorWatcher file_descriptor_watcher( |
25 watch_file_descriptor_message_loop_); | 27 watch_file_descriptor_message_loop_); |
26 TaskTracker::PerformRunTask(std::move(task)); | 28 TaskTracker::PerformRunTask(std::move(task)); |
27 } | 29 } |
28 | 30 |
29 } // namespace internal | 31 } // namespace internal |
30 } // namespace base | 32 } // namespace base |
OLD | NEW |