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

Unified Diff: content/renderer/input/main_thread_event_queue.cc

Issue 2233543002: Make first TouchStart and first TouchMove events on a flinging layer non-blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new fling Created 4 years, 4 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/renderer/input/main_thread_event_queue.cc
diff --git a/content/renderer/input/main_thread_event_queue.cc b/content/renderer/input/main_thread_event_queue.cc
index 772d3be1c6bc31a979561586ac353b966ba1780a..5fe5bff6786ccd2049a3735d2c9cca77ccac7d09 100644
--- a/content/renderer/input/main_thread_event_queue.cc
+++ b/content/renderer/input/main_thread_event_queue.cc
@@ -41,7 +41,8 @@ MainThreadEventQueue::MainThreadEventQueue(
: routing_id_(routing_id),
client_(client),
is_flinging_(false),
- main_task_runner_(main_task_runner) {}
+ main_task_runner_(main_task_runner),
+ waiting_for_first_touch_move_(false) {}
MainThreadEventQueue::~MainThreadEventQueue() {}
@@ -77,6 +78,21 @@ bool MainThreadEventQueue::HandleEvent(
touch_event.dispatchType =
blink::WebInputEvent::ListenersNonBlockingPassive;
}
+ if (is_flinging_ &&
dtapuska 2016/08/10 14:47:42 does |is_flinging_| change after the touch start?
+ touch_event.dispatchType == blink::WebInputEvent::Blocking) {
+ bool touch_start_or_first_touch_move = false;
+ if (event->type == blink::WebInputEvent::TouchStart) {
+ waiting_for_first_touch_move_ = true;
+ touch_start_or_first_touch_move = true;
+ } else if (event->type == blink::WebInputEvent::TouchMove) {
+ touch_start_or_first_touch_move = waiting_for_first_touch_move_;
+ waiting_for_first_touch_move_ = false;
+ }
+ if (touch_start_or_first_touch_move) {
+ touch_event.dispatchType =
+ blink::WebInputEvent::ListenersForcedNonBlockingPassiveDueToFling;
+ }
+ }
}
if (is_wheel && non_blocking) {
// Adjust the |dispatchType| on the event since the compositor

Powered by Google App Engine
This is Rietveld 408576698