• majidvp's avatar
    Change ui::Event::time_stamp from TimeDelta to TimeTicks · 9b3bda8e
    majidvp authored
    Event timestamp values are now consistently coming from the same clock as
    base::TimeTicks. Historically this was not the case in particular on Windows
    platform which is why we were using  base::TimeDelta instead.
    
    Now that this has been addressed we should use base::TimeTicks to make it clear
    that these values are expected to come from the same clock and remove some
    crufty code.
    
    The changes in the CL are pretty simple and mechanical:
    - Introduce a pair of conversion functions in ui/events/base_event_utils.h to
    convert between  WebInputEvent::timeStampSeconds (double) and
    ui::Event::timeStamp (TimeTicks)
    - TimeDelta() =>TimeTicks()
    - TimeDelta::FromMilliseconds(0) => base::TimeTicks()
    - TimeDelta::FromInternalValue(TimeTicks::Now().ToInternalValue())  => TimeTicks::Now()
    - TimeDelta::FromMilliseconds(Time::Now().ToDoubleT() * 1000) => TimeTicks::Now()
    - Time::NowFromSystemTime() - base::Time() => TimeTicks::Now()
    
    BUG=453559
    
    Review-Url: https://codereview.chromium.org/1975533002
    Cr-Commit-Position: refs/heads/master@{#398947}
    9b3bda8e
Name
Last commit
Last update
..
clock.cc Loading commit data...
clock.h Loading commit data...
default_clock.cc Loading commit data...
default_clock.h Loading commit data...
default_tick_clock.cc Loading commit data...
default_tick_clock.h Loading commit data...
pr_time_unittest.cc Loading commit data...
tick_clock.cc Loading commit data...
tick_clock.h Loading commit data...
time.cc Loading commit data...
time.h Loading commit data...
time_mac.cc Loading commit data...
time_posix.cc Loading commit data...
time_unittest.cc Loading commit data...
time_win.cc Loading commit data...
time_win_unittest.cc Loading commit data...