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 #ifndef CHROME_RENDERER_NET_MOCKABLE_ONE_SHOT_TIMER_H_ | |
| 6 #define CHROME_RENDERER_NET_MOCKABLE_ONE_SHOT_TIMER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "base/timer/timer.h" | |
| 11 | |
| 12 class MockableOneShotTimer { | |
| 13 public: | |
| 14 MockableOneShotTimer(); | |
| 15 virtual ~MockableOneShotTimer(); | |
| 16 | |
| 17 // This interface mirrors base::OneShotTimer. | |
| 18 virtual void Start(const tracked_objects::Location& posted_from, | |
| 19 base::TimeDelta delay, | |
| 20 const base::Closure& task); | |
| 21 virtual void Stop(); | |
| 22 virtual bool IsRunning() const; | |
| 23 | |
| 24 private: | |
| 25 void Fired(); | |
| 26 | |
| 27 base::OneShotTimer<MockableOneShotTimer> timer_; | |
| 28 base::Closure task_; | |
| 29 base::Closure old_task_; | |
|
mmenke
2014/03/11 20:07:54
old_task_ is not used.
Elly Fong-Jones
2014/03/12 15:08:58
Done.
| |
| 30 | |
| 31 DISALLOW_COPY_AND_ASSIGN(MockableOneShotTimer); | |
| 32 }; | |
| 33 | |
| 34 #endif // CHROME_RENDERER_NET_MOCKABLE_ONE_SHOT_TIMER_H_ | |
| OLD | NEW |