Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/renderer/net/mockable_one_shot_timer.h" | |
| 6 | |
| 7 MockableOneShotTimer::MockableOneShotTimer() {} | |
| 8 MockableOneShotTimer::~MockableOneShotTimer() {} | |
| 9 | |
| 10 void MockableOneShotTimer::Fired() { | |
| 11 task_.Run(); | |
|
mmenke
2014/03/04 17:26:25
Per comment in the unit test file, I think we shou
Elly Fong-Jones
2014/03/06 21:48:37
Done.
| |
| 12 } | |
| 13 | |
| 14 void MockableOneShotTimer::Start( | |
| 15 const tracked_objects::Location& posted_from, base::TimeDelta delay, | |
| 16 const base::Closure& task) { | |
| 17 DCHECK(!task.is_null()); | |
| 18 task_ = task; | |
| 19 timer_.Start(posted_from, delay, | |
| 20 base::Bind(&MockableOneShotTimer::Fired, base::Unretained(this))); | |
| 21 } | |
| 22 | |
| 23 void MockableOneShotTimer::Stop() { | |
| 24 timer_.Stop(); | |
| 25 } | |
| 26 | |
| 27 bool MockableOneShotTimer::IsRunning() const { | |
| 28 return timer_.IsRunning(); | |
| 29 } | |
| OLD | NEW |