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

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: Rename to BeginMainFrameNotExpectedSoon 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 base::TimeTicks now(Now()); 115 base::TimeTicks now(Now());
116 if (now < estimated_next_frame_begin_) { 116 if (now < estimated_next_frame_begin_) {
117 StartIdlePeriod(); 117 StartIdlePeriod();
118 control_task_runner_->PostDelayedTask(FROM_HERE, 118 control_task_runner_->PostDelayedTask(FROM_HERE,
119 end_idle_period_closure_.callback(), 119 end_idle_period_closure_.callback(),
120 estimated_next_frame_begin_ - now); 120 estimated_next_frame_begin_ - now);
121 } 121 }
122 } 122 }
123 123
124 void RendererSchedulerImpl::BeginFrameNotExpectedSoon() {
125 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
126 "RendererSchedulerImpl::BeginFrameNotExpectedSoon");
127 // TODO(rmcilroy): Implement long idle times.
128 }
129
124 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread( 130 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread(
125 const blink::WebInputEvent& web_input_event) { 131 const blink::WebInputEvent& web_input_event) {
126 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 132 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
127 "RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread"); 133 "RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread");
128 // We regard MouseMove events with the left mouse button down as a signal 134 // We regard MouseMove events with the left mouse button down as a signal
129 // that the user is doing something requiring a smooth frame rate. 135 // that the user is doing something requiring a smooth frame rate.
130 if (web_input_event.type == blink::WebInputEvent::MouseMove && 136 if (web_input_event.type == blink::WebInputEvent::MouseMove &&
131 (web_input_event.modifiers & blink::WebInputEvent::LeftButtonDown)) { 137 (web_input_event.modifiers & blink::WebInputEvent::LeftButtonDown)) {
132 UpdateForInputEvent(web_input_event.type); 138 UpdateForInputEvent(web_input_event.type);
133 return; 139 return;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 // meaningful touchstart response and should not impact task priority. 445 // meaningful touchstart response and should not impact task priority.
440 return current_state; 446 return current_state;
441 447
442 default: 448 default:
443 break; 449 break;
444 } 450 }
445 return INPUT_ACTIVE; 451 return INPUT_ACTIVE;
446 } 452 }
447 453
448 } // namespace content 454 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698