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

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: Fix mojo and webview. 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 DCHECK(main_thread_checker_.CalledOnValidThread());
128 // TODO(rmcilroy): Implement long idle times.
129 }
130
124 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread( 131 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread(
125 const blink::WebInputEvent& web_input_event) { 132 const blink::WebInputEvent& web_input_event) {
126 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 133 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
127 "RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread"); 134 "RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread");
128 // We regard MouseMove events with the left mouse button down as a signal 135 // 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. 136 // that the user is doing something requiring a smooth frame rate.
130 if (web_input_event.type == blink::WebInputEvent::MouseMove && 137 if (web_input_event.type == blink::WebInputEvent::MouseMove &&
131 (web_input_event.modifiers & blink::WebInputEvent::LeftButtonDown)) { 138 (web_input_event.modifiers & blink::WebInputEvent::LeftButtonDown)) {
132 UpdateForInputEvent(web_input_event.type); 139 UpdateForInputEvent(web_input_event.type);
133 return; 140 return;
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // meaningful touchstart response and should not impact task priority. 447 // meaningful touchstart response and should not impact task priority.
441 return current_state; 448 return current_state;
442 449
443 default: 450 default:
444 break; 451 break;
445 } 452 }
446 return INPUT_ACTIVE; 453 return INPUT_ACTIVE;
447 } 454 }
448 455
449 } // namespace content 456 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/scheduler/renderer_scheduler_impl.h ('k') | content/test/fake_renderer_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698