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

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

Issue 1390163003: Cleanup of some old TODOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/gesture_event_queue.h" 5 #include "content/browser/renderer_host/input/gesture_event_queue.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h" 8 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h"
9 #include "content/browser/renderer_host/input/touchscreen_tap_suppression_contro ller.h" 9 #include "content/browser/renderer_host/input/touchscreen_tap_suppression_contro ller.h"
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 const ui::LatencyInfo& latency) { 200 const ui::LatencyInfo& latency) {
201 TRACE_EVENT0("input", "GestureEventQueue::ProcessGestureAck"); 201 TRACE_EVENT0("input", "GestureEventQueue::ProcessGestureAck");
202 202
203 if (coalesced_gesture_events_.empty()) { 203 if (coalesced_gesture_events_.empty()) {
204 DLOG(ERROR) << "Received unexpected ACK for event type " << type; 204 DLOG(ERROR) << "Received unexpected ACK for event type " << type;
205 return; 205 return;
206 } 206 }
207 207
208 // It's possible that the ack for the second event in an in-flight, coalesced 208 // It's possible that the ack for the second event in an in-flight, coalesced
209 // Gesture{Scroll,Pinch}Update pair is received prior to the first event ack. 209 // Gesture{Scroll,Pinch}Update pair is received prior to the first event ack.
210 // TODO(jdduke): Unify GSU/GPU pairs into a single event, crbug.com/359115.
211 size_t event_index = 0; 210 size_t event_index = 0;
212 if (ignore_next_ack_ && 211 if (ignore_next_ack_ &&
213 coalesced_gesture_events_.size() > 1 && 212 coalesced_gesture_events_.size() > 1 &&
214 coalesced_gesture_events_[0].event.type != type && 213 coalesced_gesture_events_[0].event.type != type &&
215 coalesced_gesture_events_[1].event.type == type) { 214 coalesced_gesture_events_[1].event.type == type) {
216 event_index = 1; 215 event_index = 1;
217 } 216 }
218 GestureEventWithLatencyInfo event_with_latency = 217 GestureEventWithLatencyInfo event_with_latency =
219 coalesced_gesture_events_[event_index]; 218 coalesced_gesture_events_[event_index];
220 DCHECK_EQ(event_with_latency.event.type, type); 219 DCHECK_EQ(event_with_latency.event.type, type);
(...skipping 20 matching lines...) Expand all
241 ignore_next_ack_ = false; 240 ignore_next_ack_ = false;
242 return; 241 return;
243 } 242 }
244 243
245 if (coalesced_gesture_events_.empty()) 244 if (coalesced_gesture_events_.empty())
246 return; 245 return;
247 246
248 const GestureEventWithLatencyInfo& first_gesture_event = 247 const GestureEventWithLatencyInfo& first_gesture_event =
249 coalesced_gesture_events_.front(); 248 coalesced_gesture_events_.front();
250 249
251 // TODO(jdduke): Unify GSU/GPU pairs into a single event, crbug.com/359115.
252 // Check for the coupled GesturePinchUpdate before sending either event, 250 // Check for the coupled GesturePinchUpdate before sending either event,
253 // handling the case where the first GestureScrollUpdate ack is synchronous. 251 // handling the case where the first GestureScrollUpdate ack is synchronous.
254 GestureEventWithLatencyInfo second_gesture_event; 252 GestureEventWithLatencyInfo second_gesture_event;
255 if (first_gesture_event.event.type == WebInputEvent::GestureScrollUpdate && 253 if (first_gesture_event.event.type == WebInputEvent::GestureScrollUpdate &&
256 coalesced_gesture_events_.size() > 1 && 254 coalesced_gesture_events_.size() > 1 &&
257 coalesced_gesture_events_[1].event.type == 255 coalesced_gesture_events_[1].event.type ==
258 WebInputEvent::GesturePinchUpdate) { 256 WebInputEvent::GesturePinchUpdate) {
259 second_gesture_event = coalesced_gesture_events_[1]; 257 second_gesture_event = coalesced_gesture_events_[1];
260 ignore_next_ack_ = true; 258 ignore_next_ack_ = true;
261 } 259 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return 0; 388 return 0;
391 389
392 if (!ignore_next_ack_) 390 if (!ignore_next_ack_)
393 return 1; 391 return 1;
394 392
395 DCHECK_GT(coalesced_gesture_events_.size(), 1U); 393 DCHECK_GT(coalesced_gesture_events_.size(), 1U);
396 return 2; 394 return 2;
397 } 395 }
398 396
399 } // namespace content 397 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/renderer_host/input/input_router_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698