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

Unified Diff: content/port/browser/event_with_latency_info.h

Issue 26923002: Consolidate WebInputEvent coalescing logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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: content/port/browser/event_with_latency_info.h
diff --git a/content/port/browser/event_with_latency_info.h b/content/port/browser/event_with_latency_info.h
index a39ae52076d08fa6a894d84c0625a63303d6a4d0..28c8ea2d59293eb3b4584ef5d7fd0bb358fbb941 100644
--- a/content/port/browser/event_with_latency_info.h
+++ b/content/port/browser/event_with_latency_info.h
@@ -7,6 +7,8 @@
#include "ui/events/latency_info.h"
+#include "content/common/input/web_input_event_traits.h"
+
namespace WebKit {
class WebGestureEvent;
class WebMouseEvent;
@@ -26,6 +28,14 @@ class EventWithLatencyInfo {
: event(e), latency(l) {}
EventWithLatencyInfo() {}
+
+ bool TryCoalesceWith(const EventWithLatencyInfo& other) {
+ if (WebInputEventTraits::TryCoalesce(other.event, &event)) {
+ latency.MergeWith(other.latency);
+ return true;
+ }
+ return false;
+ }
};
typedef EventWithLatencyInfo<WebKit::WebGestureEvent>

Powered by Google App Engine
This is Rietveld 408576698