Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Issue 2628423002: Call base::Time::NowFromSystemTime() on WM_TIMECHANGE (Closed)

Created:
3 years, 11 months ago by estark
Modified:
3 years, 11 months ago
Reviewers:
msw, miu
CC:
chromium-reviews, tfarina, meacer
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Call base::Time::NowFromSystemTime() on WM_TIMECHANGE On Windows, base::Time only consults the system clock once every 60 seconds. Thus, prior to this CL, if the system clock changed, base::Time::Now() would continue to reflect the old system clock for up to 60 seconds. This was somewhat weird and caused problems for UI that instructed the user to fix their clock. (A warning would tell the user to fix their clock in order to make a secure connection, but after fixing their clock and refreshing, they still would not be able to establish a connection.) To fix this, we now listen for WM_TIMECHANGE messages and call NowFromSystemTime() upon receiving them. NowFromSystemTime() reinitializes base::Time from the current system clock. BUG=672906 TEST=Set system clock to the year 2010 and load https://google.com. Observe an interstitial page prompting you to fix your clock. Fix your system clock back to the true current date, and refresh. Observe that the page loads as normal. Review-Url: https://codereview.chromium.org/2628423002 Cr-Commit-Position: refs/heads/master@{#444228} Committed: https://chromium.googlesource.com/chromium/src/+/06007208e1229de1a3f7ee70b5a6f2c49589951c

Patch Set 1 #

Patch Set 2 : add base/time.h #

Patch Set 3 : fix base/time include #

Total comments: 2

Patch Set 4 : msw comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -0 lines) Patch
M ui/views/win/hwnd_message_handler.h View 2 chunks +2 lines, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (15 generated)
estark
msw, PTAL? Also adding miu@ as a base/time OWNER in case there is a better ...
3 years, 11 months ago (2017-01-17 06:55:31 UTC) #8
msw
lgtm with a nit. I suspect some issues occur when a base::Time user receives an ...
3 years, 11 months ago (2017-01-17 19:26:32 UTC) #11
miu
lgtm At first, it seemed weird that "ui/views" code would be the mechanism that triggers ...
3 years, 11 months ago (2017-01-17 21:54:01 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2628423002/40001
3 years, 11 months ago (2017-01-17 23:08:57 UTC) #14
miu
On 2017/01/17 23:08:57, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
3 years, 11 months ago (2017-01-17 23:12:23 UTC) #16
estark
Thanks! https://codereview.chromium.org/2628423002/diff/40001/ui/views/win/hwnd_message_handler.cc File ui/views/win/hwnd_message_handler.cc (right): https://codereview.chromium.org/2628423002/diff/40001/ui/views/win/hwnd_message_handler.cc#newcode2175 ui/views/win/hwnd_message_handler.cc:2175: // https://bugs.chromium.org/p/chromium/issues/detail?id=672906#c5 On 2017/01/17 19:26:32, msw wrote: > ...
3 years, 11 months ago (2017-01-18 00:21:14 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2628423002/60001
3 years, 11 months ago (2017-01-18 00:22:08 UTC) #20
commit-bot: I haz the power
3 years, 11 months ago (2017-01-18 01:29:47 UTC) #23
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/06007208e1229de1a3f7ee70b5a6...

Powered by Google App Engine
This is Rietveld 408576698