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

Unified Diff: content/browser/renderer_host/input/gesture_event_filter.cc

Issue 44983003: Events ignoring ack disposition receive synthetic acks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test for single synchronous ack. Created 7 years, 1 month 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: content/browser/renderer_host/input/gesture_event_filter.cc
diff --git a/content/browser/renderer_host/input/gesture_event_filter.cc b/content/browser/renderer_host/input/gesture_event_filter.cc
index 4ab6f7705bfb64ebfee79c1ffa391ee27ed13a66..dd58d36c22e6dac550f6a917c486cedb0abc5a14 100644
--- a/content/browser/renderer_host/input/gesture_event_filter.cc
+++ b/content/browser/renderer_host/input/gesture_event_filter.cc
@@ -162,19 +162,12 @@ bool GestureEventFilter::ShouldForwardForCoalescing(
break;
}
EnqueueEvent(gesture_event);
-
- // Ensure that if the added event ignores its ack, it is fired and
- // removed from |coalesced_gesture_events_|.
- SendEventsIgnoringAck();
return ShouldHandleEventNow();
}
void GestureEventFilter::ProcessGestureAck(InputEventAckState ack_result,
WebInputEvent::Type type,
const ui::LatencyInfo& latency) {
- if (ShouldIgnoreAckForGestureType(type))
- return;
-
if (coalesced_gesture_events_.empty()) {
DLOG(ERROR) << "Received unexpected ACK for event type " << type;
return;
@@ -198,10 +191,6 @@ void GestureEventFilter::ProcessGestureAck(InputEventAckState ack_result,
}
coalesced_gesture_events_.pop_front();
- // If the event which was just ACKed was blocking events ignoring ack, fire
- // those events now.
- SendEventsIgnoringAck();
-
if (ignore_next_ack_) {
ignore_next_ack_ = false;
return;
@@ -362,26 +351,6 @@ gfx::Transform GestureEventFilter::GetTransformForEvent(
return gesture_transform;
}
-void GestureEventFilter::SendEventsIgnoringAck() {
- GestureEventWithLatencyInfo gesture_event;
- while (!coalesced_gesture_events_.empty()) {
- gesture_event = coalesced_gesture_events_.front();
- if (!GestureEventFilter::ShouldIgnoreAckForGestureType(
- gesture_event.event.type)) {
- return;
- }
- coalesced_gesture_events_.pop_front();
- client_->SendGestureEventImmediately(gesture_event);
- }
-}
-
-bool GestureEventFilter::ShouldIgnoreAckForGestureType(
- WebInputEvent::Type type) {
- return type == WebInputEvent::GestureTapDown ||
- type == WebInputEvent::GestureShowPress ||
- type == WebInputEvent::GestureTapCancel;
-}
-
void GestureEventFilter::EnqueueEvent(
const GestureEventWithLatencyInfo& gesture_event) {
coalesced_gesture_events_.push_back(gesture_event);

Powered by Google App Engine
This is Rietveld 408576698