Resynchronize timers if the Windows system time was changed.
R=jkummerow@chromium.org BUG=119815 TEST=Change the system time one day back: (new Date()) will return incorrect time. Review URL: https://chromiumcodereview.appspot.com/9865021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11165 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
4b227a2a79
commit
2b3d6de2dd
@ -462,6 +462,9 @@ void Time::SetToCurrentTime() {
|
||||
// Check if we need to resync due to elapsed time.
|
||||
needs_resync |= (time_now.t_ - init_time.t_) > kMaxClockElapsedTime;
|
||||
|
||||
// Check if we need to resync due to backwards time change.
|
||||
needs_resync |= time_now.t_ < init_time.t_;
|
||||
|
||||
// Resync the clock if necessary.
|
||||
if (needs_resync) {
|
||||
GetSystemTimeAsFileTime(&init_time.ft_);
|
||||
|
Loading…
Reference in New Issue
Block a user