Use OnceCallback on Mojo interfaces in //mojo/common
This CL flips `use_once_callback` flag on the Mojo code generator, and
fixes all compile errors after it. After this CL, Mojo interfaces in
//mojo/common starts using base::OnceCallback instead of base::Callback
on its return value handling.
The migration recipe was:
- Convert pass-by-ref callback objects to pass-by-value.
- Use std::move() to forward it to other consumer, or to invoke it
with Callback::Run().
- Handle wherever copies are required manually.
- Check if the conversion doesn't change the semantics. As the transfer
and invocation clobber the callback object, care about use-after-move.
It's considered safe to consume almost scoped-out callback.
Bug: 714018
Change-Id: I6696d57e6aa0dff7820f740903a1a9f34fa97794
Reviewed-on: https://chromium-review.googlesource.com/558895
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485584}
CrOS-Libchrome-Original-Commit: c522ea9ee795213721079d29ed2b7fff8e2f2a4e
2 files changed