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

Side by Side Diff: content/browser/renderer_host/input/touch_event_queue.cc

Issue 521453002: Defer flushing the touch queue when all touch handlers removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Aura unit test fix Created 6 years, 3 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 #include "content/browser/renderer_host/input/touch_event_queue.h" 5 #include "content/browser/renderer_host/input/touch_event_queue.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/browser/renderer_host/input/timeout_monitor.h" 10 #include "content/browser/renderer_host/input/timeout_monitor.h"
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; 630 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE;
631 } 631 }
632 } else { 632 } else {
633 // TODO(jdduke): Synthesize a TouchCancel if necessary to update Blink touch 633 // TODO(jdduke): Synthesize a TouchCancel if necessary to update Blink touch
634 // state tracking and/or touch-action filtering (e.g., if the touch handler 634 // state tracking and/or touch-action filtering (e.g., if the touch handler
635 // was removed mid-sequence), crbug.com/375940. 635 // was removed mid-sequence), crbug.com/375940.
636 touch_filtering_state_ = DROP_ALL_TOUCHES; 636 touch_filtering_state_ = DROP_ALL_TOUCHES;
637 pending_async_touchmove_.reset(); 637 pending_async_touchmove_.reset();
638 if (timeout_handler_) 638 if (timeout_handler_)
639 timeout_handler_->Reset(); 639 timeout_handler_->Reset();
640 if (!touch_queue_.empty())
641 ProcessTouchAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, LatencyInfo());
642 // As there is no touch handler, ack'ing the event should flush the queue.
643 DCHECK(touch_queue_.empty());
644 } 640 }
645 } 641 }
646 642
647 bool TouchEventQueue::IsPendingAckTouchStart() const { 643 bool TouchEventQueue::IsPendingAckTouchStart() const {
648 DCHECK(!dispatching_touch_ack_); 644 DCHECK(!dispatching_touch_ack_);
649 if (touch_queue_.empty()) 645 if (touch_queue_.empty())
650 return false; 646 return false;
651 647
652 const blink::WebTouchEvent& event = 648 const blink::WebTouchEvent& event =
653 touch_queue_.front()->coalesced_event().event; 649 touch_queue_.front()->coalesced_event().event;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 iter != end; 816 iter != end;
821 ++iter) { 817 ++iter) {
822 if (iter->second != ack_state) 818 if (iter->second != ack_state)
823 return false; 819 return false;
824 } 820 }
825 821
826 return true; 822 return true;
827 } 823 }
828 824
829 } // namespace content 825 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698