Commit aacf8c02 authored by Tim Dresser's avatar Tim Dresser Committed by Commit Bot

Fix bogus event timestamps across all platforms.

First Input Delay was reporting bogus values in > 0.0006% of cases.
The data suggests that this is due to invalid event timestamps.

Bug: 861855
Change-Id: Ib3e6bb22348546f60dc6b98c6955e8620e87672b
Reviewed-on: https://chromium-review.googlesource.com/1129843
Commit-Queue: Timothy Dresser <tdresser@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573878}
parent 84acc05f
......@@ -67,25 +67,14 @@ bool IsValidTimebase(base::TimeTicks now, base::TimeTicks timestamp) {
}
void ValidateEventTimeClock(base::TimeTicks* timestamp) {
#if defined(USE_X11)
// Restrict this correction to X11 which is known to provide bogus timestamps
// that require correction (crbug.com/611950).
// Some fraction of devices, across all platforms provide bogus event
// timestamps. See https://crbug.com/650338#c1. Correct timestamps which are
// clearly bogus.
// TODO(861855): Replace this with an approach that doesn't require an extra
// read of the current time per event.
base::TimeTicks now = EventTimeForNow();
if (!IsValidTimebase(now, *timestamp))
*timestamp = now;
#elif DCHECK_IS_ON()
if (base::debug::BeingDebugged())
return;
base::TimeTicks now = EventTimeForNow();
DCHECK(IsValidTimebase(now, *timestamp))
<< "Event timestamp (" << *timestamp << ") is not consistent with "
<< "current time (" << now << ").";
#endif
}
bool ShouldDefaultToNaturalScroll() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment