| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/base_export.h" | 14 #include "base/base_export.h" |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/synchronization/atomic_flag.h" | 19 #include "base/synchronization/atomic_flag.h" |
| 20 #include "base/task_runner.h" | 20 #include "base/task_runner.h" |
| 21 #include "base/task_scheduler/delayed_task_manager.h" | 21 #include "base/task_scheduler/delayed_task_manager.h" |
| 22 #include "base/task_scheduler/scheduler_worker_pool_impl.h" | 22 #include "base/task_scheduler/scheduler_worker_pool_impl.h" |
| 23 #include "base/task_scheduler/sequence.h" | 23 #include "base/task_scheduler/sequence.h" |
| 24 #include "base/task_scheduler/task_scheduler.h" | 24 #include "base/task_scheduler/task_scheduler.h" |
| 25 #include "base/task_scheduler/task_tracker.h" | 25 #include "base/task_scheduler/task_tracker.h" |
| 26 #include "base/task_scheduler/task_traits.h" | 26 #include "base/task_scheduler/task_traits.h" |
| 27 #include "base/threading/thread.h" | 27 #include "base/threading/thread.h" |
| 28 | 28 |
| 29 namespace base { | 29 namespace base { |
| 30 |
| 31 class SchedulerWorkerPoolParams; |
| 32 |
| 30 namespace internal { | 33 namespace internal { |
| 31 | 34 |
| 32 class SchedulerServiceThread; | 35 class SchedulerServiceThread; |
| 33 class SchedulerWorkerPoolParams; | |
| 34 | 36 |
| 35 // Default TaskScheduler implementation. This class is thread-safe. | 37 // Default TaskScheduler implementation. This class is thread-safe. |
| 36 class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler { | 38 class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler { |
| 37 public: | 39 public: |
| 38 // Returns the index of the worker pool in which a task with |traits| should | 40 // Returns the index of the worker pool in which a task with |traits| should |
| 39 // run. This should be coded in a future-proof way: new traits should | 41 // run. This should be coded in a future-proof way: new traits should |
| 40 // gracefully map to a default pool. | 42 // gracefully map to a default pool. |
| 41 using WorkerPoolIndexForTraitsCallback = | 43 using WorkerPoolIndexForTraitsCallback = |
| 42 Callback<size_t(const TaskTraits& traits)>; | 44 Callback<size_t(const TaskTraits& traits)>; |
| 43 | 45 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 AtomicFlag join_for_testing_returned_; | 99 AtomicFlag join_for_testing_returned_; |
| 98 #endif | 100 #endif |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); | 102 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace internal | 105 } // namespace internal |
| 104 } // namespace base | 106 } // namespace base |
| 105 | 107 |
| 106 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 108 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
| OLD | NEW |