OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer/renderer_scheduler_impl.h" | 5 #include "components/scheduler/renderer/renderer_scheduler_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 MainThreadOnly().current_policy.timer_queue_policy.priority); | 225 MainThreadOnly().current_policy.timer_queue_policy.priority); |
226 if (MainThreadOnly().current_policy.timer_queue_policy.time_domain_type == | 226 if (MainThreadOnly().current_policy.timer_queue_policy.time_domain_type == |
227 TimeDomainType::THROTTLED) { | 227 TimeDomainType::THROTTLED) { |
228 throttling_helper_->IncreaseThrottleRefCount(timer_task_queue.get()); | 228 throttling_helper_->IncreaseThrottleRefCount(timer_task_queue.get()); |
229 } | 229 } |
230 timer_task_queue->AddTaskObserver( | 230 timer_task_queue->AddTaskObserver( |
231 &MainThreadOnly().timer_task_cost_estimator); | 231 &MainThreadOnly().timer_task_cost_estimator); |
232 return timer_task_queue; | 232 return timer_task_queue; |
233 } | 233 } |
234 | 234 |
| 235 scoped_refptr<TaskQueue> RendererSchedulerImpl::NewUnthrottledTaskRunner( |
| 236 const char* name) { |
| 237 helper_.CheckOnValidThread(); |
| 238 scoped_refptr<TaskQueue> unthrottled_task_queue(helper_.NewTaskQueue( |
| 239 TaskQueue::Spec(name).SetShouldMonitorQuiescence(true))); |
| 240 return unthrottled_task_queue; |
| 241 } |
| 242 |
235 std::unique_ptr<RenderWidgetSchedulingState> | 243 std::unique_ptr<RenderWidgetSchedulingState> |
236 RendererSchedulerImpl::NewRenderWidgetSchedulingState() { | 244 RendererSchedulerImpl::NewRenderWidgetSchedulingState() { |
237 return render_widget_scheduler_signals_.NewRenderWidgetSchedulingState(); | 245 return render_widget_scheduler_signals_.NewRenderWidgetSchedulingState(); |
238 } | 246 } |
239 | 247 |
240 void RendererSchedulerImpl::OnUnregisterTaskQueue( | 248 void RendererSchedulerImpl::OnUnregisterTaskQueue( |
241 const scoped_refptr<TaskQueue>& task_queue) { | 249 const scoped_refptr<TaskQueue>& task_queue) { |
242 if (throttling_helper_.get()) | 250 if (throttling_helper_.get()) |
243 throttling_helper_->UnregisterTaskQueue(task_queue.get()); | 251 throttling_helper_->UnregisterTaskQueue(task_queue.get()); |
244 | 252 |
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 return "idle"; | 1417 return "idle"; |
1410 case v8::PERFORMANCE_LOAD: | 1418 case v8::PERFORMANCE_LOAD: |
1411 return "load"; | 1419 return "load"; |
1412 default: | 1420 default: |
1413 NOTREACHED(); | 1421 NOTREACHED(); |
1414 return nullptr; | 1422 return nullptr; |
1415 } | 1423 } |
1416 } | 1424 } |
1417 | 1425 |
1418 } // namespace scheduler | 1426 } // namespace scheduler |
OLD | NEW |