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

Unified Diff: base/task_runner.h

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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/sequenced_task_runner.cc ('k') | base/task_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_runner.h
diff --git a/base/task_runner.h b/base/task_runner.h
index 9593835eebbdfa51f43e1d236f387f3ee1ac7940..8f72d9913823a5e730d031396e0db35670b90ddb 100644
--- a/base/task_runner.h
+++ b/base/task_runner.h
@@ -62,7 +62,7 @@ class BASE_EXPORT TaskRunner
//
// Equivalent to PostDelayedTask(from_here, task, 0).
bool PostTask(const tracked_objects::Location& from_here,
- const Closure& task);
+ OnceClosure task);
// Like PostTask, but tries to run the posted task only after
// |delay_ms| has passed.
@@ -70,7 +70,7 @@ class BASE_EXPORT TaskRunner
// It is valid for an implementation to ignore |delay_ms|; that is,
// to have PostDelayedTask behave the same as PostTask.
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
- const Closure& task,
+ OnceClosure task,
base::TimeDelta delay) = 0;
// Returns true if the current thread is a thread on which a task
@@ -123,8 +123,8 @@ class BASE_EXPORT TaskRunner
// and the reply will cancel itself safely because it is bound to a
// WeakPtr<>.
bool PostTaskAndReply(const tracked_objects::Location& from_here,
- const Closure& task,
- const Closure& reply);
+ OnceClosure task,
+ OnceClosure reply);
protected:
friend struct TaskRunnerTraits;
« no previous file with comments | « base/sequenced_task_runner.cc ('k') | base/task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698