diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-28 20:50:12 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-28 20:50:12 +0000 |
commit | aeab57ea8560065d6c513fcd46bb43e1bfbfd7a6 (patch) | |
tree | a63f2d36e86361d5c27122a6d6ef4098b755d7d9 /base/message_loop.h | |
parent | e115558691eb08608fad56bb32f40265fdfa4ac5 (diff) | |
download | chromium_src-aeab57ea8560065d6c513fcd46bb43e1bfbfd7a6.zip chromium_src-aeab57ea8560065d6c513fcd46bb43e1bfbfd7a6.tar.gz chromium_src-aeab57ea8560065d6c513fcd46bb43e1bfbfd7a6.tar.bz2 |
Simplify OneShotTimer and RepeatingTimer. Fix up all consumers.
Major changes:
OneShotTimer and RepeatingTimer become template classes that no longer require
a Task or a Timer object. They just use PostDelayedTask. Under the hood that
still uses a Timer object.
The API is much simpler for consumers as they now no longer need to worry about
allocating a Task or managing the lifetime of the object pointer held by the
Task.
I added some new unit tests to timer_unittest.cc to cover the API.
I preserved the old TimerManager / Timer API for now, but I plan to soon kill
it.
R=brettw
BUG=1346553
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.h')
-rw-r--r-- | base/message_loop.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/base/message_loop.h b/base/message_loop.h index b4e84e6..efdb5d7 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -200,7 +200,7 @@ class MessageLoop : public base::MessagePump::Delegate { } // Returns the TimerManager object for the current thread. - TimerManager* timer_manager() { return &timer_manager_; } + base::TimerManager* timer_manager() { return &timer_manager_; } // Enables or disables the recursive task processing. This happens in the case // of recursive message loops. Some unwanted message loop may occurs when @@ -231,7 +231,7 @@ class MessageLoop : public base::MessagePump::Delegate { //---------------------------------------------------------------------------- protected: - friend class TimerManager; // So it can call DidChangeNextTimerExpiry + friend class base::TimerManager; // So it can call DidChangeNextTimerExpiry struct RunState { // Used to count how many Run() invocations are on the stack. @@ -405,7 +405,7 @@ class MessageLoop : public base::MessagePump::Delegate { Type type_; - TimerManager timer_manager_; + base::TimerManager timer_manager_; // A list of tasks that need to be processed by this instance. Note that this // queue is only accessed (push/pop) by our current thread. |