| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // OneShotTimer and RepeatingTimer provide a simple timer API. As the names | 5 // OneShotTimer and RepeatingTimer provide a simple timer API. As the names |
| 6 // suggest, OneShotTimer calls you back once after a time delay expires. | 6 // suggest, OneShotTimer calls you back once after a time delay expires. |
| 7 // RepeatingTimer on the other hand calls you back periodically with the | 7 // RepeatingTimer on the other hand calls you back periodically with the |
| 8 // prescribed time interval. | 8 // prescribed time interval. |
| 9 // | 9 // |
| 10 // OneShotTimer and RepeatingTimer both cancel the timer when they go out of | 10 // OneShotTimer and RepeatingTimer both cancel the timer when they go out of |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 typedef void (Receiver::*ReceiverMethod)(); | 252 typedef void (Receiver::*ReceiverMethod)(); |
| 253 | 253 |
| 254 DelayTimer(const tracked_objects::Location& posted_from, | 254 DelayTimer(const tracked_objects::Location& posted_from, |
| 255 TimeDelta delay, | 255 TimeDelta delay, |
| 256 Receiver* receiver, | 256 Receiver* receiver, |
| 257 ReceiverMethod method) | 257 ReceiverMethod method) |
| 258 : Timer(posted_from, delay, | 258 : Timer(posted_from, delay, |
| 259 base::Bind(method, base::Unretained(receiver)), | 259 base::Bind(method, base::Unretained(receiver)), |
| 260 false) {} | 260 false) {} |
| 261 | 261 |
| 262 void Reset() { Timer::Reset(); } | 262 void Reset() override { Timer::Reset(); } |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 } // namespace base | 265 } // namespace base |
| 266 | 266 |
| 267 #endif // BASE_TIMER_TIMER_H_ | 267 #endif // BASE_TIMER_TIMER_H_ |
| OLD | NEW |