diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-26 18:25:16 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-26 18:25:16 +0000 |
commit | 180c85e3e3691042ab617fd0755dcde6e75d5fbd (patch) | |
tree | b9d4fd7a77f7f54dce4463960326ef7b0cd7a270 /base/message_loop_proxy.h | |
parent | 324ab8e0d77303333f8ad7de3b54d248587687db (diff) | |
download | chromium_src-180c85e3e3691042ab617fd0755dcde6e75d5fbd.zip chromium_src-180c85e3e3691042ab617fd0755dcde6e75d5fbd.tar.gz chromium_src-180c85e3e3691042ab617fd0755dcde6e75d5fbd.tar.bz2 |
Support Closure in ALL the loops!
Add an overload for PostTask into MessageLoopProxy, and WorkerPool.
BUG=35223
TEST=unittests.
Review URL: http://codereview.chromium.org/7316015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop_proxy.h')
-rw-r--r-- | base/message_loop_proxy.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/base/message_loop_proxy.h b/base/message_loop_proxy.h index 07bca64..d6955ba 100644 --- a/base/message_loop_proxy.h +++ b/base/message_loop_proxy.h @@ -8,6 +8,7 @@ #include "base/base_api.h" #include "base/basictypes.h" +#include "base/callback.h" #include "base/memory/ref_counted.h" #include "base/task.h" @@ -34,13 +35,34 @@ class BASE_API MessageLoopProxy virtual bool PostTask(const tracked_objects::Location& from_here, Task* task) = 0; virtual bool PostDelayedTask(const tracked_objects::Location& from_here, - Task* task, int64 delay_ms) = 0; + Task* task, + int64 delay_ms) = 0; virtual bool PostNonNestableTask(const tracked_objects::Location& from_here, Task* task) = 0; virtual bool PostNonNestableDelayedTask( const tracked_objects::Location& from_here, Task* task, int64 delay_ms) = 0; + + // TODO(ajwong): Remove the functions above once the Task -> Closure migration + // is complete. + // + // There are 2 sets of Post*Task functions, one which takes the older Task* + // function object representation, and one that takes the newer base::Closure. + // We have this overload to allow a staged transition between the two systems. + // Once the transition is done, the functions above should be deleted. + virtual bool PostTask(const tracked_objects::Location& from_here, + const base::Closure& task) = 0; + virtual bool PostDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + int64 delay_ms) = 0; + virtual bool PostNonNestableTask(const tracked_objects::Location& from_here, + const base::Closure& task) = 0; + virtual bool PostNonNestableDelayedTask( + const tracked_objects::Location& from_here, + const base::Closure& task, + int64 delay_ms) = 0; + // A method which checks if the caller is currently running in the thread that // this proxy represents. virtual bool BelongsToCurrentThread() = 0; |