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

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

Issue 2387353004: Delay Input.dispatchKeyEvent response until after key event ack. (Closed)
Patch Set: add test, address review comments about docs Created 4 years, 2 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: 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 0ce169540b3cae2c0e67d865f585d0d48d8763a3..463dc19a1167705b728564556991fbb3264f6724 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1954,6 +1954,8 @@ void RenderWidgetHostImpl::OnKeyboardEventAck(
const NativeWebKeyboardEventWithLatencyInfo& event,
InputEventAckState ack_result) {
latency_tracker_.OnInputEventAck(event.event, &event.latency, ack_result);
+ FOR_EACH_OBSERVER(InputEventObserver, input_event_observers_,
+ OnInputEventAck(event.event, event.event.is_synthetic));
const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result);
@@ -1974,6 +1976,9 @@ void RenderWidgetHostImpl::OnMouseEventAck(
InputEventAckState ack_result) {
latency_tracker_.OnInputEventAck(mouse_event.event, &mouse_event.latency,
ack_result);
+ // TOOD(samuong): keep track of synthetic mouse events
+ FOR_EACH_OBSERVER(InputEventObserver, input_event_observers_,
+ OnInputEventAck(mouse_event.event, true));
samuong 2016/10/20 23:36:18 Right now I'm setting is_synthetic to true for *al
}
void RenderWidgetHostImpl::OnWheelEventAck(
@@ -1981,6 +1986,8 @@ void RenderWidgetHostImpl::OnWheelEventAck(
InputEventAckState ack_result) {
latency_tracker_.OnInputEventAck(wheel_event.event, &wheel_event.latency,
ack_result);
+ FOR_EACH_OBSERVER(InputEventObserver, input_event_observers_,
+ OnInputEventAck(wheel_event.event, false));
if (!is_hidden() && view_) {
if (ack_result != INPUT_EVENT_ACK_STATE_CONSUMED &&
@@ -1995,6 +2002,8 @@ void RenderWidgetHostImpl::OnGestureEventAck(
const GestureEventWithLatencyInfo& event,
InputEventAckState ack_result) {
latency_tracker_.OnInputEventAck(event.event, &event.latency, ack_result);
+ FOR_EACH_OBSERVER(InputEventObserver, input_event_observers_,
+ OnInputEventAck(event.event, false));
if (view_)
view_->GestureEventAck(event.event, ack_result);
@@ -2004,6 +2013,8 @@ void RenderWidgetHostImpl::OnTouchEventAck(
const TouchEventWithLatencyInfo& event,
InputEventAckState ack_result) {
latency_tracker_.OnInputEventAck(event.event, &event.latency, ack_result);
+ FOR_EACH_OBSERVER(InputEventObserver, input_event_observers_,
+ OnInputEventAck(event.event, false));
if (touch_emulator_ &&
touch_emulator_->HandleTouchEventAck(event.event, ack_result)) {
« no previous file with comments | « content/browser/renderer_host/native_web_keyboard_event_mac.mm ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698