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

Issue 1352523002: Use high precision timestamp for Event.timestamp (Closed)

Created:
5 years, 3 months ago by majidvp
Modified:
5 years, 2 months ago
Reviewers:
kinuko, dtapuska, Rick Byers
CC:
blink-reviews, tyoshino+watch_chromium.org, vivekg_samsung, vivekg, Inactive, kinuko+watch, Nate Chapin, gavinp+loader_chromium.org, tdresser
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use high precision time for Event.timeStamp (behind REF) Change Event.timestamp to expose high-precision monotonic time for Input events behind a RuntimeEnabledFlag. For input events we use the WebInputEvents.timeStampSeconds where available. Where it is not available (e.g., non-input events or events created by the script) use blink's monotonic time clock. The timestamp is recorded in the Event object as is provided but we change the timestamp's origin to the target document's time origin base before exposing it. Also fixes a small bug where keyboard event timestamp was not being plumbed correctly when it was converted from WebInputEvent to Platform event. For testing I have added two new facilities: 1. A method to internals that allows conversion from platform time to document time. 2. A method to eventSender that allows obtaining timeStamp of last dispatched event. BUG=160524 TEST=fast/events/hr-timestamp Committed: https://crrev.com/bfabb071f4c01c0e0ff3c733946771f986bc4b9d Cr-Commit-Position: refs/heads/master@{#352051}

Patch Set 1 #

Patch Set 2 : Make timestamp plumb from PlatformKeyboardEvent->KeyboardEvent #

Patch Set 3 : change time origin #

Patch Set 4 : Use m_target to find event document #

Total comments: 19

Patch Set 5 : Add tests and address review feedback #

Patch Set 6 : Improve comment #

Patch Set 7 : Improve comment #

Patch Set 8 : #

Total comments: 16

Patch Set 9 : Address few issues #

Patch Set 10 : Rebase and introduce new type #

Total comments: 2

Patch Set 11 : remove unnecessary comment #

Patch Set 12 : Update pepper to consider Event.timeStampSeconds as time ticks #

Patch Set 13 : Update pepper #

Patch Set 14 : Use actual timestamp in pepper tests #

Patch Set 15 : Revert to using epoch time when converting events #

Patch Set 16 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -38 lines) Patch
M components/test_runner/event_sender.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M components/test_runner/event_sender.cc View 1 2 3 4 5 6 7 6 chunks +13 lines, -2 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html View 1 2 3 4 5 6 7 8 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/hr-timestamp/input-events.html View 1 2 3 4 5 6 7 8 1 chunk +32 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/hr-timestamp/safe-resolution.html View 1 2 3 4 5 6 7 1 chunk +20 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/dom/DOMHighResTimeStamp.h View 1 2 3 4 5 6 7 8 9 1 chunk +24 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/Event.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +15 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/events/Event.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +21 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/Event.idl View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/GestureEvent.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/events/KeyboardEvent.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/MouseEvent.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/events/TouchEvent.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/forms/TypeAhead.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/TypeAhead.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.idl View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/timing/PerformanceBase.h View 1 2 3 4 5 6 7 8 9 2 chunks +12 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/timing/PerformanceBase.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +8 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebInputEventConversion.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +9 lines, -7 lines 0 comments Download

Messages

Total messages: 22 (5 generated)
majidvp
Here is a first try at having high precision time. The part that I am ...
5 years, 3 months ago (2015-09-18 15:18:10 UTC) #2
Rick Byers
On 2015/09/18 15:18:10, majidvp wrote: > Here is a first try at having high precision ...
5 years, 3 months ago (2015-09-18 15:40:57 UTC) #3
Rick Byers
There's enough subtly (and privacy implications) in high-precision timing, that I'd like a timing expert's ...
5 years, 3 months ago (2015-09-18 15:56:33 UTC) #5
dtapuska
https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp File Source/core/events/Event.cpp (right): https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp#newcode281 Source/core/events/Event.cpp:281: timeStamp = m_target->toNode()->document().monotonicTimeToZeroBasedDocumentTime(m_uiCreateTime) * millisPerSecond; How does this work ...
5 years, 3 months ago (2015-09-18 16:04:42 UTC) #7
Rick Byers
I didn't try to trace through all the cases to verify that the returned timestamp ...
5 years, 3 months ago (2015-09-18 16:17:29 UTC) #8
majidvp
https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp File Source/core/events/Event.cpp (right): https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp#newcode38 Source/core/events/Event.cpp:38: static double monotonicTimeWithSafePrecision() On 2015/09/18 15:56:32, Rick Byers wrote: ...
5 years, 3 months ago (2015-09-18 17:43:34 UTC) #9
Rick Byers
https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp File Source/core/events/Event.cpp (right): https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp#newcode279 Source/core/events/Event.cpp:279: // hiResTime On 2015/09/18 17:43:33, majidvp wrote: > On ...
5 years, 3 months ago (2015-09-21 15:44:37 UTC) #10
majidvp
On 2015/09/21 15:44:37, Rick Byers wrote: > https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp > File Source/core/events/Event.cpp (right): > > https://codereview.chromium.org/1352523002/diff/60001/Source/core/events/Event.cpp#newcode279 ...
5 years, 3 months ago (2015-09-24 11:39:23 UTC) #11
dtapuska
On 2015/09/24 11:39:23, majidvp wrote: > On 2015/09/21 15:44:37, Rick Byers wrote: > > > ...
5 years, 3 months ago (2015-09-24 14:36:57 UTC) #12
Rick Byers
This is looking really good. Just a couple more minor suggestions. https://codereview.chromium.org/1352523002/diff/140001/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html File third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html (right): ...
5 years, 2 months ago (2015-09-25 17:29:33 UTC) #13
majidvp
https://codereview.chromium.org/1352523002/diff/140001/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html File third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html (right): https://codereview.chromium.org/1352523002/diff/140001/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html#newcode11 third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html:11: assert_approx_equals(e.timeStamp, now, 0.05, "Timestamp should be within 0.05 ms ...
5 years, 2 months ago (2015-09-29 14:21:31 UTC) #14
Rick Byers
LGTM with nit It's too bad that kinuko@ hasn't had a chance to look at ...
5 years, 2 months ago (2015-09-29 15:57:59 UTC) #15
majidvp
rbyers: following our offline discussion I reverted to continue using epoch time when converting core ...
5 years, 2 months ago (2015-10-01 20:57:19 UTC) #16
Rick Byers
Yeah, sounds good. Hopefully changing the semantics of the plugin timestamp is really easy / ...
5 years, 2 months ago (2015-10-02 00:56:55 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1352523002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1352523002/300001
5 years, 2 months ago (2015-10-02 13:24:31 UTC) #20
commit-bot: I haz the power
Committed patchset #16 (id:300001)
5 years, 2 months ago (2015-10-02 16:30:08 UTC) #21
commit-bot: I haz the power
5 years, 2 months ago (2015-10-02 16:31:17 UTC) #22
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/bfabb071f4c01c0e0ff3c733946771f986bc4b9d
Cr-Commit-Position: refs/heads/master@{#352051}

Powered by Google App Engine
This is Rietveld 408576698