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

Unified Diff: content/browser/renderer_host/input/touch_event_queue.cc

Issue 1800143002: Notify Blink about start of gesture scroll through a queued event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/touch_event_queue.cc
diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc
index 265f5f11b6d9b12c863ab100b0c2639d4bfe9ab3..a86ca799a1d5b659d9266bc145462efb6e4709de 100644
--- a/content/browser/renderer_host/input/touch_event_queue.cc
+++ b/content/browser/renderer_host/input/touch_event_queue.cc
@@ -459,6 +459,9 @@ TouchEventQueue::~TouchEventQueue() {
void TouchEventQueue::QueueEvent(const TouchEventWithLatencyInfo& event) {
TRACE_EVENT0("input", "TouchEventQueue::QueueEvent");
+ LOG(ERROR) << "======= mDebug " << __FUNCTION__
+ << " t=" << WebInputEventTraits::GetName(event.event.type)
+ << " |q|=" << touch_queue_.size();
// If the queueing of |event| was triggered by an ack dispatch, defer
// processing the event until the dispatch has finished.
@@ -492,6 +495,24 @@ void TouchEventQueue::QueueEvent(const TouchEventWithLatencyInfo& event) {
touch_queue_.push_back(new CoalescedWebTouchEvent(event, false));
}
+void TouchEventQueue::PrependTouchScrollNotification() {
+ TRACE_EVENT0("input", "TouchEventQueue::PrependTouchScrollNotification");
+ LOG(ERROR) << "======= mDebug " << __FUNCTION__
+ << " |q|=" << touch_queue_.size();
+
+ TouchEventWithLatencyInfo touch;
+ touch.event.type = WebInputEvent::TouchScrollStarted;
+ touch.event.uniqueTouchEventId = 12345;
+ touch.event.touchesLength = 0;
+
+ // Skip the head of the queue to avoid messing up with in-flight event's ack.
+ auto it = touch_queue_.begin();
+ if (it != touch_queue_.end())
+ ++it;
+ touch_queue_.insert(it, new CoalescedWebTouchEvent(touch, false));
+}
+
+
void TouchEventQueue::ProcessTouchAck(InputEventAckState ack_result,
const LatencyInfo& latency_info,
const uint32_t unique_touch_event_id) {
@@ -746,6 +767,10 @@ void TouchEventQueue::AckTouchEventToClient(
scoped_ptr<CoalescedWebTouchEvent> TouchEventQueue::PopTouchEvent() {
DCHECK(!touch_queue_.empty());
scoped_ptr<CoalescedWebTouchEvent> event(touch_queue_.front());
+ LOG(ERROR) << "======= mDebug " << __FUNCTION__
+ << " t=" << WebInputEventTraits::GetName(
+ event->coalesced_event().event.type)
+ << " |q|=" << touch_queue_.size();
touch_queue_.pop_front();
return event;
}
@@ -831,6 +856,9 @@ TouchEventQueue::FilterBeforeForwarding(const WebTouchEvent& event) {
return ACK_WITH_NO_CONSUMER_EXISTS;
}
+ if (event.type == WebInputEvent::TouchScrollStarted)
+ return FORWARD_TO_RENDERER;
tdresser 2016/03/16 14:56:31 Are we returning before this for some TouchScrollS
mustaq 2016/03/16 15:15:40 That's a possibility of course, but not in the cas
+
if (event.type == WebInputEvent::TouchStart) {
return (has_handlers_ || has_handler_for_current_sequence_)
? FORWARD_TO_RENDERER
« no previous file with comments | « content/browser/renderer_host/input/touch_event_queue.h ('k') | content/common/input/web_input_event_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698