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

Unified Diff: ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc

Issue 990483002: ozone: evdev: Fix possibility of stuck keys with libevdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/ozone/evdev/libgestures_glue/gesture_timer_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc
diff --git a/ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc b/ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc
index 2b08b9844192b202800467e7a8e7b4d478eb09d3..61c2d1a2505deedaa8363e9747d44dc5c9ea3018 100644
--- a/ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc
+++ b/ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc
@@ -28,12 +28,8 @@ struct GesturesTimer {
private:
void OnTimerExpired() {
- struct timespec ts;
- int fail = clock_gettime(CLOCK_MONOTONIC, &ts);
- DCHECK(!fail);
-
// Run the callback and reschedule the next run if requested.
- stime_t next_delay = callback_(StimeFromTimespec(&ts), callback_data_);
+ stime_t next_delay = callback_(ui::StimeNow(), callback_data_);
if (next_delay >= 0) {
timer_.Start(FROM_HERE,
base::TimeDelta::FromMicroseconds(
@@ -68,6 +64,15 @@ void GesturesTimerFree(void* data, GesturesTimer* timer) { delete timer; }
} // namespace
+stime_t StimeNow() {
+ struct timespec ts;
+
+ if (clock_gettime(CLOCK_MONOTONIC, &ts))
+ PLOG(FATAL) << "clock_gettime";
+
+ return StimeFromTimespec(&ts);
+}
+
const GesturesTimerProvider kGestureTimerProvider = {
GesturesTimerCreate, GesturesTimerSet, GesturesTimerCancel,
GesturesTimerFree};
« no previous file with comments | « ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698