Home | History | Annotate | Download | only in timer

Lines Matching refs:Timer

5 #include "base/timer/timer.h"
20 // BaseTimerTaskInternal is a simple delegate for scheduling a callback to Timer
23 // - abandoned (orphaned) by Timer.
26 explicit BaseTimerTaskInternal(Timer* timer)
27 : timer_(timer) {
32 // destructed. If so, don't leave Timer with a dangling pointer
43 // |this| will be deleted by the task runner, so Timer needs to forget us:
46 // Although Timer should not call back into |this|, let's clear |timer_|
48 Timer* timer = timer_;
50 timer->RunScheduledTask();
57 Timer* timer_;
62 Timer::Timer(bool retain_user_task, bool is_repeating)
63 : Timer(retain_user_task, is_repeating, nullptr) {}
65 Timer::Timer(bool retain_user_task,
73 // It is safe for the timer to be created on a different thread/sequence than
74 // the one from which the timer APIs are called. The first call to the
80 Timer::Timer(const Location& posted_from,
84 : Timer(posted_from, delay, user_task, is_repeating, nullptr) {}
86 Timer::Timer(const Location& posted_from,
103 Timer::~Timer() {
108 bool Timer::IsRunning() const {
113 TimeDelta Timer::GetCurrentDelay() const {
118 void Timer::SetTaskRunner(scoped_refptr<SequencedTaskRunner> task_runner) {
119 // Do not allow changing the task runner when the Timer is running.
121 // allow the use case of constructing the Timer and immediatetly invoking
130 void Timer::Start(const Location& posted_from,
142 void Timer::Stop() {
149 // It's safe to destroy or restart Timer on another sequence after Stop().
158 void Timer::Reset() {
186 TimeTicks Timer::Now() const {
193 void Timer::PostNewScheduledTask(TimeDelta delay) {
217 scoped_refptr<SequencedTaskRunner> Timer::GetTaskRunner() {
221 void Timer::AbandonScheduledTask() {
231 void Timer::RunScheduledTask() {