New issue
Advanced search Search tips

Issue 614409 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Add safety checks to verify event platform timestamp comes from the same clock as TimeTicks::Now()

Project Member Reported by majidvp@chromium.org, May 24 2016

Issue description

We have a long-standing assumption that ui::Event::time_stamp and its brethren have the same time base as TimeTicks::Now(). This is critical to ensure that we get correct metric in Event.Latency.Browser and we expose valid high-res timestamp to Web. (see also  crbug.com/453559  for additional context.)

Add various DCHECKS (and tests, metrics) to ensure that this assumption always holds. 

 
Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c9cc06afc9329f475cf5efd244cc80f713728873

commit c9cc06afc9329f475cf5efd244cc80f713728873
Author: majidvp <majidvp@chromium.org>
Date: Fri Jun 24 21:58:30 2016

Validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now

Generalize existing X11 event timestamp's clock mismatch detection logic and use
it on all platforms. On X11 deviation from system clock is not exceptional so
after  detection we correct by falling back to TimeTicks::Now(). On all other
platforms, this is an exception so we assert and fail (only on DCHECK builds).

Other changes:
- add hooks to allow mocking underlying tick clock used in ui/events.
- fix bug in textfield double click detection logic where small timestamp values
led to breakage.

BUG= 614409 

Review-Url: https://codereview.chromium.org/2007083002
Cr-Commit-Position: refs/heads/master@{#401987}

[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/chromeos/ui_chromeos.gyp
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/base_event_utils.cc
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/base_event_utils.h
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/cocoa/events_mac.mm
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/event_utils.cc
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/event_utils.h
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/test/event_generator.cc
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/win/events_win.cc
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/x/events_x.cc
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/events/x/events_x_utils.cc
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/message_center/message_center.gyp
[modify] https://crrev.com/c9cc06afc9329f475cf5efd244cc80f713728873/ui/views/controls/textfield/textfield.cc

Status: Fixed (was: Started)

Sign in to add a comment