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

Unified Diff: docs/callback.md

Issue 2735903002: Fix OnceCallback example in docs/callback.md (Closed)
Patch Set: tzik Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/callback.md
diff --git a/docs/callback.md b/docs/callback.md
index b891a0f05fdf21178a4e4c8ff918fecc1c8995f9..13c7e4e17c8f1777580be77399cc100063a5cec4 100644
--- a/docs/callback.md
+++ b/docs/callback.md
@@ -67,8 +67,10 @@ void Baz(OnceCallback<void(int)> cb) {
// |Qux| takes the ownership of |cb| and transfers ownership to PostTask(),
// which also takes the ownership of |cb|.
+// NOTE: TaskRunner is not actually migrated to OnceClosure yet. Once TaskRunner
+// supports OnceClosure, a OnceCallback can be posted as follows:
void Qux(OnceCallback<void(int)> cb) {
- PostTask(FROM_HERE, std::move(cb));
+ PostTask(FROM_HERE, base::Bind(std::move(cb), 42)); // not yet implemented!
tzik 2017/03/14 03:25:06 Could you use BindOnce instead of Bind?
michaelpg 2017/03/14 05:02:09 yeah, that would make sense, wouldn't it... done
}
```
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698