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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl.h

Issue 997283002: Coalesce async touch move events until the ack back from render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made changes based on comments Created 5 years, 9 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "content/browser/renderer_host/input/gesture_event_queue.h" 13 #include "content/browser/renderer_host/input/gesture_event_queue.h"
14 #include "content/browser/renderer_host/input/input_router.h" 14 #include "content/browser/renderer_host/input/input_router.h"
15 #include "content/browser/renderer_host/input/touch_action_filter.h" 15 #include "content/browser/renderer_host/input/touch_action_filter.h"
16 #include "content/browser/renderer_host/input/touch_event_queue.h" 16 #include "content/browser/renderer_host/input/touch_event_queue.h"
17 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h" 17 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h"
18 #include "content/common/input/input_event_stream_validator.h" 18 #include "content/common/input/input_event_stream_validator.h"
19 #include "content/public/browser/native_web_keyboard_event.h" 19 #include "content/public/browser/native_web_keyboard_event.h"
20 20
21 struct InputHostMsg_HandleInputEvent_ACK_Params; 21 struct InputHostMsg_HandleInputEvent_ACK_Params;
22 struct InputHostMsg_HandleUncancelableTouchMoveEvent_ACK_Params;
22 23
23 namespace IPC { 24 namespace IPC {
24 class Sender; 25 class Sender;
25 } 26 }
26 27
27 namespace ui { 28 namespace ui {
28 struct LatencyInfo; 29 struct LatencyInfo;
29 } 30 }
30 31
31 namespace content { 32 namespace content {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 const ui::LatencyInfo& latency_info); 119 const ui::LatencyInfo& latency_info);
119 120
120 // Returns true if |input_event| was successfully sent to the renderer 121 // Returns true if |input_event| was successfully sent to the renderer
121 // as an async IPC Message. 122 // as an async IPC Message.
122 bool OfferToRenderer(const blink::WebInputEvent& input_event, 123 bool OfferToRenderer(const blink::WebInputEvent& input_event,
123 const ui::LatencyInfo& latency_info, 124 const ui::LatencyInfo& latency_info,
124 bool is_keyboard_shortcut); 125 bool is_keyboard_shortcut);
125 126
126 // IPC message handlers 127 // IPC message handlers
127 void OnInputEventAck(const InputHostMsg_HandleInputEvent_ACK_Params& ack); 128 void OnInputEventAck(const InputHostMsg_HandleInputEvent_ACK_Params& ack);
129 void OnUncancelableTouchMoveAck(
130 const InputHostMsg_HandleUncancelableTouchMoveEvent_ACK_Params& ack);
128 void OnDidOverscroll(const DidOverscrollParams& params); 131 void OnDidOverscroll(const DidOverscrollParams& params);
129 void OnMsgMoveCaretAck(); 132 void OnMsgMoveCaretAck();
130 void OnSelectMessageAck(); 133 void OnSelectMessageAck();
131 void OnHasTouchEventHandlers(bool has_handlers); 134 void OnHasTouchEventHandlers(bool has_handlers);
132 void OnSetTouchAction(TouchAction touch_action); 135 void OnSetTouchAction(TouchAction touch_action);
133 136
134 // Indicates the source of an ack provided to |ProcessInputEventAck()|. 137 // Indicates the source of an ack provided to |ProcessInputEventAck()|.
135 // The source is tracked by |current_ack_source_|, which aids in ack routing. 138 // The source is tracked by |current_ack_source_|, which aids in ack routing.
136 enum AckSource { 139 enum AckSource {
137 RENDERER, 140 RENDERER,
(...skipping 25 matching lines...) Expand all
163 // dispatch of queued gesture events. 166 // dispatch of queued gesture events.
164 void ProcessGestureAck(blink::WebInputEvent::Type type, 167 void ProcessGestureAck(blink::WebInputEvent::Type type,
165 InputEventAckState ack_result, 168 InputEventAckState ack_result,
166 const ui::LatencyInfo& latency); 169 const ui::LatencyInfo& latency);
167 170
168 // Forwards the event ack to |touch_event_queue_|, potentially triggering 171 // Forwards the event ack to |touch_event_queue_|, potentially triggering
169 // dispatch of queued touch events, or the creation of gesture events. 172 // dispatch of queued touch events, or the creation of gesture events.
170 void ProcessTouchAck(InputEventAckState ack_result, 173 void ProcessTouchAck(InputEventAckState ack_result,
171 const ui::LatencyInfo& latency); 174 const ui::LatencyInfo& latency);
172 175
176 void ProcessUncancelableTouchMoveAck();
177
173 // Called when a touch timeout-affecting bit has changed, in turn toggling the 178 // Called when a touch timeout-affecting bit has changed, in turn toggling the
174 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input 179 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input
175 // to that determination includes current view properties and the allowed 180 // to that determination includes current view properties and the allowed
176 // touch action. Note that this will only affect platforms that have a 181 // touch action. Note that this will only affect platforms that have a
177 // non-zero touch timeout configuration. 182 // non-zero touch timeout configuration.
178 void UpdateTouchAckTimeoutEnabled(); 183 void UpdateTouchAckTimeoutEnabled();
179 184
180 // If a flush has been requested, signals a completed flush to the client if 185 // If a flush has been requested, signals a completed flush to the client if
181 // all events have been dispatched (i.e., |HasPendingEvents()| is false). 186 // all events have been dispatched (i.e., |HasPendingEvents()| is false).
182 void SignalFlushedIfNecessary(); 187 void SignalFlushedIfNecessary();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 TouchActionFilter touch_action_filter_; 258 TouchActionFilter touch_action_filter_;
254 InputEventStreamValidator input_stream_validator_; 259 InputEventStreamValidator input_stream_validator_;
255 InputEventStreamValidator output_stream_validator_; 260 InputEventStreamValidator output_stream_validator_;
256 261
257 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); 262 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl);
258 }; 263 };
259 264
260 } // namespace content 265 } // namespace content
261 266
262 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ 267 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698