| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 explicit TaskSchedulerImpl(const std::string& name); | 73 explicit TaskSchedulerImpl(const std::string& name); |
| 74 | 74 |
| 75 void Initialize(const TaskScheduler::InitParams& init_params); | 75 void Initialize(const TaskScheduler::InitParams& init_params); |
| 76 | 76 |
| 77 // Returns the worker pool that runs Tasks with |traits|. | 77 // Returns the worker pool that runs Tasks with |traits|. |
| 78 SchedulerWorkerPoolImpl* GetWorkerPoolForTraits( | 78 SchedulerWorkerPoolImpl* GetWorkerPoolForTraits( |
| 79 const TaskTraits& traits) const; | 79 const TaskTraits& traits) const; |
| 80 | 80 |
| 81 // Callback invoked when a non-single-thread |sequence| isn't empty after a | |
| 82 // worker pops a Task from it. | |
| 83 void ReEnqueueSequenceCallback(scoped_refptr<Sequence> sequence); | |
| 84 | |
| 85 const std::string name_; | 81 const std::string name_; |
| 86 Thread service_thread_; | 82 Thread service_thread_; |
| 87 std::unique_ptr<TaskTracker> task_tracker_; | 83 std::unique_ptr<TaskTracker> task_tracker_; |
| 88 std::unique_ptr<DelayedTaskManager> delayed_task_manager_; | 84 std::unique_ptr<DelayedTaskManager> delayed_task_manager_; |
| 89 std::unique_ptr<SchedulerSingleThreadTaskRunnerManager> | 85 std::unique_ptr<SchedulerSingleThreadTaskRunnerManager> |
| 90 single_thread_task_runner_manager_; | 86 single_thread_task_runner_manager_; |
| 91 std::unique_ptr<SchedulerWorkerPoolImpl> worker_pools_[4]; | 87 std::unique_ptr<SchedulerWorkerPoolImpl> worker_pools_[4]; |
| 92 | 88 |
| 93 #if DCHECK_IS_ON() | 89 #if DCHECK_IS_ON() |
| 94 // Set once JoinForTesting() has returned. | 90 // Set once JoinForTesting() has returned. |
| 95 AtomicFlag join_for_testing_returned_; | 91 AtomicFlag join_for_testing_returned_; |
| 96 #endif | 92 #endif |
| 97 | 93 |
| 98 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); | 94 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); |
| 99 }; | 95 }; |
| 100 | 96 |
| 101 } // namespace internal | 97 } // namespace internal |
| 102 } // namespace base | 98 } // namespace base |
| 103 | 99 |
| 104 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 100 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
| OLD | NEW |