Chromium Code Reviews| 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..84b340ef0b450ada334b7023ca2a630c079ae1cc 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() {} |
| @@ -71,12 +72,28 @@ bool MainThreadEventQueue::HandleEvent( |
| blink::WebTouchEvent& touch_event = |
| static_cast<blink::WebTouchEvent&>(cloned_event->event()); |
| touch_event.dispatchedDuringFling = is_flinging_; |
| + 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; |
| + } |
| + touch_event.touchStartOrFirstTouchMove = touch_start_or_first_touch_move; |
|
dtapuska
2016/08/12 14:40:00
Why is this populated here? Can't it be sent from
|
| // Adjust the |dispatchType| on the event since the compositor |
| // determined all event listeners are passive. |
| if (non_blocking) { |
| touch_event.dispatchType = |
| blink::WebInputEvent::ListenersNonBlockingPassive; |
| } |
| + if (is_flinging_ && touch_start_or_first_touch_move && |
| + touch_event.dispatchType == blink::WebInputEvent::Blocking) { |
| + touch_event.dispatchType = |
| + blink::WebInputEvent::ListenersForcedNonBlockingPassiveDueToFling; |
| + cloned_event->setDispatchType(DISPATCH_TYPE_NON_BLOCKING); |
| + non_blocking = true; |
| + } |
| } |
| if (is_wheel && non_blocking) { |
| // Adjust the |dispatchType| on the event since the compositor |