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

Unified Diff: content/common/input/web_input_event_traits.cc

Issue 997283002: Coalesce async touch move events until the ack back from render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ack struct and unittest Created 5 years, 7 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/common/input/web_input_event_traits.cc
diff --git a/content/common/input/web_input_event_traits.cc b/content/common/input/web_input_event_traits.cc
index b2346401ad4d088e8477fd77350a1579eabd43e8..d155b61e412da08771f30748701820459e10e9ed 100644
--- a/content/common/input/web_input_event_traits.cc
+++ b/content/common/input/web_input_event_traits.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
+#include "content/common/input_messages.h"
jdduke (slow) 2015/05/07 21:11:16 I think we can remove this include.
using base::StringAppendF;
using base::SStringPrintf;
@@ -463,7 +464,8 @@ void WebInputEventTraits::Coalesce(const WebInputEvent& event_to_coalesce,
Apply(WebInputEventCoalesce(), event->type, event_to_coalesce, event);
}
-bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) {
+bool WebInputEventTraits::WillReceiveAckFromRenderer(
+ const WebInputEvent& event) {
switch (event.type) {
case WebInputEvent::MouseDown:
case WebInputEvent::MouseUp:
@@ -479,14 +481,20 @@ bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) {
case WebInputEvent::GesturePinchBegin:
case WebInputEvent::GesturePinchEnd:
case WebInputEvent::TouchCancel:
- return true;
+ return false;
case WebInputEvent::TouchStart:
- case WebInputEvent::TouchMove:
case WebInputEvent::TouchEnd:
- return !static_cast<const WebTouchEvent&>(event).cancelable;
+ return static_cast<const WebTouchEvent&>(event).cancelable;
default:
- return false;
+ return true;
+ }
+}
+
+uint32 WebInputEventTraits::GetUniqueTouchEventId(const WebInputEvent& event) {
+ if (WebInputEvent::isTouchEventType(event.type)) {
+ return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId;
}
+ return 0U;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698