From aa9be60bf5ddd299ea216b958097fc550242c013 Mon Sep 17 00:00:00 2001 From: "nsylvain@chromium.org" Date: Tue, 2 Dec 2008 06:02:18 +0000 Subject: Revert 6190 to see if it's the cause of the 100+ new regressions on the distributed tests. TBR Review URL: http://codereview.chromium.org/13042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6205 0039d316-1c4b-4281-b951-d872f2087c98 --- base/timer.h | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'base/timer.h') 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(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(timer_); - self->delayed_task_ = NULL; - } - } - - // Inform the Base that we're resetting the timer. - void ResetBaseTimer() { - DCHECK(timer_); - DCHECK(kIsRepeating); - SelfType* self = static_cast(timer_); - self->Reset(); - } - Receiver* receiver_; ReceiverMethod method_; }; -- cgit v1.1