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

Unified Diff: base/task_runner.h

Issue 2180953002: Support PostTaskAndReply from a sequenced task. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self-review 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/task_runner.h
diff --git a/base/task_runner.h b/base/task_runner.h
index 9593835eebbdfa51f43e1d236f387f3ee1ac7940..8845b4876773f20eebfbc858c0d4a4cf1033aa90 100644
--- a/base/task_runner.h
+++ b/base/task_runner.h
@@ -81,14 +81,15 @@ class BASE_EXPORT TaskRunner
// general to use 'true' as a default value.
virtual bool RunsTasksOnCurrentThread() const = 0;
- // Posts |task| on the current TaskRunner. On completion, |reply|
- // is posted to the thread that called PostTaskAndReply(). Both
- // |task| and |reply| are guaranteed to be deleted on the thread
- // from which PostTaskAndReply() is invoked. This allows objects
- // that must be deleted on the originating thread to be bound into
- // the |task| and |reply| Closures. In particular, it can be useful
- // to use WeakPtr<> in the |reply| Closure so that the reply
- // operation can be canceled. See the following pseudo-code:
+ // Posts |task| on the current TaskRunner. On completion, |reply| is posted
+ // to the sequence or thread that called PostTaskAndReply(). Can only be
+ // called when SequencedTaskRunnerHandle::IsSet(). Both |task| and |reply| are
+ // guaranteed to be deleted on the sequence or thread from which
+ // PostTaskAndReply() is invoked. This allows objects that must be deleted on
robliao 2016/07/27 17:50:07 Nit, remove double space.
fdoray 2016/07/28 13:40:48 Done.
+ // the originating thread or sequence to be bound into the |task| and |reply|
+ // Closures. In particular, it can be useful to use WeakPtr<> in the |reply|
+ // Closure so that the reply operation can be canceled. See the following
+ // pseudo-code:
//
// class DataBuffer : public RefCountedThreadSafe<DataBuffer> {
// public:
« no previous file with comments | « base/base.gyp ('k') | base/task_runner.cc » ('j') | base/threading/post_task_and_reply_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698