Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2896)

Unified Diff: base/timer.h

Issue 13042: Revert 6190 to see if it's the cause of the 100+ new regressions... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/timer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer.h
===================================================================
--- base/timer.h (revision 6197)
+++ base/timer.h (working copy)
@@ -135,42 +135,21 @@
receiver_(receiver),
method_(method) {
}
-
- virtual ~TimerTask() {
- ClearBaseTimer();
- }
-
virtual void Run() {
if (!timer_) // timer_ is null if we were orphaned.
return;
- if (kIsRepeating)
- ResetBaseTimer();
- else
- ClearBaseTimer();
+ SelfType* self = static_cast<SelfType*>(timer_);
+ if (kIsRepeating) {
+ self->Reset();
+ } else {
+ self->delayed_task_ = NULL;
+ }
DispatchToMethod(receiver_, method_, Tuple0());
}
-
TimerTask* Clone() const {
return new TimerTask(delay_, receiver_, method_);
}
-
private:
- // Inform the Base that the timer is no longer active.
- void ClearBaseTimer() {
- if (timer_) {
- SelfType* self = static_cast<SelfType*>(timer_);
- self->delayed_task_ = NULL;
- }
- }
-
- // Inform the Base that we're resetting the timer.
- void ResetBaseTimer() {
- DCHECK(timer_);
- DCHECK(kIsRepeating);
- SelfType* self = static_cast<SelfType*>(timer_);
- self->Reset();
- }
-
Receiver* receiver_;
ReceiverMethod method_;
};
« no previous file with comments | « no previous file | base/timer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698