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

Unified Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

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
« no previous file with comments | « content/renderer/mus/render_widget_mus_connection.cc ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
index 7900cf790b6d9a49dd6c4abc76f3439811ce9514..8271c17c3c1e74b2c7c68bce0f96489f14e1e84c 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -219,8 +219,6 @@ PointerEvent* PointerEventFactory::create(
AtomicString pointerEventName =
pointerEventNameForMouseEventName(mouseEventName);
- DCHECK(pointerEventName == EventTypeNames::pointermove ||
- coalescedMouseEvents.isEmpty());
unsigned buttons =
MouseEvent::platformModifiersToButtons(mouseEvent.getModifiers());
@@ -259,19 +257,22 @@ PointerEvent* PointerEventFactory::create(
updateMousePointerEventInit(mouseEvent, view, &pointerEventInit);
- // Created coalesced events init structure
- HeapVector<Member<PointerEvent>> coalescedPointerEvents;
- for (const auto& coalescedMouseEvent : coalescedMouseEvents) {
- DCHECK_EQ(mouseEvent.pointerProperties().id,
- coalescedMouseEvent.pointerProperties().id);
- DCHECK_EQ(mouseEvent.pointerProperties().pointerType,
- coalescedMouseEvent.pointerProperties().pointerType);
- PointerEventInit coalescedEventInit = pointerEventInit;
- updateMousePointerEventInit(coalescedMouseEvent, view, &coalescedEventInit);
- coalescedPointerEvents.push_back(
- PointerEvent::create(pointerEventName, coalescedEventInit));
+ // Create coalesced events init structure only for pointermove.
+ if (pointerEventName == EventTypeNames::pointermove) {
+ HeapVector<Member<PointerEvent>> coalescedPointerEvents;
+ for (const auto& coalescedMouseEvent : coalescedMouseEvents) {
+ DCHECK_EQ(mouseEvent.pointerProperties().id,
+ coalescedMouseEvent.pointerProperties().id);
+ DCHECK_EQ(mouseEvent.pointerProperties().pointerType,
foolip 2017/01/24 04:56:26 Filed https://bugs.chromium.org/p/chromium/issues/
+ coalescedMouseEvent.pointerProperties().pointerType);
+ PointerEventInit coalescedEventInit = pointerEventInit;
+ updateMousePointerEventInit(coalescedMouseEvent, view,
+ &coalescedEventInit);
+ coalescedPointerEvents.push_back(
+ PointerEvent::create(pointerEventName, coalescedEventInit));
+ }
+ pointerEventInit.setCoalescedEvents(coalescedPointerEvents);
}
- pointerEventInit.setCoalescedEvents(coalescedPointerEvents);
return PointerEvent::create(pointerEventName, pointerEventInit);
}
@@ -286,8 +287,6 @@ PointerEvent* PointerEventFactory::create(
const AtomicString& type =
pointerEventNameForTouchPointState(touchPoint.state());
- DCHECK(type == EventTypeNames::pointermove || coalescedPoints.isEmpty());
-
bool pointerReleasedOrCancelled =
pointState == PlatformTouchPoint::TouchReleased ||
pointState == PlatformTouchPoint::TouchCancelled;
@@ -310,21 +309,22 @@ PointerEvent* PointerEventFactory::create(
setEventSpecificFields(pointerEventInit, type);
- // Created coalesced events init structure
- HeapVector<Member<PointerEvent>> coalescedPointerEvents;
- for (const auto& coalescedTouchPoint : coalescedPoints) {
- DCHECK_EQ(touchPoint.state(), coalescedTouchPoint.state());
- DCHECK_EQ(touchPoint.pointerProperties().id,
- coalescedTouchPoint.pointerProperties().id);
- DCHECK_EQ(touchPoint.pointerProperties().pointerType,
- coalescedTouchPoint.pointerProperties().pointerType);
- PointerEventInit coalescedEventInit = pointerEventInit;
- updateTouchPointerEventInit(coalescedTouchPoint, targetFrame,
- &coalescedEventInit);
- coalescedPointerEvents.push_back(
- PointerEvent::create(type, coalescedEventInit));
+ if (type == EventTypeNames::pointermove) {
+ HeapVector<Member<PointerEvent>> coalescedPointerEvents;
+ for (const auto& coalescedTouchPoint : coalescedPoints) {
+ DCHECK_EQ(touchPoint.state(), coalescedTouchPoint.state());
+ DCHECK_EQ(touchPoint.pointerProperties().id,
+ coalescedTouchPoint.pointerProperties().id);
+ DCHECK_EQ(touchPoint.pointerProperties().pointerType,
+ coalescedTouchPoint.pointerProperties().pointerType);
+ PointerEventInit coalescedEventInit = pointerEventInit;
+ updateTouchPointerEventInit(coalescedTouchPoint, targetFrame,
+ &coalescedEventInit);
+ coalescedPointerEvents.push_back(
+ PointerEvent::create(type, coalescedEventInit));
+ }
+ pointerEventInit.setCoalescedEvents(coalescedPointerEvents);
}
- pointerEventInit.setCoalescedEvents(coalescedPointerEvents);
return PointerEvent::create(type, pointerEventInit);
}
« no previous file with comments | « content/renderer/mus/render_widget_mus_connection.cc ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698