Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef WebCoalescedInputEvent_h | 5 #ifndef WebCoalescedInputEvent_h |
| 6 #define WebCoalescedInputEvent_h | 6 #define WebCoalescedInputEvent_h |
| 7 | 7 |
| 8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
| 9 #include "WebInputEvent.h" | 9 #include "WebInputEvent.h" |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 struct BLINK_COMMON_EXPORT WebInputEventDeleter { | |
| 17 void operator()(blink::WebInputEvent*) const; | |
| 18 }; | |
| 19 | |
| 20 using WebScopedInputEvent = | |
| 21 std::unique_ptr<WebInputEvent, WebInputEventDeleter>; | |
| 22 | |
| 23 // This class is representing a polymorphic WebInputEvent structure with its | 16 // This class is representing a polymorphic WebInputEvent structure with its |
| 24 // coalesced events. The event could be any events defined in WebInputEvent.h. | 17 // coalesced events. The event could be any events defined in WebInputEvent.h. |
| 25 class BLINK_COMMON_EXPORT WebCoalescedInputEvent { | 18 class BLINK_PLATFORM_EXPORT WebCoalescedInputEvent { |
| 26 public: | 19 public: |
| 27 explicit WebCoalescedInputEvent(WebScopedInputEvent); | |
| 28 explicit WebCoalescedInputEvent(const WebInputEvent&); | 20 explicit WebCoalescedInputEvent(const WebInputEvent&); |
| 29 WebCoalescedInputEvent(const WebInputEvent&, | 21 WebCoalescedInputEvent(const WebInputEvent&, |
| 30 const std::vector<const WebInputEvent*>&); | 22 const std::vector<const WebInputEvent*>&); |
| 31 | 23 |
| 32 WebInputEvent* eventPointer(); | 24 WebInputEvent* eventPointer(); |
| 33 void addCoalescedEvent(const blink::WebInputEvent&); | 25 void addCoalescedEvent(const blink::WebInputEvent&); |
| 34 const WebInputEvent& event() const; | 26 const WebInputEvent& event() const; |
| 35 size_t coalescedEventSize() const; | 27 size_t coalescedEventSize() const; |
| 36 const WebInputEvent& coalescedEvent(size_t index) const; | 28 const WebInputEvent& coalescedEvent(size_t index) const; |
| 37 std::vector<const WebInputEvent*> getCoalescedEventsPointers() const; | 29 std::vector<const WebInputEvent*> getCoalescedEventsPointers() const; |
| 38 | 30 |
| 39 private: | 31 private: |
| 32 struct WebInputEventDeleter { | |
|
Reid Kleckner
2017/02/14 02:14:45
It looks like you need to add BLINK_PLATFORM_EXPOR
dcheng
2017/02/14 02:21:10
I think thakis already submitted a cl for this: ht
| |
| 33 void operator()(blink::WebInputEvent*) const; | |
| 34 }; | |
| 35 | |
| 36 using WebScopedInputEvent = | |
| 37 std::unique_ptr<WebInputEvent, WebInputEventDeleter>; | |
| 38 | |
| 39 WebScopedInputEvent makeWebScopedInputEvent(const blink::WebInputEvent&); | |
| 40 | |
| 40 WebScopedInputEvent m_event; | 41 WebScopedInputEvent m_event; |
| 41 std::vector<WebScopedInputEvent> m_coalescedEvents; | 42 std::vector<WebScopedInputEvent> m_coalescedEvents; |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 using WebScopedCoalescedInputEvent = std::unique_ptr<WebCoalescedInputEvent>; | 45 using WebScopedCoalescedInputEvent = std::unique_ptr<WebCoalescedInputEvent>; |
| 45 | 46 |
| 46 } // namespace blink | 47 } // namespace blink |
| 47 | 48 |
| 48 #endif | 49 #endif |
| OLD | NEW |