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

Side by Side Diff: third_party/WebKit/public/platform/WebCoalescedInputEvent.h

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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef WebCoalescedInputEvent_h
6 #define WebCoalescedInputEvent_h
7
8 #include "WebCommon.h"
9 #include "WebInputEvent.h"
10
11 #include <memory>
12 #include <vector>
13
14 namespace blink {
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
24 // coalesced events. The event could be any events defined in WebInputEvent.h.
25 class BLINK_COMMON_EXPORT WebCoalescedInputEvent {
26 public:
27 WebCoalescedInputEvent(WebScopedInputEvent);
28 WebCoalescedInputEvent(const WebInputEvent&);
29 WebCoalescedInputEvent(const WebInputEvent&,
30 const std::vector<const WebInputEvent*>&);
31
32 WebInputEvent* eventPointer();
33 void addCoalescedEvent(const blink::WebInputEvent&);
34 const WebInputEvent& event() const;
35 size_t coalescedEventSize() const;
36 const WebInputEvent* coalescedEvent(int index) const;
37 std::vector<const WebInputEvent*> getCoalescedEventsPointers() const;
38
39 private:
40 WebScopedInputEvent m_event;
41 std::vector<WebScopedInputEvent> m_coalescedEvents;
42 };
43
44 using WebScopedCoalescedInputEvent = std::unique_ptr<WebCoalescedInputEvent>;
45
46 } // namespace blink
47
48 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698