| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 ~TaskSchedulerImpl() override; | 52 ~TaskSchedulerImpl() override; |
| 53 | 53 |
| 54 // TaskScheduler: | 54 // TaskScheduler: |
| 55 void PostTaskWithTraits(const tracked_objects::Location& from_here, | 55 void PostTaskWithTraits(const tracked_objects::Location& from_here, |
| 56 const TaskTraits& traits, | 56 const TaskTraits& traits, |
| 57 const Closure& task) override; | 57 const Closure& task) override; |
| 58 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( | 58 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( |
| 59 const TaskTraits& traits, | 59 const TaskTraits& traits, |
| 60 ExecutionMode execution_mode) override; | 60 ExecutionMode execution_mode) override; |
| 61 void Shutdown() override; | 61 void Shutdown() override; |
| 62 void FlushForTesting() override; |
| 62 | 63 |
| 63 // Joins all threads of this scheduler. Tasks that are already running are | 64 // Joins all threads of this scheduler. Tasks that are already running are |
| 64 // allowed to complete their execution. This can only be called once. | 65 // allowed to complete their execution. This can only be called once. |
| 65 void JoinForTesting(); | 66 void JoinForTesting(); |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 explicit TaskSchedulerImpl(const WorkerPoolIndexForTraitsCallback& | 69 explicit TaskSchedulerImpl(const WorkerPoolIndexForTraitsCallback& |
| 69 worker_pool_index_for_traits_callback); | 70 worker_pool_index_for_traits_callback); |
| 70 | 71 |
| 71 void Initialize( | 72 void Initialize( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 93 AtomicFlag join_for_testing_returned_; | 94 AtomicFlag join_for_testing_returned_; |
| 94 #endif | 95 #endif |
| 95 | 96 |
| 96 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); | 97 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 } // namespace internal | 100 } // namespace internal |
| 100 } // namespace base | 101 } // namespace base |
| 101 | 102 |
| 102 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ | 103 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ |
| OLD | NEW |