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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp

Issue 2621303004: Keep track of coalesced events in main thread event queue (Closed)
Patch Set: Keep coalesced events in main thread event queue unittests 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 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 "public/platform/WebCoalescedInputEvent.h" 5 #include "public/platform/WebCoalescedInputEvent.h"
6 6
7 #include "public/platform/WebGestureEvent.h" 7 #include "public/platform/WebGestureEvent.h"
8 #include "public/platform/WebMouseWheelEvent.h" 8 #include "public/platform/WebMouseWheelEvent.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 const WebInputEvent& WebCoalescedInputEvent::event() const { 83 const WebInputEvent& WebCoalescedInputEvent::event() const {
84 return *m_event.get(); 84 return *m_event.get();
85 } 85 }
86 86
87 size_t WebCoalescedInputEvent::coalescedEventSize() const { 87 size_t WebCoalescedInputEvent::coalescedEventSize() const {
88 return m_coalescedEvents.size(); 88 return m_coalescedEvents.size();
89 } 89 }
90 90
91 const WebInputEvent* WebCoalescedInputEvent::coalescedEvent(int index) const { 91 const WebInputEvent& WebCoalescedInputEvent::coalescedEvent(
92 return m_coalescedEvents[index].get(); 92 size_t index) const {
93 return *m_coalescedEvents[index].get();
93 } 94 }
94 95
95 std::vector<const WebInputEvent*> 96 std::vector<const WebInputEvent*>
96 WebCoalescedInputEvent::getCoalescedEventsPointers() const { 97 WebCoalescedInputEvent::getCoalescedEventsPointers() const {
97 std::vector<const WebInputEvent*> events; 98 std::vector<const WebInputEvent*> events;
98 for (const auto& event : m_coalescedEvents) 99 for (const auto& event : m_coalescedEvents)
99 events.push_back(event.get()); 100 events.push_back(event.get());
100 return events; 101 return events;
101 } 102 }
102 103
103 WebCoalescedInputEvent::WebCoalescedInputEvent(WebScopedInputEvent event) 104 WebCoalescedInputEvent::WebCoalescedInputEvent(WebScopedInputEvent event)
104 : m_event(std::move(event)), m_coalescedEvents() { 105 : m_event(std::move(event)), m_coalescedEvents() {
105 m_coalescedEvents.push_back(makeWebScopedInputEvent(*(m_event.get()))); 106 m_coalescedEvents.push_back(makeWebScopedInputEvent(*(m_event.get())));
106 } 107 }
107 108
108 WebCoalescedInputEvent::WebCoalescedInputEvent(const WebInputEvent& event) 109 WebCoalescedInputEvent::WebCoalescedInputEvent(const WebInputEvent& event)
109 : m_event(), m_coalescedEvents() { 110 : m_event(), m_coalescedEvents() {
110 m_event = makeWebScopedInputEvent(event); 111 m_event = makeWebScopedInputEvent(event);
111 m_coalescedEvents.push_back(makeWebScopedInputEvent(event)); 112 m_coalescedEvents.push_back(makeWebScopedInputEvent(event));
112 } 113 }
113 114
114 WebCoalescedInputEvent::WebCoalescedInputEvent( 115 WebCoalescedInputEvent::WebCoalescedInputEvent(
115 const WebInputEvent& event, 116 const WebInputEvent& event,
116 const std::vector<const WebInputEvent*>& coalescedEvents) 117 const std::vector<const WebInputEvent*>& coalescedEvents)
117 : m_event(), m_coalescedEvents(coalescedEvents.size()) { 118 : m_event(), m_coalescedEvents() {
kinuko 2017/01/19 13:40:18 I don't think we need these empty initializers her
Navid Zolghadr 2017/01/19 21:46:25 Done.
118 m_event = makeWebScopedInputEvent(event); 119 m_event = makeWebScopedInputEvent(event);
119 for (const auto& coalescedEvent : coalescedEvents) 120 for (const auto& coalescedEvent : coalescedEvents)
120 m_coalescedEvents.push_back(makeWebScopedInputEvent(*coalescedEvent)); 121 m_coalescedEvents.push_back(makeWebScopedInputEvent(*coalescedEvent));
121 } 122 }
122 123
123 } // namespace blink 124 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/render_widget_unittest.cc ('k') | third_party/WebKit/Source/web/ExternalPopupMenu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698