Commit c2467847 authored by sheckylin's avatar sheckylin Committed by Commit bot

Fix uninitialized timestamps being passed to the gesture lib

The CL corrects a bug where clock_gettime was placed in
a DCHECK call and thus not executed on release builds.

Contributed by sheckylin@chromium.org

BUG=chrome-os-partner:35111
TEST=samus ChromeOS build

Review URL: https://codereview.chromium.org/884313002

Cr-Commit-Position: refs/heads/master@{#313634}
parent 2f5993f9
...@@ -29,7 +29,10 @@ struct GesturesTimer { ...@@ -29,7 +29,10 @@ struct GesturesTimer {
private: private:
void OnTimerExpired() { void OnTimerExpired() {
struct timespec ts; struct timespec ts;
DCHECK(!clock_gettime(CLOCK_MONOTONIC, &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_(StimeFromTimespec(&ts), callback_data_);
if (next_delay >= 0) { if (next_delay >= 0) {
timer_.Start(FROM_HERE, timer_.Start(FROM_HERE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment