Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: content/renderer/scheduler/renderer_scheduler_impl.cc

Issue 904633004: [cc]: Add a BeginMainFrameNotExpectedSoon signal and route it to the RendererScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/renderer/scheduler/renderer_scheduler_impl.h" 5 #include "content/renderer/scheduler/renderer_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 base::TimeTicks now(Now()); 113 base::TimeTicks now(Now());
114 if (now < estimated_next_frame_begin_) { 114 if (now < estimated_next_frame_begin_) {
115 StartIdlePeriod(); 115 StartIdlePeriod();
116 control_task_runner_->PostDelayedTask(FROM_HERE, 116 control_task_runner_->PostDelayedTask(FROM_HERE,
117 end_idle_period_closure_.callback(), 117 end_idle_period_closure_.callback(),
118 estimated_next_frame_begin_ - now); 118 estimated_next_frame_begin_ - now);
119 } 119 }
120 } 120 }
121 121
122 void RendererSchedulerImpl::BeginFrameNoLongerRequired() {
123 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
124 "RendererSchedulerImpl::BeginFrameNoLongerRequired");
125 // TODO(rmcilroy): Implement long idle times.
126 }
127
122 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread( 128 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread(
123 blink::WebInputEvent::Type type) { 129 blink::WebInputEvent::Type type) {
124 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 130 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
125 "RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread"); 131 "RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread");
126 // Ignore mouse events because on windows these can very frequent. 132 // Ignore mouse events because on windows these can very frequent.
127 // Ignore keyboard events because it doesn't really make sense to enter 133 // Ignore keyboard events because it doesn't really make sense to enter
128 // compositor priority for them. 134 // compositor priority for them.
129 if (blink::WebInputEvent::isMouseEventType(type) || 135 if (blink::WebInputEvent::isMouseEventType(type) ||
130 blink::WebInputEvent::isKeyboardEventType(type)) { 136 blink::WebInputEvent::isKeyboardEventType(type)) {
131 return; 137 return;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 state->SetDouble("last_input_time", 339 state->SetDouble("last_input_time",
334 (last_input_time_ - base::TimeTicks()).InMillisecondsF()); 340 (last_input_time_ - base::TimeTicks()).InMillisecondsF());
335 state->SetDouble( 341 state->SetDouble(
336 "estimated_next_frame_begin", 342 "estimated_next_frame_begin",
337 (estimated_next_frame_begin_ - base::TimeTicks()).InMillisecondsF()); 343 (estimated_next_frame_begin_ - base::TimeTicks()).InMillisecondsF());
338 344
339 return state; 345 return state;
340 } 346 }
341 347
342 } // namespace content 348 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698