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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/platform/WebCoalescedInputEvent.h
diff --git a/third_party/WebKit/public/platform/WebCoalescedInputEvent.h b/third_party/WebKit/public/platform/WebCoalescedInputEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..94dd15021d2ff30317fc9fa3f7002c784ce1b970
--- /dev/null
+++ b/third_party/WebKit/public/platform/WebCoalescedInputEvent.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WebCoalescedInputEvent_h
+#define WebCoalescedInputEvent_h
+
+#include "WebCommon.h"
+#include "WebInputEvent.h"
+
+#include <memory>
+#include <vector>
+
+namespace blink {
+
+struct BLINK_COMMON_EXPORT WebInputEventDeleter {
+ void operator()(blink::WebInputEvent*) const;
+};
+
+using WebScopedInputEvent =
+ std::unique_ptr<WebInputEvent, WebInputEventDeleter>;
+
+// This class is representing a polymorphic WebInputEvent structure with its
+// coalesced events. The event could be any events defined in WebInputEvent.h.
+class BLINK_COMMON_EXPORT WebCoalescedInputEvent {
+ public:
+ WebCoalescedInputEvent(WebScopedInputEvent);
+ WebCoalescedInputEvent(const WebInputEvent&);
+ WebCoalescedInputEvent(const WebInputEvent&,
+ const std::vector<const WebInputEvent*>&);
+
+ WebInputEvent* eventPointer();
+ void addCoalescedEvent(const blink::WebInputEvent&);
+ const WebInputEvent& event() const;
+ size_t coalescedEventSize() const;
+ const WebInputEvent* coalescedEvent(int index) const;
+ std::vector<const WebInputEvent*> getCoalescedEventsPointers() const;
+
+ private:
+ WebScopedInputEvent m_event;
+ std::vector<WebScopedInputEvent> m_coalescedEvents;
+};
+
+using WebScopedCoalescedInputEvent = std::unique_ptr<WebCoalescedInputEvent>;
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698