diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-20 00:25:57 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-20 00:25:57 +0000 |
commit | 1a2bfdd793e88a64f78b38d23303550cfd0703eb (patch) | |
tree | 90ef0670a00f72c3e0cc2499866d5627511a4867 /base/message_pump.h | |
parent | 7759c9a7b587662988fa1357c17c273ee64fb3bd (diff) | |
download | chromium_src-1a2bfdd793e88a64f78b38d23303550cfd0703eb.zip chromium_src-1a2bfdd793e88a64f78b38d23303550cfd0703eb.tar.gz chromium_src-1a2bfdd793e88a64f78b38d23303550cfd0703eb.tar.bz2 |
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
Diffstat (limited to 'base/message_pump.h')
-rw-r--r-- | base/message_pump.h | 17 |
1 files changed, 9 insertions, 8 deletions
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<MessagePump> { // 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<MessagePump> { // 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 |