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

Side by Side Diff: ui/events/x/events_x.cc

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, 5 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 unified diff | Download patch
« no previous file with comments | « ui/events/win/events_win.cc ('k') | ui/events/x/events_x_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/event_utils.h" 5 #include "ui/events/event_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 #include <X11/extensions/XInput.h> 9 #include <X11/extensions/XInput.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 EventType EventTypeFromNative(const base::NativeEvent& native_event) { 79 EventType EventTypeFromNative(const base::NativeEvent& native_event) {
80 return EventTypeFromXEvent(*native_event); 80 return EventTypeFromXEvent(*native_event);
81 } 81 }
82 82
83 int EventFlagsFromNative(const base::NativeEvent& native_event) { 83 int EventFlagsFromNative(const base::NativeEvent& native_event) {
84 return EventFlagsFromXEvent(*native_event); 84 return EventFlagsFromXEvent(*native_event);
85 } 85 }
86 86
87 base::TimeTicks EventTimeFromNative(const base::NativeEvent& native_event) { 87 base::TimeTicks EventTimeFromNative(const base::NativeEvent& native_event) {
88 return EventTimeFromXEvent(*native_event); 88 base::TimeTicks timestamp = EventTimeFromXEvent(*native_event);
89 ValidateEventTimeClock(&timestamp);
90 return timestamp;
89 } 91 }
90 92
91 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { 93 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
92 return EventLocationFromXEvent(*native_event); 94 return EventLocationFromXEvent(*native_event);
93 } 95 }
94 96
95 gfx::Point EventSystemLocationFromNative( 97 gfx::Point EventSystemLocationFromNative(
96 const base::NativeEvent& native_event) { 98 const base::NativeEvent& native_event) {
97 return EventSystemLocationFromXEvent(*native_event); 99 return EventSystemLocationFromXEvent(*native_event);
98 } 100 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 xievent->detail = 227 xievent->detail =
226 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); 228 UpdateX11EventButton(event->changed_button_flags(), xievent->detail);
227 break; 229 break;
228 } 230 }
229 default: 231 default:
230 break; 232 break;
231 } 233 }
232 } 234 }
233 235
234 } // namespace ui 236 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/win/events_win.cc ('k') | ui/events/x/events_x_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698