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

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: Rebase 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/WebKeyboardEvent.h" 8 #include "public/platform/WebKeyboardEvent.h"
9 #include "public/platform/WebMouseWheelEvent.h" 9 #include "public/platform/WebMouseWheelEvent.h"
10 #include "public/platform/WebTouchEvent.h" 10 #include "public/platform/WebTouchEvent.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 const WebInputEvent& WebCoalescedInputEvent::event() const { 85 const WebInputEvent& WebCoalescedInputEvent::event() const {
86 return *m_event.get(); 86 return *m_event.get();
87 } 87 }
88 88
89 size_t WebCoalescedInputEvent::coalescedEventSize() const { 89 size_t WebCoalescedInputEvent::coalescedEventSize() const {
90 return m_coalescedEvents.size(); 90 return m_coalescedEvents.size();
91 } 91 }
92 92
93 const WebInputEvent* WebCoalescedInputEvent::coalescedEvent(int index) const { 93 const WebInputEvent& WebCoalescedInputEvent::coalescedEvent(
94 return m_coalescedEvents[index].get(); 94 size_t index) const {
95 return *m_coalescedEvents[index].get();
95 } 96 }
96 97
97 std::vector<const WebInputEvent*> 98 std::vector<const WebInputEvent*>
98 WebCoalescedInputEvent::getCoalescedEventsPointers() const { 99 WebCoalescedInputEvent::getCoalescedEventsPointers() const {
99 std::vector<const WebInputEvent*> events; 100 std::vector<const WebInputEvent*> events;
100 for (const auto& event : m_coalescedEvents) 101 for (const auto& event : m_coalescedEvents)
101 events.push_back(event.get()); 102 events.push_back(event.get());
102 return events; 103 return events;
103 } 104 }
104 105
105 WebCoalescedInputEvent::WebCoalescedInputEvent(WebScopedInputEvent event) 106 WebCoalescedInputEvent::WebCoalescedInputEvent(WebScopedInputEvent event)
106 : m_event(std::move(event)), m_coalescedEvents() { 107 : m_event(std::move(event)) {
107 m_coalescedEvents.push_back(makeWebScopedInputEvent(*(m_event.get()))); 108 m_coalescedEvents.push_back(makeWebScopedInputEvent(*(m_event.get())));
108 } 109 }
109 110
110 WebCoalescedInputEvent::WebCoalescedInputEvent(const WebInputEvent& event) 111 WebCoalescedInputEvent::WebCoalescedInputEvent(const WebInputEvent& event) {
111 : m_event(), m_coalescedEvents() {
112 m_event = makeWebScopedInputEvent(event); 112 m_event = makeWebScopedInputEvent(event);
113 m_coalescedEvents.push_back(makeWebScopedInputEvent(event)); 113 m_coalescedEvents.push_back(makeWebScopedInputEvent(event));
114 } 114 }
115 115
116 WebCoalescedInputEvent::WebCoalescedInputEvent( 116 WebCoalescedInputEvent::WebCoalescedInputEvent(
117 const WebInputEvent& event, 117 const WebInputEvent& event,
118 const std::vector<const WebInputEvent*>& coalescedEvents) 118 const std::vector<const WebInputEvent*>& coalescedEvents) {
119 : m_event(), m_coalescedEvents(coalescedEvents.size()) {
120 m_event = makeWebScopedInputEvent(event); 119 m_event = makeWebScopedInputEvent(event);
121 for (const auto& coalescedEvent : coalescedEvents) 120 for (const auto& coalescedEvent : coalescedEvents)
122 m_coalescedEvents.push_back(makeWebScopedInputEvent(*coalescedEvent)); 121 m_coalescedEvents.push_back(makeWebScopedInputEvent(*coalescedEvent));
123 } 122 }
124 123
125 } // 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