Skip to content

Commit

Permalink
Use virtual call to base::Timer::Start
Browse files Browse the repository at this point in the history
Also update base::Bind to base::BindRepeating.

Background: I tried using the template form of Start() on a base::MockTimer and
was confused because it wasn't working.  This was because Timer::Start() was
getting called instead of MockTimer::Start.

BUG=None
R=thestig

Change-Id: I15341804f364c9d5fd1f590c5e6d02db1728614c
Reviewed-on: https://chromium-review.googlesource.com/1038815
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555411}
  • Loading branch information
tanderson-google authored and Commit Bot committed May 2, 2018
1 parent 505dab6 commit ab5340b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/timer/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ class BASE_EXPORT Timer {
TimeDelta delay,
Receiver* receiver,
void (Receiver::*method)()) {
Timer::Start(posted_from, delay,
base::Bind(method, base::Unretained(receiver)));
Start(posted_from, delay,
base::BindRepeating(method, base::Unretained(receiver)));
}

// Call this method to stop and cancel the timer. It is a no-op if the timer
Expand Down

0 comments on commit ab5340b

Please sign in to comment.