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

Unified Diff: third_party/WebKit/public/web/WebInputEvent.h

Issue 1888163003: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and non-const ref passed back Created 4 years, 8 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/web/WebInputEvent.h
diff --git a/third_party/WebKit/public/web/WebInputEvent.h b/third_party/WebKit/public/web/WebInputEvent.h
index d4148b672615bd16aa08c02d039839de8db68aca..62087d140d86c9d5ebfda25ab44b6042034a295d 100644
--- a/third_party/WebKit/public/web/WebInputEvent.h
+++ b/third_party/WebKit/public/web/WebInputEvent.h
@@ -190,6 +190,23 @@ public:
ScrollLockOn = 1 << 19,
};
+ // Indicates whether the browser needs to block on the ACK result for
+ // this event, and if not why note (for metrics/diagnostics purposes).
+ // These values are direct mappings of the values in PlatformEvent
+ // so the values can be cast between the enumerations. static_asserts
+ // checking this are in web/WebInputEventConversion.cpp.
+ enum DispatchType {
+ // Event can be canceled.
+ Blocking,
+ // Event can not be canceled.
+ EventNonBlocking,
+ // All listeners are passive; not cancelable.
+ ListenersNonBlockingPassive,
+ // This value represents a state which would have normally blocking
+ // but was forced to be non-blocking; not cancelable.
+ ListenersForcedNonBlockingPassive,
+ };
+
// The rail mode for a wheel event specifies the axis on which scrolling is
// expected to stick. If this axis is set to Free, then scrolling is not
// stuck to any axis.
@@ -603,9 +620,9 @@ public:
// List of all touches, regardless of state.
WebTouchPoint touches[touchesLengthCap];
- // Whether the event can be canceled (with preventDefault). If true then the browser
- // must wait for an ACK for this event. If false then no ACK IPC is expected.
- bool cancelable;
+ // Whether the event is blocking, non-blocking, all event
+ // listeners were passive or was forced to be non-blocking.
+ DispatchType dispatchType;
// For a single touch, this is true after the touch-point has moved beyond
// the platform slop region. For a multitouch, this is true after any
@@ -618,7 +635,7 @@ public:
WebTouchEvent()
: WebInputEvent(sizeof(WebTouchEvent))
, touchesLength(0)
- , cancelable(true)
+ , dispatchType(Blocking)
, movedBeyondSlopRegion(false)
, uniqueTouchEventId(0)
{
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698