| 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 } |
| 99 | 104 |
| 100 bool SchedulerHelper::GetAndClearSystemIsQuiescentBit() { | 105 bool SchedulerHelper::GetAndClearSystemIsQuiescentBit() { |
| 101 CheckOnValidThread(); | 106 CheckOnValidThread(); |
| 102 DCHECK(task_queue_manager_.get()); | 107 DCHECK(task_queue_manager_.get()); |
| 103 return task_queue_manager_->GetAndClearSystemIsQuiescentBit(); | 108 return task_queue_manager_->GetAndClearSystemIsQuiescentBit(); |
| 104 } | 109 } |
| 105 | 110 |
| 106 void SchedulerHelper::AddTaskObserver( | 111 void SchedulerHelper::AddTaskObserver( |
| 107 base::MessageLoop::TaskObserver* task_observer) { | 112 base::MessageLoop::TaskObserver* task_observer) { |
| 108 CheckOnValidThread(); | 113 CheckOnValidThread(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 123 DCHECK(task_queue_manager_); | 128 DCHECK(task_queue_manager_); |
| 124 task_queue_manager_->SetObserver(this); | 129 task_queue_manager_->SetObserver(this); |
| 125 } | 130 } |
| 126 | 131 |
| 127 void SchedulerHelper::OnUnregisterTaskQueue( | 132 void SchedulerHelper::OnUnregisterTaskQueue( |
| 128 const scoped_refptr<internal::TaskQueueImpl>& queue) { | 133 const scoped_refptr<internal::TaskQueueImpl>& queue) { |
| 129 if (observer_) | 134 if (observer_) |
| 130 observer_->OnUnregisterTaskQueue(queue); | 135 observer_->OnUnregisterTaskQueue(queue); |
| 131 } | 136 } |
| 132 | 137 |
| 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 | |
| 139 } // namespace scheduler | 138 } // namespace scheduler |
| OLD | NEW |