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

Side by Side Diff: ui/events/blink/compositor_thread_event_queue.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits 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
« no previous file with comments | « ui/events/blink/blink_event_util.cc ('k') | ui/events/blink/event_with_callback.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/events/blink/compositor_thread_event_queue.h" 5 #include "ui/events/blink/compositor_thread_event_queue.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/events/blink/blink_event_util.h" 8 #include "ui/events/blink/blink_event_util.h"
9 #include "ui/events/blink/web_input_event_traits.h" 9 #include "ui/events/blink/web_input_event_traits.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 CompositorThreadEventQueue::CompositorThreadEventQueue() {} 13 CompositorThreadEventQueue::CompositorThreadEventQueue() {}
14 14
15 CompositorThreadEventQueue::~CompositorThreadEventQueue() {} 15 CompositorThreadEventQueue::~CompositorThreadEventQueue() {}
16 16
17 void CompositorThreadEventQueue::Queue( 17 void CompositorThreadEventQueue::Queue(
18 std::unique_ptr<EventWithCallback> new_event, 18 std::unique_ptr<EventWithCallback> new_event,
19 base::TimeTicks timestamp_now) { 19 base::TimeTicks timestamp_now) {
20 if (queue_.empty() || !IsContinuousGestureEvent(new_event->event().type) || 20 if (queue_.empty() || !IsContinuousGestureEvent(new_event->event().type()) ||
21 !IsCompatibleScrollorPinch(ToWebGestureEvent(new_event->event()), 21 !IsCompatibleScrollorPinch(ToWebGestureEvent(new_event->event()),
22 ToWebGestureEvent(queue_.back()->event()))) { 22 ToWebGestureEvent(queue_.back()->event()))) {
23 queue_.emplace_back(std::move(new_event)); 23 queue_.emplace_back(std::move(new_event));
24 return; 24 return;
25 } 25 }
26 26
27 if (queue_.back()->CanCoalesceWith(*new_event)) { 27 if (queue_.back()->CanCoalesceWith(*new_event)) {
28 queue_.back()->CoalesceWith(new_event.get(), timestamp_now); 28 queue_.back()->CoalesceWith(new_event.get(), timestamp_now);
29 return; 29 return;
30 } 30 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 std::unique_ptr<EventWithCallback> CompositorThreadEventQueue::Pop() { 85 std::unique_ptr<EventWithCallback> CompositorThreadEventQueue::Pop() {
86 std::unique_ptr<EventWithCallback> result; 86 std::unique_ptr<EventWithCallback> result;
87 if (!queue_.empty()) { 87 if (!queue_.empty()) {
88 result = std::move(queue_.front()); 88 result = std::move(queue_.front());
89 queue_.pop_front(); 89 queue_.pop_front();
90 } 90 }
91 return result; 91 return result;
92 } 92 }
93 93
94 } // namespace ui 94 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/blink_event_util.cc ('k') | ui/events/blink/event_with_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698