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

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

Issue 2628423002: Call base::Time::NowFromSystemTime() on WM_TIMECHANGE (Closed)
Patch Set: msw comment 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..a58c5f73ed84f641a44d043652cd2939c1d5d7cd 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,13 @@ 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://crbug.com/672906#c5
+ 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