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

Unified Diff: base/threading/post_task_and_reply_impl.h

Issue 2180953002: Support PostTaskAndReply from a sequenced task. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build error Created 4 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
Index: base/threading/post_task_and_reply_impl.h
diff --git a/base/threading/post_task_and_reply_impl.h b/base/threading/post_task_and_reply_impl.h
index d21ab78de85501e4cd7dd8cf66d0e02e8176dc5f..d0582274b81e4b77b9083caa2d4670502fa8de37 100644
--- a/base/threading/post_task_and_reply_impl.h
+++ b/base/threading/post_task_and_reply_impl.h
@@ -8,27 +8,26 @@
#ifndef BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
#define BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
+#include "base/base_export.h"
#include "base/callback_forward.h"
#include "base/location.h"
namespace base {
namespace internal {
-// Inherit from this in a class that implements PostTask appropriately
-// for sending to a destination thread.
+// Inherit from this in a class that implements PostTask to send a task to a
+// custom execution context.
//
-// Note that 'reply' will always get posted back to your current
-// MessageLoop.
-//
-// If you're looking for a concrete implementation of
-// PostTaskAndReply, you probably want base::SingleThreadTaskRunner, or you
-// may want base::WorkerPool.
-class PostTaskAndReplyImpl {
+// If you're looking for a concrete implementation of PostTaskAndReply, you
+// probably want base::TaskRunner, or you may want base::WorkerPool.
+class BASE_EXPORT PostTaskAndReplyImpl {
public:
virtual ~PostTaskAndReplyImpl() = default;
- // Implementation for TaskRunner::PostTaskAndReply and
- // WorkerPool::PostTaskAndReply.
+ // Posts |task| by calling PostTask(). On completion, |reply| is posted to the
+ // sequence or thread that called this. Can only be called when
+ // SequencedTaskRunnerHandle::IsSet(). Both |task| and |reply| are guaranteed
+ // to be deleted on the sequence or thread that called this.
bool PostTaskAndReply(const tracked_objects::Location& from_here,
const Closure& task,
const Closure& reply);

Powered by Google App Engine
This is Rietveld 408576698