| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void Initialize( | 72 void Initialize( |
| 73 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector); | 73 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector); |
| 74 | 74 |
| 75 // Returns the worker pool that runs Tasks with |traits|. | 75 // Returns the worker pool that runs Tasks with |traits|. |
| 76 SchedulerWorkerPool* GetWorkerPoolForTraits(const TaskTraits& traits); | 76 SchedulerWorkerPool* GetWorkerPoolForTraits(const TaskTraits& traits); |
| 77 | 77 |
| 78 // Callback invoked when a non-single-thread |sequence| isn't empty after a | 78 // Callback invoked when a non-single-thread |sequence| isn't empty after a |
| 79 // worker pops a Task from it. | 79 // worker pops a Task from it. |
| 80 void ReEnqueueSequenceCallback(scoped_refptr<Sequence> sequence); | 80 void ReEnqueueSequenceCallback(scoped_refptr<Sequence> sequence); |
| 81 | 81 |
| 82 // Callback invoked when the delayed run time is changed from the | |
| 83 // DelayedTaskManager. | |
| 84 void OnDelayedRunTimeUpdated(); | |
| 85 | |
| 86 TaskTracker task_tracker_; | 82 TaskTracker task_tracker_; |
| 87 DelayedTaskManager delayed_task_manager_; | 83 Thread service_thread_; |
| 84 std::unique_ptr<DelayedTaskManager> delayed_task_manager_; |
| 88 const WorkerPoolIndexForTraitsCallback worker_pool_index_for_traits_callback_; | 85 const WorkerPoolIndexForTraitsCallback worker_pool_index_for_traits_callback_; |
| 89 std::vector<std::unique_ptr<SchedulerWorkerPoolImpl>> worker_pools_; | 86 std::vector<std::unique_ptr<SchedulerWorkerPoolImpl>> worker_pools_; |
| 90 std::unique_ptr<SchedulerServiceThread> service_thread_; | |
| 91 | 87 |
| 92 #if DCHECK_IS_ON() | 88 #if DCHECK_IS_ON() |
| 93 // Set once JoinForTesting() has returned. | 89 // Set once JoinForTesting() has returned. |
| 94 AtomicFlag join_for_testing_returned_; | 90 AtomicFlag join_for_testing_returned_; |
| 95 #endif | 91 #endif |
| 96 | 92 |
| 97 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); | 93 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); |
| 98 }; | 94 }; |
| 99 | 95 |
| 100 } // namespace internal | 96 } // namespace internal |
| 101 } // namespace base | 97 } // namespace base |
| 102 | 98 |
| 103 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 99 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
| OLD | NEW |