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 #include "base/task_scheduler/task_scheduler_impl.h" | 5 #include "base/task_scheduler/task_scheduler_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 background_file_io_thread_pool_->JoinForTesting(); | 61 background_file_io_thread_pool_->JoinForTesting(); |
62 normal_thread_pool_->JoinForTesting(); | 62 normal_thread_pool_->JoinForTesting(); |
63 normal_file_io_thread_pool_->JoinForTesting(); | 63 normal_file_io_thread_pool_->JoinForTesting(); |
64 service_thread_->JoinForTesting(); | 64 service_thread_->JoinForTesting(); |
65 #if DCHECK_IS_ON() | 65 #if DCHECK_IS_ON() |
66 join_for_testing_returned_.Signal(); | 66 join_for_testing_returned_.Signal(); |
67 #endif | 67 #endif |
68 } | 68 } |
69 | 69 |
70 TaskSchedulerImpl::TaskSchedulerImpl() | 70 TaskSchedulerImpl::TaskSchedulerImpl() |
71 : delayed_task_manager_(Bind(&TaskSchedulerImpl::OnDelayedRunTimeUpdated, | 71 : delayed_task_manager_( |
72 Unretained(this))) | 72 Bind(&TaskSchedulerImpl::OnDelayedRunTimeUpdated, Unretained(this))) |
73 #if DCHECK_IS_ON() | 73 #if DCHECK_IS_ON() |
74 , | 74 , |
75 join_for_testing_returned_(true, false) | 75 join_for_testing_returned_(WaitableEvent::ResetPolicy::MANUAL, |
| 76 WaitableEvent::InitialState::NOT_SIGNALED) |
76 #endif | 77 #endif |
77 { | 78 { |
78 } | 79 } |
79 | 80 |
80 void TaskSchedulerImpl::Initialize() { | 81 void TaskSchedulerImpl::Initialize() { |
81 using IORestriction = SchedulerThreadPoolImpl::IORestriction; | 82 using IORestriction = SchedulerThreadPoolImpl::IORestriction; |
82 | 83 |
83 const SchedulerThreadPoolImpl::ReEnqueueSequenceCallback | 84 const SchedulerThreadPoolImpl::ReEnqueueSequenceCallback |
84 re_enqueue_sequence_callback = | 85 re_enqueue_sequence_callback = |
85 Bind(&TaskSchedulerImpl::ReEnqueueSequenceCallback, Unretained(this)); | 86 Bind(&TaskSchedulerImpl::ReEnqueueSequenceCallback, Unretained(this)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 GetThreadPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence), | 148 GetThreadPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence), |
148 sort_key); | 149 sort_key); |
149 } | 150 } |
150 | 151 |
151 void TaskSchedulerImpl::OnDelayedRunTimeUpdated() { | 152 void TaskSchedulerImpl::OnDelayedRunTimeUpdated() { |
152 service_thread_->WakeUp(); | 153 service_thread_->WakeUp(); |
153 } | 154 } |
154 | 155 |
155 } // namespace internal | 156 } // namespace internal |
156 } // namespace base | 157 } // namespace base |
OLD | NEW |