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

Side by Side Diff: ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 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/gesture_detection/gesture_detector.cc ('k') | ui/gfx/animation/animation_container.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ozone/evdev/libgestures_glue/gesture_timer_provider.h" 5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.h"
6 6
7 #include <gestures/gestures.h> 7 #include <gestures/gestures.h>
8 8
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 10
(...skipping 23 matching lines...) Expand all
34 timer_.Start(FROM_HERE, 34 timer_.Start(FROM_HERE,
35 base::TimeDelta::FromMicroseconds( 35 base::TimeDelta::FromMicroseconds(
36 next_delay * base::Time::kMicrosecondsPerSecond), 36 next_delay * base::Time::kMicrosecondsPerSecond),
37 this, 37 this,
38 &GesturesTimer::OnTimerExpired); 38 &GesturesTimer::OnTimerExpired);
39 } 39 }
40 } 40 }
41 41
42 GesturesTimerCallback callback_ = nullptr; 42 GesturesTimerCallback callback_ = nullptr;
43 void* callback_data_ = nullptr; 43 void* callback_data_ = nullptr;
44 base::OneShotTimer<GesturesTimer> timer_; 44 base::OneShotTimer timer_;
45 }; 45 };
46 46
47 namespace ui { 47 namespace ui {
48 48
49 namespace { 49 namespace {
50 50
51 GesturesTimer* GesturesTimerCreate(void* data) { return new GesturesTimer; } 51 GesturesTimer* GesturesTimerCreate(void* data) { return new GesturesTimer; }
52 52
53 void GesturesTimerSet(void* data, 53 void GesturesTimerSet(void* data,
54 GesturesTimer* timer, 54 GesturesTimer* timer,
(...skipping 16 matching lines...) Expand all
71 PLOG(FATAL) << "clock_gettime"; 71 PLOG(FATAL) << "clock_gettime";
72 72
73 return StimeFromTimespec(&ts); 73 return StimeFromTimespec(&ts);
74 } 74 }
75 75
76 const GesturesTimerProvider kGestureTimerProvider = { 76 const GesturesTimerProvider kGestureTimerProvider = {
77 GesturesTimerCreate, GesturesTimerSet, GesturesTimerCancel, 77 GesturesTimerCreate, GesturesTimerSet, GesturesTimerCancel,
78 GesturesTimerFree}; 78 GesturesTimerFree};
79 79
80 } // namespace ui 80 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_detector.cc ('k') | ui/gfx/animation/animation_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698