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

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

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Fix a few DCHECK hits Created 3 years, 11 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 #include "ui/events/blink/web_input_event_traits.h" 10 #include "ui/events/blink/web_input_event_traits.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 // Extract the last event in queue. 317 // Extract the last event in queue.
318 blink::WebGestureEvent last_gesture_event = 318 blink::WebGestureEvent last_gesture_event =
319 coalesced_gesture_events_.back().event; 319 coalesced_gesture_events_.back().event;
320 DCHECK_LE(coalesced_gesture_events_.back().latency.trace_id(), 320 DCHECK_LE(coalesced_gesture_events_.back().latency.trace_id(),
321 gesture_event.latency.trace_id()); 321 gesture_event.latency.trace_id());
322 ui::LatencyInfo oldest_latency = coalesced_gesture_events_.back().latency; 322 ui::LatencyInfo oldest_latency = coalesced_gesture_events_.back().latency;
323 oldest_latency.set_coalesced(); 323 oldest_latency.set_coalesced();
324 coalesced_gesture_events_.pop_back(); 324 coalesced_gesture_events_.pop_back();
325 325
326 // Extract the second last event in queue. 326 // Extract the second last event in queue.
327 ui::ScopedWebInputEvent second_last_gesture_event = nullptr; 327 blink::WebScopedInputEvent second_last_gesture_event = nullptr;
328 if (unsent_events_count > 1 && 328 if (unsent_events_count > 1 &&
329 ui::IsCompatibleScrollorPinch(gesture_event.event, 329 ui::IsCompatibleScrollorPinch(gesture_event.event,
330 coalesced_gesture_events_.back().event)) { 330 coalesced_gesture_events_.back().event)) {
331 second_last_gesture_event = 331 second_last_gesture_event =
332 ui::WebInputEventTraits::Clone(coalesced_gesture_events_.back().event); 332 ui::WebInputEventTraits::Clone(coalesced_gesture_events_.back().event);
333 DCHECK_LE(coalesced_gesture_events_.back().latency.trace_id(), 333 DCHECK_LE(coalesced_gesture_events_.back().latency.trace_id(),
334 oldest_latency.trace_id()); 334 oldest_latency.trace_id());
335 oldest_latency = coalesced_gesture_events_.back().latency; 335 oldest_latency = coalesced_gesture_events_.back().latency;
336 oldest_latency.set_coalesced(); 336 oldest_latency.set_coalesced();
337 coalesced_gesture_events_.pop_back(); 337 coalesced_gesture_events_.pop_back();
(...skipping 23 matching lines...) Expand all
361 return 0; 361 return 0;
362 362
363 if (!ignore_next_ack_) 363 if (!ignore_next_ack_)
364 return 1; 364 return 1;
365 365
366 DCHECK_GT(coalesced_gesture_events_.size(), 1U); 366 DCHECK_GT(coalesced_gesture_events_.size(), 1U);
367 return 2; 367 return 2;
368 } 368 }
369 369
370 } // namespace content 370 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698