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

Unified Diff: trunk/src/content/browser/renderer_host/input/input_router_impl.cc

Issue 252023005: Revert 266470 "Implement async touchmove dispatch during scroll" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/browser/renderer_host/input/input_router_impl.cc
===================================================================
--- trunk/src/content/browser/renderer_host/input/input_router_impl.cc (revision 266575)
+++ trunk/src/content/browser/renderer_host/input/input_router_impl.cc (working copy)
@@ -88,10 +88,10 @@
TouchEventQueue::TouchScrollingMode GetTouchScrollingMode() {
std::string modeString = CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kTouchScrollingMode);
- if (modeString == switches::kTouchScrollingModeAsyncTouchmove)
- return TouchEventQueue::TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE;
if (modeString == switches::kTouchScrollingModeSyncTouchmove)
return TouchEventQueue::TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE;
+ if (modeString == switches::kTouchScrollingModeAbsorbTouchmove)
+ return TouchEventQueue::TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE;
if (modeString == switches::kTouchScrollingModeTouchcancel)
return TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL;
if (modeString != "")
@@ -422,14 +422,15 @@
// Touch events should always indicate in the event whether they are
// cancelable (respect ACK disposition) or not.
- bool ignores_ack = WebInputEventTraits::IgnoresAckDisposition(input_event);
+ bool ignoresAck =
+ WebInputEventTraits::IgnoresAckDisposition(input_event.type);
if (WebInputEvent::isTouchEventType(input_event.type)) {
- DCHECK(!ignores_ack ==
+ DCHECK(!ignoresAck ==
static_cast<const blink::WebTouchEvent&>(input_event).cancelable);
}
// If we don't care about the ack disposition, send the ack immediately.
- if (ignores_ack) {
+ if (ignoresAck) {
ProcessInputEventAck(input_event.type,
INPUT_EVENT_ACK_STATE_IGNORED,
latency_info,
@@ -503,10 +504,10 @@
bool is_keyboard_shortcut) {
if (Send(new InputMsg_HandleInputEvent(
routing_id(), &input_event, latency_info, is_keyboard_shortcut))) {
- // Ack messages for ignored ack event types should never be sent by the
- // renderer. Consequently, such event types should not affect event time
- // or in-flight event count metrics.
- if (!WebInputEventTraits::IgnoresAckDisposition(input_event)) {
+ // Ack messages for ignored ack event types are not required, and might
+ // never be sent by the renderer. Consequently, such event types should not
+ // affect event timing or in-flight event count metrics.
+ if (!WebInputEventTraits::IgnoresAckDisposition(input_event.type)) {
input_event_start_time_ = TimeTicks::Now();
client_->IncrementInFlightEventCount();
}
@@ -518,6 +519,11 @@
void InputRouterImpl::OnInputEventAck(WebInputEvent::Type event_type,
InputEventAckState ack_result,
const ui::LatencyInfo& latency_info) {
+ // A synthetic ack will already have been sent for this event, and it should
+ // not affect event timing or in-flight count metrics.
+ if (WebInputEventTraits::IgnoresAckDisposition(event_type))
+ return;
+
client_->DecrementInFlightEventCount();
// Log the time delta for processing an input event.
« no previous file with comments | « trunk/src/chrome/browser/about_flags.cc ('k') | trunk/src/content/browser/renderer_host/input/input_router_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698