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

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

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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.
dtapuska 2016/11/21 18:21:18 wrong copy right use the simplified one for chromi
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 CoalescedWebInputEvent_h
dglazkov 2016/12/06 03:46:47 Nit: WebCoalescedInputEvent <-- "Web" is the prefi
32 #define CoalescedWebInputEvent_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 CoalescedWebInputEvent {
jbroman 2016/11/22 15:27:37 nit: I'd actually prefer the words in the other or
43 public:
44 struct WebInputEventDeleter {
45 WebInputEventDeleter();
46 void operator()(blink::WebInputEvent* web_event) const;
jbroman 2016/11/22 15:27:37 Hmm. I thought WebInputEvent (and its derived clas
Navid Zolghadr 2016/11/22 15:38:04 I believe their destructor is not virtual intentio
jbroman 2016/11/22 16:02:39 OK. Strictly speaking this is the most correct thi
47 };
48
49 using ScopedWebInputEvent =
50 std::unique_ptr<WebInputEvent, WebInputEventDeleter>;
51
52 CoalescedWebInputEvent(ScopedWebInputEvent);
53 CoalescedWebInputEvent(const WebInputEvent&);
54 CoalescedWebInputEvent(const WebInputEvent&,
55 const std::vector<const WebInputEvent*>&);
56
57 WebInputEvent* eventPointer();
dtapuska 2016/11/21 18:21:18 should we have a const ptr version as well? How of
58 const WebInputEvent& event() const;
59 void addCoalescedEvent(const blink::WebInputEvent&);
60 size_t coalescedEventSize();
dtapuska 2016/11/21 18:21:18 const?
61 WebInputEvent* coalescedEvent(int index);
62 const std::vector<WebInputEvent*>& getCoalescedEventsPointers();
dtapuska 2016/11/21 18:21:18 is this const function?
63
64 private:
65 ScopedWebInputEvent mEvent;
dtapuska 2016/11/21 18:21:18 These are a weird format for member definition.
66 std::vector<ScopedWebInputEvent> mCoalescedEvents;
jbroman 2016/11/22 15:27:37 Blink style: m_event, m_coalescedEvents std::vect
Navid Zolghadr 2016/11/22 15:38:04 Alright. I didn't know about WebVector. So can I u
jbroman 2016/11/22 16:02:39 WebVector is legal throughout Blink if you're deal
67 };
68
69 typedef std::unique_ptr<CoalescedWebInputEvent> ScopedCoalescedWebInputEvent;
70
71 } // namespace blink
72
73 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698