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
3 // found in the LICENSE file.
5 #include "content/renderer/scheduler/null_renderer_scheduler.h"
8 #include "base/message_loop/message_loop_proxy.h"
14 class NullIdleTaskRunner
: public SingleThreadIdleTaskRunner
{
17 void PostIdleTask(const tracked_objects::Location
& from_here
,
18 const IdleTask
& idle_task
) override
;
21 ~NullIdleTaskRunner() override
;
26 NullIdleTaskRunner::NullIdleTaskRunner()
27 : SingleThreadIdleTaskRunner(nullptr,
29 base::Callback
<void(base::TimeTicks
*)>()) {
32 NullIdleTaskRunner::~NullIdleTaskRunner() {
35 void NullIdleTaskRunner::PostIdleTask(
36 const tracked_objects::Location
& from_here
,
37 const IdleTask
& idle_task
) {
40 NullRendererScheduler::NullRendererScheduler()
41 : task_runner_(base::MessageLoopProxy::current()),
42 idle_task_runner_(new NullIdleTaskRunner()) {
45 NullRendererScheduler::~NullRendererScheduler() {
48 scoped_refptr
<base::SingleThreadTaskRunner
>
49 NullRendererScheduler::DefaultTaskRunner() {
53 scoped_refptr
<base::SingleThreadTaskRunner
>
54 NullRendererScheduler::CompositorTaskRunner() {
58 scoped_refptr
<base::SingleThreadTaskRunner
>
59 NullRendererScheduler::LoadingTaskRunner() {
63 scoped_refptr
<SingleThreadIdleTaskRunner
>
64 NullRendererScheduler::IdleTaskRunner() {
65 return idle_task_runner_
;
68 void NullRendererScheduler::WillBeginFrame(const cc::BeginFrameArgs
& args
) {
71 void NullRendererScheduler::BeginFrameNotExpectedSoon() {
74 void NullRendererScheduler::DidCommitFrameToCompositor() {
77 void NullRendererScheduler::DidReceiveInputEventOnCompositorThread(
78 const blink::WebInputEvent
& web_input_event
) {
81 void NullRendererScheduler::DidAnimateForInputOnCompositorThread() {
84 bool NullRendererScheduler::IsHighPriorityWorkAnticipated() {
88 bool NullRendererScheduler::ShouldYieldForHighPriorityWork() {
92 void NullRendererScheduler::AddTaskObserver(
93 base::MessageLoop::TaskObserver
* task_observer
) {
94 base::MessageLoop::current()->AddTaskObserver(task_observer
);
97 void NullRendererScheduler::RemoveTaskObserver(
98 base::MessageLoop::TaskObserver
* task_observer
) {
99 base::MessageLoop::current()->RemoveTaskObserver(task_observer
);
102 void NullRendererScheduler::Shutdown() {
105 } // namespace content