| 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 #ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 5 #ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
| 6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void FlushForTesting() override; | 64 void FlushForTesting() override; |
| 65 void JoinForTesting() override; | 65 void JoinForTesting() override; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 // Returns the worker pool that runs Tasks with |traits|. | 68 // Returns the worker pool that runs Tasks with |traits|. |
| 69 SchedulerWorkerPoolImpl* GetWorkerPoolForTraits( | 69 SchedulerWorkerPoolImpl* GetWorkerPoolForTraits( |
| 70 const TaskTraits& traits) const; | 70 const TaskTraits& traits) const; |
| 71 | 71 |
| 72 const std::string name_; | 72 const std::string name_; |
| 73 Thread service_thread_; | 73 Thread service_thread_; |
| 74 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) | 74 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) && !defined(OS_FUCHSIA) |
| 75 TaskTrackerPosix task_tracker_; | 75 TaskTrackerPosix task_tracker_; |
| 76 #else | 76 #else |
| 77 TaskTracker task_tracker_; | 77 TaskTracker task_tracker_; |
| 78 #endif | 78 #endif |
| 79 DelayedTaskManager delayed_task_manager_; | 79 DelayedTaskManager delayed_task_manager_; |
| 80 SchedulerSingleThreadTaskRunnerManager single_thread_task_runner_manager_; | 80 SchedulerSingleThreadTaskRunnerManager single_thread_task_runner_manager_; |
| 81 | 81 |
| 82 // There are 4 SchedulerWorkerPoolImpl in this array to match the 4 | 82 // There are 4 SchedulerWorkerPoolImpl in this array to match the 4 |
| 83 // SchedulerWorkerPoolParams in TaskScheduler::InitParams. | 83 // SchedulerWorkerPoolParams in TaskScheduler::InitParams. |
| 84 std::unique_ptr<SchedulerWorkerPoolImpl> worker_pools_[4]; | 84 std::unique_ptr<SchedulerWorkerPoolImpl> worker_pools_[4]; |
| 85 | 85 |
| 86 #if DCHECK_IS_ON() | 86 #if DCHECK_IS_ON() |
| 87 // Set once JoinForTesting() has returned. | 87 // Set once JoinForTesting() has returned. |
| 88 AtomicFlag join_for_testing_returned_; | 88 AtomicFlag join_for_testing_returned_; |
| 89 #endif | 89 #endif |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); | 91 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace internal | 94 } // namespace internal |
| 95 } // namespace base | 95 } // namespace base |
| 96 | 96 |
| 97 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 97 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
| OLD | NEW |