Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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 CONTENT_COMMON_INPUT_EVENT_PACKET_H_ | |
| 6 #define CONTENT_COMMON_INPUT_EVENT_PACKET_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/memory/scoped_vector.h" | |
| 11 #include "content/common/content_export.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 class InputEvent; | |
| 16 | |
| 17 // An id'ed sequence of InputEvents. | |
| 18 class CONTENT_EXPORT EventPacket { | |
| 19 public: | |
| 20 typedef ScopedVector<InputEvent> InputEvents; | |
| 21 | |
| 22 EventPacket(); | |
| 23 ~EventPacket(); | |
| 24 | |
| 25 // |event| should be non-NULL and valid. | |
|
palmer
2013/09/03 23:12:47
Should, or must? What happens if I pass a NULL or
| |
| 26 void Add(scoped_ptr<InputEvent> event); | |
| 27 | |
| 28 bool empty() const { return events.empty(); } | |
| 29 size_t size() const { return events.size(); } | |
| 30 InputEvents::const_iterator begin() const { return events.begin(); } | |
|
palmer
2013/09/03 23:12:47
It seems like these accessors exist to hide the ex
jdduke (slow)
2013/09/04 17:53:24
Less for hiding and more for convenience, really.
| |
| 31 InputEvents::const_iterator end() const { return events.end(); } | |
| 32 | |
| 33 int64 id; | |
| 34 InputEvents events; | |
| 35 | |
| 36 private: | |
| 37 DISALLOW_COPY_AND_ASSIGN(EventPacket); | |
| 38 }; | |
| 39 | |
| 40 } // namespace content | |
| 41 | |
| 42 #endif // CONTENT_COMMON_INPUT_EVENT_PACKET_H_ | |
| OLD | NEW |