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

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

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Created 4 years 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 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved.
dglazkov 2016/12/15 16:01:54 Can we use use new-style header here?
Navid Zolghadr 2016/12/16 15:38:08 That's weird. I'm pretty sure I copy pasted the ne
Navid Zolghadr 2016/12/22 20:50:33 Done.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef WebCoalescedInputEvent_h
32 #define WebCoalescedInputEvent_h
33
34 #include "WebInputEvent.h"
35
36 #include <memory>
37
38 namespace blink {
39
40 // This class is representing a polymorphic WebInputEvent structure with its
41 // coalesced events. The event could be any events defined in WebInputEvent.h.
42 class WebCoalescedInputEvent {
43 public:
44 struct WebInputEventDeleter {
45 WebInputEventDeleter();
46 void operator()(blink::WebInputEvent*) const;
47 };
48
49 using ScopedWebInputEvent =
50 std::unique_ptr<WebInputEvent, WebInputEventDeleter>;
51
52 WebCoalescedInputEvent(ScopedWebInputEvent);
53 WebCoalescedInputEvent(const WebInputEvent&);
54 WebCoalescedInputEvent(const WebInputEvent&,
55 const std::vector<const WebInputEvent*>&);
56
57 WebInputEvent* eventPointer();
58 void addCoalescedEvent(const blink::WebInputEvent&);
59 const WebInputEvent& event() const;
60 size_t coalescedEventSize() const;
61 const WebInputEvent* coalescedEvent(int index) const;
62 std::vector<const WebInputEvent*> getCoalescedEventsPointers() const;
63
64 private:
65 ScopedWebInputEvent mEvent;
66 std::vector<ScopedWebInputEvent> mCoalescedEvents;
67 };
68
69 typedef std::unique_ptr<WebCoalescedInputEvent> ScopedCoalescedWebInputEvent;
dglazkov 2016/12/15 16:01:54 WebScopedCoalescedInputEvent or ScopedWebCoalesced
Navid Zolghadr 2016/12/16 15:38:09 Sure. How about ScopedWebInputEvent? Do you like t
Navid Zolghadr 2016/12/22 20:50:33 I changed them all to start with Web
70
71 } // namespace blink
72
73 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698