| 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 "platform/scheduler/child/scheduler_helper.h" | 5 #include "platform/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 "platform/scheduler/base/task_queue_impl.h" | 10 #include "platform/scheduler/base/task_queue_impl.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 scoped_refptr<TaskQueue> SchedulerHelper::DefaultTaskRunner() { | 62 scoped_refptr<TaskQueue> SchedulerHelper::DefaultTaskRunner() { |
| 63 CheckOnValidThread(); | 63 CheckOnValidThread(); |
| 64 return default_task_runner_; | 64 return default_task_runner_; |
| 65 } | 65 } |
| 66 | 66 |
| 67 scoped_refptr<TaskQueue> SchedulerHelper::ControlTaskRunner() { | 67 scoped_refptr<TaskQueue> SchedulerHelper::ControlTaskRunner() { |
| 68 return control_task_runner_; | 68 return control_task_runner_; |
| 69 } | 69 } |
| 70 | 70 |
| 71 size_t SchedulerHelper::GetNumberOfPendingTasks() const { |
| 72 return task_queue_manager_->GetNumberOfPendingTasks(); |
| 73 } |
| 71 | 74 |
| 72 void SchedulerHelper::SetWorkBatchSizeForTesting(size_t work_batch_size) { | 75 void SchedulerHelper::SetWorkBatchSizeForTesting(size_t work_batch_size) { |
| 73 CheckOnValidThread(); | 76 CheckOnValidThread(); |
| 74 DCHECK(task_queue_manager_.get()); | 77 DCHECK(task_queue_manager_.get()); |
| 75 task_queue_manager_->SetWorkBatchSize(work_batch_size); | 78 task_queue_manager_->SetWorkBatchSize(work_batch_size); |
| 76 } | 79 } |
| 77 | 80 |
| 78 TaskQueueManager* SchedulerHelper::GetTaskQueueManagerForTesting() { | 81 TaskQueueManager* SchedulerHelper::GetTaskQueueManagerForTesting() { |
| 79 CheckOnValidThread(); | 82 CheckOnValidThread(); |
| 80 return task_queue_manager_.get(); | 83 return task_queue_manager_.get(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 159 } |
| 157 | 160 |
| 158 TaskQueue* SchedulerHelper::CurrentlyExecutingTaskQueue() const { | 161 TaskQueue* SchedulerHelper::CurrentlyExecutingTaskQueue() const { |
| 159 if (!task_queue_manager_) | 162 if (!task_queue_manager_) |
| 160 return nullptr; | 163 return nullptr; |
| 161 return task_queue_manager_->currently_executing_task_queue(); | 164 return task_queue_manager_->currently_executing_task_queue(); |
| 162 } | 165 } |
| 163 | 166 |
| 164 } // namespace scheduler | 167 } // namespace scheduler |
| 165 } // namespace blink | 168 } // namespace blink |
| OLD | NEW |