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

Unified Diff: base/task_scheduler/post_task.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/task_runner_util.h ('k') | base/task_scheduler/post_task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/post_task.h
diff --git a/base/task_scheduler/post_task.h b/base/task_scheduler/post_task.h
index a7a2114efb7b30f07e8ed3d2ede92de169327514..dd97fceeaa40dd9d849000f8378133deca7aa18c 100644
--- a/base/task_scheduler/post_task.h
+++ b/base/task_scheduler/post_task.h
@@ -59,7 +59,7 @@ namespace base {
// Posts |task| to the TaskScheduler. Calling this is equivalent to calling
// PostTaskWithTraits with plain TaskTraits.
BASE_EXPORT void PostTask(const tracked_objects::Location& from_here,
- const Closure& task);
+ OnceClosure task);
// Posts |task| to the TaskScheduler and posts |reply| on the caller's execution
// context (i.e. same sequence or thread and same TaskTraits if applicable) when
@@ -67,13 +67,13 @@ BASE_EXPORT void PostTask(const tracked_objects::Location& from_here,
// PostTaskWithTraitsAndReply with plain TaskTraits. Can only be called when
// SequencedTaskRunnerHandle::IsSet().
BASE_EXPORT void PostTaskAndReply(const tracked_objects::Location& from_here,
- const Closure& task,
- const Closure& reply);
+ OnceClosure task,
+ OnceClosure reply);
// Posts |task| with specific |traits| to the TaskScheduler.
BASE_EXPORT void PostTaskWithTraits(const tracked_objects::Location& from_here,
TaskTraits traits,
- const Closure& task);
+ OnceClosure task);
// Posts |task| with specific |traits| to the TaskScheduler and posts |reply| on
// the caller's execution context (i.e. same sequence or thread and same
@@ -82,8 +82,8 @@ BASE_EXPORT void PostTaskWithTraits(const tracked_objects::Location& from_here,
BASE_EXPORT void PostTaskWithTraitsAndReply(
const tracked_objects::Location& from_here,
TaskTraits traits,
- const Closure& task,
- const Closure& reply);
+ OnceClosure task,
+ OnceClosure reply);
// Returns a TaskRunner whose PostTask invocations will result in scheduling
// tasks using |traits| which will be executed according to |execution_mode|.
« no previous file with comments | « base/task_runner_util.h ('k') | base/task_scheduler/post_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698