Hi all,
WTF::Bind() still exists, though, and you actually still need to keep using it. Unlike base::Bind(), WTF::Bind() does some static type checking on Oilpan types, and it also adds code that checks threading usage on debug builds. Currently, there's no plan to deprecate WTF::Bind().
Also, a new variant of WTF::Bind() has been introduced: WTF::BindRepeating(). This creates base::RepeatingCallback, which is for callbacks that may be called multiple times.
For cross-thread callbacks, nothing has changed: use blink::CrossThreadBind() (defined in platform/CrossThreadFunctional.h). It returns WTF::CrossThreadFunction, and this will not change soon.
To sum up:
- To create a cross-thread callback: use blink::CrossThreadBind(), which returns WTF::CrossThreadFunction.
- To create a single-threaded callback that's called only once: use WTF::Bind(), which returns base::OnceCallback.
- To create a single-threaded callback that may be called many times: use WTF::BindRepeating(), which returns base::RepeatingCallback.
Thanks,
Yuta