Lines Matching refs:Timer
85 // alarm timer and then watches that file descriptor to see when it can be read
86 // without blocking, indicating that the timer has fired.
89 // available on a MessageLoopForIO but there is no guarantee the timer is going
90 // to be created on one. To get around this, the timer has a dedicated thread
92 // timer.
101 // Returns true if the system timer managed by this delegate is capable of
105 // Resets the timer to fire after |delay| has passed. Cancels any
109 // Stops the currently running timer. It should be safe to call this even if
110 // the timer is not running.
113 // Sets a hook that will be called when the timer fires and a task has been
126 // Actually performs the system calls to set up the timer. This must be
130 // Callback that is run when the timer fires. Must be run on
134 // File descriptor associated with the alarm timer.
137 // Task runner which initially started the timer.
140 // Callback that should be run when the timer fires.
143 // Hook used by tests to be notified when the timer has fired and a task has
152 // timer file descriptor. Note that these can be the same MessageLoop.
183 // Get a task runner for the current message loop. When the timer fires, we
185 // post tasks to this proxy to let the parent timer know.
192 // Calling timerfd_settime with a zero delay actually clears the timer so if
193 // the user has requested a zero delay timer, we need to handle it
230 // Now clear the timer.
235 PLOG(ERROR) << "Unable to clear alarm time. Timer may still fire.";
244 PLOG(DFATAL) << "Unable to read from timer file descriptor.";
246 // Make sure that the parent timer is informed on the proper message loop.
271 // Store the sequence number in the IO thread variable. When the timer
273 // that we do the right thing if the timer gets reset.
279 // Start watching the fd to see when the timer fires.
284 << "alarm. Timer will not fire.";
287 // Actually set the timer. This will also clear the pre-existing timer, if
296 PLOG(ERROR) << "Error while setting alarm time. Timer will not fire";
315 // Check to make sure that the timer was not reset in the time between when
325 : base::Timer(retain_user_task, is_repeating),
336 : base::Timer(posted_from, delay, user_task, is_repeating),
358 if (!base::Timer::is_running())
362 base::Timer::Stop();
367 base::Timer::set_is_running(false);
375 if (!base::Timer::retain_user_task())
376 base::Timer::set_user_task(base::Closure());
381 base::Timer::Reset();
385 DCHECK(!base::Timer::user_task().is_null());
389 // Make sure that the timer will stop if the underlying message loop is
400 if (base::Timer::GetCurrentDelay() > base::TimeDelta::FromMicroseconds(0)) {
401 base::Timer::set_desired_run_time(base::TimeTicks::Now() +
402 base::Timer::GetCurrentDelay());
404 base::Timer::posted_from(), base::Timer::user_task(),
405 base::Timer::desired_run_time(), true /* nestable */));
407 base::Timer::set_desired_run_time(base::TimeTicks());
408 pending_task_.reset(new base::PendingTask(base::Timer::posted_from(),
409 base::Timer::user_task()));
414 // Now start up the timer.
415 delegate_->Reset(base::Timer::GetCurrentDelay());
416 base::Timer::set_is_running(true);
424 if (!base::Timer::IsRunning())
433 // Re-schedule or stop the timer as requested.
434 if (base::Timer::is_repeating())