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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 2628423002: Call base::Time::NowFromSystemTime() on WM_TIMECHANGE (Closed)
Patch Set: fix base/time include Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 67482e22aee4b5372ef52cc0562f0b816a47b7f4..97cce19086ef563c28ffaf1e7f72c72d149712f1 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -18,6 +18,7 @@
#include "base/macros.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/win/scoped_gdi_object.h"
#include "base/win/windows_version.h"
@@ -2167,6 +2168,14 @@ void HWNDMessageHandler::OnThemeChanged() {
ui::NativeThemeWin::CloseHandles();
}
+void HWNDMessageHandler::OnTimeChange() {
+ // Call NowFromSystemTime() to force base::Time to re-initialize the clock
+ // from system time. Otherwise base::Time::Now() might continue to reflect the
+ // old system clock for some amount of time. See
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=672906#c5
msw 2017/01/17 19:26:32 nit: shorten url: crbug.com/672906#c5 (optionally
estark 2017/01/18 00:21:12 Done.
+ base::Time::NowFromSystemTime();
+}
+
LRESULT HWNDMessageHandler::OnTouchEvent(UINT message,
WPARAM w_param,
LPARAM l_param) {
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698