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

Unified Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 2834183002: Add time stamp to the constructor of the events (Closed)
Patch Set: Created 3 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/Source/core/input/PointerEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
index 51501f37e039a2bf257d43cb321a63cd0b8543d6..5b43eaadee2263d6f1ea7b949b99e4c0bdeba0fa 100644
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -33,15 +33,18 @@ bool IsInDocument(EventTarget* n) {
return n && n->ToNode() && n->ToNode()->isConnected();
}
-Vector<WebTouchPoint> GetCoalescedPoints(
+Vector<std::pair<WebTouchPoint, TimeTicks>> GetCoalescedPoints(
const Vector<WebTouchEvent>& coalesced_events,
int id) {
- Vector<WebTouchPoint> related_points;
+ Vector<std::pair<WebTouchPoint, TimeTicks>> related_points;
for (const auto& touch_event : coalesced_events) {
for (unsigned i = 0; i < touch_event.touches_length; ++i) {
if (touch_event.touches[i].id == id &&
- touch_event.touches[i].state != WebTouchPoint::kStateStationary)
- related_points.push_back(touch_event.TouchPointInRootFrame(i));
+ touch_event.touches[i].state != WebTouchPoint::kStateStationary) {
+ related_points.push_back(std::pair<WebTouchPoint, TimeTicks>(
+ touch_event.TouchPointInRootFrame(i),
+ TimeTicks::FromSeconds(touch_event.TimeStampSeconds())));
+ }
}
}
return related_points;
@@ -392,6 +395,7 @@ void PointerEventManager::DispatchTouchPointerEvents(
PointerEvent* pointer_event = pointer_event_factory_.Create(
touch_point, GetCoalescedPoints(coalesced_events, touch_point.id),
static_cast<WebInputEvent::Modifiers>(event.GetModifiers()),
+ TimeTicks::FromSeconds(event.TimeStampSeconds()),
touch_info.target_frame,
touch_info.touch_node
? touch_info.touch_node->GetDocument().domWindow()

Powered by Google App Engine
This is Rietveld 408576698