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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10697100: Don't block the browser on FlingCancel acks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 33652c937ee5c1599bab26bc3c4dec61772b7265..3556a19fa95099c191f42f1fedb61658f3191751 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -824,10 +824,10 @@ void RenderWidgetHostImpl::ForwardGestureEvent(
return;
if (gesture_event_pending_) {
- if (coalesced_gesture_events_.empty() ||
- !ShouldCoalesceGestureEvents(coalesced_gesture_events_.back(),
+ if (coalesced_gesture_events_.empty() ||
+ !ShouldCoalesceGestureEvents(coalesced_gesture_events_.back(),
gesture_event)) {
- coalesced_gesture_events_.push_back(gesture_event);
+ coalesced_gesture_events_.push_back(gesture_event);
} else {
WebGestureEvent* last_gesture_event =
&coalesced_gesture_events_.back();
@@ -839,11 +839,16 @@ void RenderWidgetHostImpl::ForwardGestureEvent(
}
return;
}
- gesture_event_pending_ = true;
- if (gesture_event.type == WebInputEvent::GestureFlingCancel)
+ if (gesture_event.type == WebInputEvent::GestureFlingCancel) {
+ // We don't throttle FlingCancel, because it usually goes right through to
+ // the WebKit thread and blocking on WebKit is bad.
tap_suppression_controller_->GestureFlingCancel(
gesture_event.timeStampSeconds);
+ } else {
+ gesture_event_pending_ = true;
+ }
+
ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false);
}
@@ -1489,17 +1494,18 @@ void RenderWidgetHostImpl::ProcessWheelAck(bool processed) {
}
void RenderWidgetHostImpl::ProcessGestureAck(bool processed, int type) {
- if (type == WebInputEvent::GestureFlingCancel)
+ if (type == WebInputEvent::GestureFlingCancel) {
tap_suppression_controller_->GestureFlingCancelAck(processed);
-
- gesture_event_pending_ = false;
-
- // Now send the next (coalesced) gesture event.
- if (!coalesced_gesture_events_.empty()) {
- WebGestureEvent next_gesture_event =
- coalesced_gesture_events_.front();
- coalesced_gesture_events_.pop_front();
- ForwardGestureEvent(next_gesture_event);
+ } else {
+ gesture_event_pending_ = false;
+
+ // Now flush out the queued events until we hit one that needs another ack.
+ while (!gesture_event_pending_ && !coalesced_gesture_events_.empty()) {
+ WebGestureEvent next_gesture_event =
+ coalesced_gesture_events_.front();
+ coalesced_gesture_events_.pop_front();
+ ForwardGestureEvent(next_gesture_event);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698