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

Unified Diff: base/timer/timer.cc

Issue 2557663002: GetTimeToCallback() returns estimated time to callback. (Closed)
Patch Set: Removed an old file that sneaked in the patchest. Created 4 years 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 | « base/timer/timer.h ('k') | base/timer/timer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer/timer.cc
diff --git a/base/timer/timer.cc b/base/timer/timer.cc
index 6ec18f181488c3a5b533abe93cf9b793914e6451..6e86c11c5d06ae15312a5108757888ac04675bbd 100644
--- a/base/timer/timer.cc
+++ b/base/timer/timer.cc
@@ -107,6 +107,12 @@ TimeDelta Timer::GetCurrentDelay() const {
return delay_;
}
+TimeDelta Timer::GetTimeToCallback() const {
+ if (!user_task_)
+ return TimeDelta::Max();
+ return scheduled_run_time_ - Now();
+}
+
void Timer::SetTaskRunner(scoped_refptr<SingleThreadTaskRunner> task_runner) {
// Do not allow changing the task runner once something has been scheduled.
DCHECK_EQ(thread_id_, 0);
« no previous file with comments | « base/timer/timer.h ('k') | base/timer/timer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698