• majidvp's avatar
    Correctly handle -epoch time values when converting from JS time to base::Time · 6650abf2
    majidvp authored
    -11644473600 seconds (which represents windows epoch time of
    |1601-01-01 00:00:00 UTC|) is a valid time value in Javascript. Incidentally
    this value is internally represented by 0 which is mistakenly confused with a
    null time value.
    
    FromJsTime is meant to be used to convert time values coming from Javascript
    for which 0 or -epoch do not represent null values. So the extra check was
    incorrect.
    
    * In fact there is a comment in FromJsTime method making it clear that 0 is a
    valid value but this was missed in ToJsTime method.
    
    TEST=./base_unittests --gtest_filter=TimeTest.JsTime
    
    BUG=625680
    
    Review-Url: https://codereview.chromium.org/2593073002
    Cr-Commit-Position: refs/heads/master@{#440304}
    6650abf2
Name
Last commit
Last update
..
OWNERS Loading commit data...
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...