From 1a2bfdd793e88a64f78b38d23303550cfd0703eb Mon Sep 17 00:00:00 2001 From: "darin@google.com" Date: Wed, 20 Aug 2008 00:25:57 +0000 Subject: Eliminate TimerManager::GetCurrentDelay in favor of always referring to the fire time of the next timer. I changed the MessagePump API to refer to a delayed_work_time instead of a delay. I moved the ceil-based rounding code into the Window's implementations of WaitableEvent and MessagePump. R=jar git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1075 0039d316-1c4b-4281-b951-d872f2087c98 --- base/message_pump.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'base/message_pump.h') diff --git a/base/message_pump.h b/base/message_pump.h index a06a435..06cef43 100644 --- a/base/message_pump.h +++ b/base/message_pump.h @@ -32,7 +32,7 @@ #include "base/ref_counted.h" -class TimeDelta; +class Time; namespace base { @@ -52,11 +52,12 @@ class MessagePump : public RefCountedThreadSafe { // Called from within Run in response to ScheduleDelayedWork or when the // message pump would otherwise sleep waiting for more work. Returns true // to indicate that delayed work was done. DoIdleWork will not be called - // if DoDelayedWork returns true. Upon return |next_delay| indicates the - // next delayed work interval. If |next_delay| is negative, then the queue - // of future delayed work (timer events) is currently empty, and no - // additional calls to this function need to be scheduled. - virtual bool DoDelayedWork(TimeDelta* next_delay) = 0; + // if DoDelayedWork returns true. Upon return |next_delayed_work_time| + // indicates the time when DoDelayedWork should be called again. If + // |next_delayed_work_time| is null (per Time::is_null), then the queue of + // future delayed work (timer events) is currently empty, and no additional + // calls to this function need to be scheduled. + virtual bool DoDelayedWork(Time* next_delayed_work_time) = 0; // Called from within Run just before the message pump goes to sleep. // Returns true to indicate that idle work was done. @@ -137,10 +138,10 @@ class MessagePump : public RefCountedThreadSafe { // until it returns a value of false. virtual void ScheduleWork() = 0; - // Schedule a DoDelayedWork callback to happen after the specified delay, + // Schedule a DoDelayedWork callback to happen at the specified time, // cancelling any pending DoDelayedWork callback. This method may only be // used on the thread that called Run. - virtual void ScheduleDelayedWork(const TimeDelta& delay) = 0; + virtual void ScheduleDelayedWork(const Time& delayed_work_time) = 0; }; } // namespace base -- cgit v1.1