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

Unified Diff: ui/events/cocoa/events_mac.mm

Issue 2007083002: Validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@453559-use-timeticks-ui-event
Patch Set: Address feedback Created 4 years, 6 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/events/base_event_utils.cc ('k') | ui/events/event_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/cocoa/events_mac.mm
diff --git a/ui/events/cocoa/events_mac.mm b/ui/events/cocoa/events_mac.mm
index 8b4cde2fabcb5097eee7d3877062e14f6d709490..dbfd64c7fdcd36360671423bdd98fca793366f23 100644
--- a/ui/events/cocoa/events_mac.mm
+++ b/ui/events/cocoa/events_mac.mm
@@ -84,8 +84,10 @@ base::TimeTicks EventTimeFromNative(const base::NativeEvent& native_event) {
int64_t seconds = since_system_startup;
since_system_startup -= seconds;
int64_t microseconds = since_system_startup * 1000000;
- return ui::EventTimeStampFromSeconds(seconds) +
+ base::TimeTicks timestamp = ui::EventTimeStampFromSeconds(seconds) +
base::TimeDelta::FromMicroseconds(microseconds);
+ ValidateEventTimeClock(&timestamp);
+ return timestamp;
}
gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
« no previous file with comments | « ui/events/base_event_utils.cc ('k') | ui/events/event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698