diff options
author | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 16:37:33 +0000 |
---|---|---|
committer | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 16:37:33 +0000 |
commit | 96e473586171cbd36ede44ca45c65dd6f8ad8c09 (patch) | |
tree | fe0000ce6144f2d8199d8d01ed960a218d140a6b /base/timer.h | |
parent | bfbc29e64accc868441d1a3302064ae8438ff85e (diff) | |
download | chromium_src-96e473586171cbd36ede44ca45c65dd6f8ad8c09.zip chromium_src-96e473586171cbd36ede44ca45c65dd6f8ad8c09.tar.gz chromium_src-96e473586171cbd36ede44ca45c65dd6f8ad8c09.tar.bz2 |
Revert the timer code again because even after relanding
it on a clean and clobbered tree, it caused all the
failures
Review URL: http://codereview.chromium.org/12870
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/timer.h')
-rw-r--r-- | base/timer.h | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/base/timer.h b/base/timer.h index f449d2a..5361130 100644 --- a/base/timer.h +++ b/base/timer.h @@ -135,42 +135,21 @@ class BaseTimer : public BaseTimer_Helper { 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_; }; |