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

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: fling intervetion 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 ee2a34918d69a96861d89c6cf1935c2be2e93f48..232b7a65d51f15e7556ebd7ae75312371f28ed2b 100644
--- a/content/renderer/input/main_thread_event_queue.cc
+++ b/content/renderer/input/main_thread_event_queue.cc
@@ -57,10 +57,6 @@ bool MainThreadEventQueue::HandleEvent(
bool non_blocking = original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING ||
ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING;
-
- InputEventDispatchType dispatch_type =
- non_blocking ? DISPATCH_TYPE_NON_BLOCKING : DISPATCH_TYPE_BLOCKING;
-
bool is_wheel = event->type == blink::WebInputEvent::MouseWheel;
bool is_touch = blink::WebInputEvent::isTouchEventType(event->type);
@@ -74,6 +70,12 @@ bool MainThreadEventQueue::HandleEvent(
touch_event->dispatchType =
blink::WebInputEvent::ListenersNonBlockingPassive;
}
+ if (is_flinging_ && touch_event->touchStartOrFirstTouchMove &&
+ touch_event->dispatchType == blink::WebInputEvent::Blocking) {
+ touch_event->dispatchType =
+ blink::WebInputEvent::ListenersForcedNonBlockingPassiveDueToFling;
+ non_blocking = true;
+ }
}
if (is_wheel && non_blocking) {
// Adjust the |dispatchType| on the event since the compositor
@@ -82,6 +84,8 @@ bool MainThreadEventQueue::HandleEvent(
->dispatchType = blink::WebInputEvent::ListenersNonBlockingPassive;
}
+ InputEventDispatchType dispatch_type =
+ non_blocking ? DISPATCH_TYPE_NON_BLOCKING : DISPATCH_TYPE_BLOCKING;
std::unique_ptr<EventWithDispatchType> event_with_dispatch_type(
new EventWithDispatchType(std::move(event), latency, dispatch_type));

Powered by Google App Engine
This is Rietveld 408576698