Commit 2b3d6de2 authored by ulan@chromium.org's avatar ulan@chromium.org

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
parent 4b227a2a
......@@ -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_);
......
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