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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 MainThreadOnly().current_policy.timer_queue_policy.priority); | 223 MainThreadOnly().current_policy.timer_queue_policy.priority); |
224 if (MainThreadOnly().current_policy.timer_queue_policy.time_domain_type == | 224 if (MainThreadOnly().current_policy.timer_queue_policy.time_domain_type == |
225 TimeDomainType::THROTTLED) { | 225 TimeDomainType::THROTTLED) { |
226 throttling_helper_->IncreaseThrottleRefCount(timer_task_queue.get()); | 226 throttling_helper_->IncreaseThrottleRefCount(timer_task_queue.get()); |
227 } | 227 } |
228 timer_task_queue->AddTaskObserver( | 228 timer_task_queue->AddTaskObserver( |
229 &MainThreadOnly().timer_task_cost_estimator); | 229 &MainThreadOnly().timer_task_cost_estimator); |
230 return timer_task_queue; | 230 return timer_task_queue; |
231 } | 231 } |
232 | 232 |
| 233 scoped_refptr<TaskQueue> RendererSchedulerImpl::NewDefaultTaskRunner( |
| 234 const char* name) { |
| 235 helper_.CheckOnValidThread(); |
| 236 scoped_refptr<TaskQueue> default_task_queue(helper_.NewTaskQueue( |
| 237 TaskQueue::Spec(name).SetShouldMonitorQuiescence(true))); |
| 238 return default_task_queue; |
| 239 } |
| 240 |
233 std::unique_ptr<RenderWidgetSchedulingState> | 241 std::unique_ptr<RenderWidgetSchedulingState> |
234 RendererSchedulerImpl::NewRenderWidgetSchedulingState() { | 242 RendererSchedulerImpl::NewRenderWidgetSchedulingState() { |
235 return render_widget_scheduler_signals_.NewRenderWidgetSchedulingState(); | 243 return render_widget_scheduler_signals_.NewRenderWidgetSchedulingState(); |
236 } | 244 } |
237 | 245 |
238 void RendererSchedulerImpl::OnUnregisterTaskQueue( | 246 void RendererSchedulerImpl::OnUnregisterTaskQueue( |
239 const scoped_refptr<TaskQueue>& task_queue) { | 247 const scoped_refptr<TaskQueue>& task_queue) { |
240 if (throttling_helper_.get()) | 248 if (throttling_helper_.get()) |
241 throttling_helper_->UnregisterTaskQueue(task_queue.get()); | 249 throttling_helper_->UnregisterTaskQueue(task_queue.get()); |
242 | 250 |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 BroadcastConsoleWarning( | 1350 BroadcastConsoleWarning( |
1343 "Blink deferred a task in order to make scrolling smoother. " | 1351 "Blink deferred a task in order to make scrolling smoother. " |
1344 "Your timer and network tasks should take less than 50ms to run " | 1352 "Your timer and network tasks should take less than 50ms to run " |
1345 "to avoid this. Please see " | 1353 "to avoid this. Please see " |
1346 "https://developers.google.com/web/tools/chrome-devtools/profile/evaluat
e-performance/rail" | 1354 "https://developers.google.com/web/tools/chrome-devtools/profile/evaluat
e-performance/rail" |
1347 " and https://crbug.com/574343#c40 for more information."); | 1355 " and https://crbug.com/574343#c40 for more information."); |
1348 } | 1356 } |
1349 } | 1357 } |
1350 | 1358 |
1351 } // namespace scheduler | 1359 } // namespace scheduler |
OLD | NEW |