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

Unified 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 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..372122b43635bfecbaf2f07de8b949df1be26580
--- /dev/null
+++ b/third_party/WebKit/public/platform/WebCoalescedInputEvent.h
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebCoalescedInputEvent_h
+#define WebCoalescedInputEvent_h
+
+#include "WebInputEvent.h"
+
+#include <memory>
+
+namespace blink {
+
+// This class is representing a polymorphic WebInputEvent structure with its
+// coalesced events. The event could be any events defined in WebInputEvent.h.
+class WebCoalescedInputEvent {
+ public:
+ struct WebInputEventDeleter {
+ WebInputEventDeleter();
+ void operator()(blink::WebInputEvent*) const;
+ };
+
+ using ScopedWebInputEvent =
+ std::unique_ptr<WebInputEvent, WebInputEventDeleter>;
+
+ WebCoalescedInputEvent(ScopedWebInputEvent);
+ 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:
+ ScopedWebInputEvent mEvent;
+ std::vector<ScopedWebInputEvent> mCoalescedEvents;
+};
+
+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
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698