| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/scheduler/child/scheduler_helper.h" | 5 #include "components/scheduler/child/scheduler_helper.h" |
| 6 | 6 |
| 7 #include "base/time/default_tick_clock.h" | 7 #include "base/time/default_tick_clock.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
| 10 #include "components/scheduler/base/task_queue_impl.h" | 10 #include "components/scheduler/base/task_queue_impl.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 TaskQueueManager* SchedulerHelper::GetTaskQueueManagerForTesting() { | 89 TaskQueueManager* SchedulerHelper::GetTaskQueueManagerForTesting() { |
| 90 CheckOnValidThread(); | 90 CheckOnValidThread(); |
| 91 return task_queue_manager_.get(); | 91 return task_queue_manager_.get(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 const scoped_refptr<SchedulerTqmDelegate>& | 94 const scoped_refptr<SchedulerTqmDelegate>& |
| 95 SchedulerHelper::scheduler_tqm_delegate() const { | 95 SchedulerHelper::scheduler_tqm_delegate() const { |
| 96 return task_queue_manager_delegate_; | 96 return task_queue_manager_delegate_; |
| 97 } | 97 } |
| 98 | 98 |
| 99 base::TimeTicks SchedulerHelper::NextPendingDelayedTaskRunTime() const { | |
| 100 CheckOnValidThread(); | |
| 101 DCHECK(task_queue_manager_.get()); | |
| 102 return task_queue_manager_->NextPendingDelayedTaskRunTime(); | |
| 103 } | |
| 104 | 99 |
| 105 bool SchedulerHelper::GetAndClearSystemIsQuiescentBit() { | 100 bool SchedulerHelper::GetAndClearSystemIsQuiescentBit() { |
| 106 CheckOnValidThread(); | 101 CheckOnValidThread(); |
| 107 DCHECK(task_queue_manager_.get()); | 102 DCHECK(task_queue_manager_.get()); |
| 108 return task_queue_manager_->GetAndClearSystemIsQuiescentBit(); | 103 return task_queue_manager_->GetAndClearSystemIsQuiescentBit(); |
| 109 } | 104 } |
| 110 | 105 |
| 111 void SchedulerHelper::AddTaskObserver( | 106 void SchedulerHelper::AddTaskObserver( |
| 112 base::MessageLoop::TaskObserver* task_observer) { | 107 base::MessageLoop::TaskObserver* task_observer) { |
| 113 CheckOnValidThread(); | 108 CheckOnValidThread(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 128 DCHECK(task_queue_manager_); | 123 DCHECK(task_queue_manager_); |
| 129 task_queue_manager_->SetObserver(this); | 124 task_queue_manager_->SetObserver(this); |
| 130 } | 125 } |
| 131 | 126 |
| 132 void SchedulerHelper::OnUnregisterTaskQueue( | 127 void SchedulerHelper::OnUnregisterTaskQueue( |
| 133 const scoped_refptr<internal::TaskQueueImpl>& queue) { | 128 const scoped_refptr<internal::TaskQueueImpl>& queue) { |
| 134 if (observer_) | 129 if (observer_) |
| 135 observer_->OnUnregisterTaskQueue(queue); | 130 observer_->OnUnregisterTaskQueue(queue); |
| 136 } | 131 } |
| 137 | 132 |
| 133 const scoped_refptr<RealTimeDomain>& SchedulerHelper::real_time_domain() const { |
| 134 CheckOnValidThread(); |
| 135 DCHECK(task_queue_manager_); |
| 136 return task_queue_manager_->real_time_domain(); |
| 137 } |
| 138 |
| 138 } // namespace scheduler | 139 } // namespace scheduler |
| OLD | NEW |