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

Side by Side Diff: content/renderer/input/input_handler_proxy.cc

Issue 557403002: InputHandlerProxy to inform blink scheduler of input events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/input/input_handler_proxy.h" 5 #include "content/renderer/input/input_handler_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 SendScrollLatencyUma(event, *latency_info); 179 SendScrollLatencyUma(event, *latency_info);
180 180
181 TRACE_EVENT_FLOW_STEP0("input", 181 TRACE_EVENT_FLOW_STEP0("input",
182 "LatencyInfo.Flow", 182 "LatencyInfo.Flow",
183 TRACE_ID_DONT_MANGLE(latency_info->trace_id), 183 TRACE_ID_DONT_MANGLE(latency_info->trace_id),
184 "HandleInputEventImpl"); 184 "HandleInputEventImpl");
185 185
186 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = 186 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor =
187 input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info); 187 input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info);
188 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); 188 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event);
189 client_->DidHandleInputEvent();
Sami 2014/09/10 16:41:23 DidReceiveInputEvent No need for this call here.
alexclarke 2014/09/11 16:00:33 Done.
189 return disposition; 190 return disposition;
190 } 191 }
191 192
192 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( 193 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent(
193 const WebInputEvent& event) { 194 const WebInputEvent& event) {
194 DCHECK(input_handler_); 195 DCHECK(input_handler_);
195 TRACE_EVENT1("input", "InputHandlerProxy::HandleInputEvent", 196 TRACE_EVENT1("input", "InputHandlerProxy::HandleInputEvent",
196 "type", WebInputEventTraits::GetName(event.type)); 197 "type", WebInputEventTraits::GetName(event.type));
197 198
199 client_->DidHandleInputEvent();
198 if (FilterInputEventForFlingBoosting(event)) 200 if (FilterInputEventForFlingBoosting(event))
199 return DID_HANDLE; 201 return DID_HANDLE;
200 202
201 if (event.type == WebInputEvent::MouseWheel) { 203 if (event.type == WebInputEvent::MouseWheel) {
202 const WebMouseWheelEvent& wheel_event = 204 const WebMouseWheelEvent& wheel_event =
203 *static_cast<const WebMouseWheelEvent*>(&event); 205 *static_cast<const WebMouseWheelEvent*>(&event);
204 if (wheel_event.scrollByPage) { 206 if (wheel_event.scrollByPage) {
205 // TODO(jamesr): We don't properly handle scroll by page in the compositor 207 // TODO(jamesr): We don't properly handle scroll by page in the compositor
206 // thread, so punt it to the main thread. http://crbug.com/236639 208 // thread, so punt it to the main thread. http://crbug.com/236639
207 return DID_NOT_HANDLE; 209 return DID_NOT_HANDLE;
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 // trigger a scroll, e.g., with a trivial time delta between fling updates. 810 // trigger a scroll, e.g., with a trivial time delta between fling updates.
809 // Return true in this case to prevent early fling termination. 811 // Return true in this case to prevent early fling termination.
810 if (std::abs(clipped_increment.width) < kScrollEpsilon && 812 if (std::abs(clipped_increment.width) < kScrollEpsilon &&
811 std::abs(clipped_increment.height) < kScrollEpsilon) 813 std::abs(clipped_increment.height) < kScrollEpsilon)
812 return true; 814 return true;
813 815
814 return did_scroll; 816 return did_scroll;
815 } 817 }
816 818
817 } // namespace content 819 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/input/input_handler_proxy_client.h » ('j') | content/renderer/input/input_handler_wrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698