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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const Closure& task) override; | 55 const Closure& task) override; |
56 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( | 56 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( |
57 const TaskTraits& traits) override; | 57 const TaskTraits& traits) override; |
58 scoped_refptr<SequencedTaskRunner> CreateSequencedTaskRunnerWithTraits( | 58 scoped_refptr<SequencedTaskRunner> CreateSequencedTaskRunnerWithTraits( |
59 const TaskTraits& traits) override; | 59 const TaskTraits& traits) override; |
60 scoped_refptr<SingleThreadTaskRunner> CreateSingleThreadTaskRunnerWithTraits( | 60 scoped_refptr<SingleThreadTaskRunner> CreateSingleThreadTaskRunnerWithTraits( |
61 const TaskTraits& traits) override; | 61 const TaskTraits& traits) override; |
62 std::vector<const HistogramBase*> GetHistograms() const override; | 62 std::vector<const HistogramBase*> GetHistograms() const override; |
63 void Shutdown() override; | 63 void Shutdown() override; |
64 void FlushForTesting() override; | 64 void FlushForTesting() override; |
65 | 65 void JoinForTesting() override; |
66 // Joins all threads of this scheduler. Tasks that are already running are | |
67 // allowed to complete their execution. This can only be called once. | |
68 void JoinForTesting(); | |
69 | 66 |
70 private: | 67 private: |
71 explicit TaskSchedulerImpl(const WorkerPoolIndexForTraitsCallback& | 68 explicit TaskSchedulerImpl(const WorkerPoolIndexForTraitsCallback& |
72 worker_pool_index_for_traits_callback); | 69 worker_pool_index_for_traits_callback); |
73 | 70 |
74 void Initialize( | 71 void Initialize( |
75 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector); | 72 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector); |
76 | 73 |
77 // Returns the worker pool that runs Tasks with |traits|. | 74 // Returns the worker pool that runs Tasks with |traits|. |
78 SchedulerWorkerPool* GetWorkerPoolForTraits(const TaskTraits& traits); | 75 SchedulerWorkerPool* GetWorkerPoolForTraits(const TaskTraits& traits); |
(...skipping 13 matching lines...) Expand all Loading... |
92 AtomicFlag join_for_testing_returned_; | 89 AtomicFlag join_for_testing_returned_; |
93 #endif | 90 #endif |
94 | 91 |
95 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); | 92 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); |
96 }; | 93 }; |
97 | 94 |
98 } // namespace internal | 95 } // namespace internal |
99 } // namespace base | 96 } // namespace base |
100 | 97 |
101 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 98 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
OLD | NEW |