Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1278)

Unified Diff: base/message_loop_proxy.h

Issue 7316015: Support Closure in ALL the loops! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed nit and rebased. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop.cc ('k') | base/message_loop_proxy_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop_proxy.h
diff --git a/base/message_loop_proxy.h b/base/message_loop_proxy.h
index 07bca646f56ab9e676d4b8ab51c50f4361a23250..d6955ba294247c52fd0ca504236511632e0c9696 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;
« no previous file with comments | « base/message_loop.cc ('k') | base/message_loop_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698