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); |