PSA: fidl::Client and Unbound(...) are deprecated

36 views
Skip to first unread message

Yifei Teng

unread,
Jul 20, 2021, 9:22:47 PM7/20/21
to anno...@fuchsia.dev, fidl-dev

- If you don't use the low-level C++ FIDL bindings you may skip this message - 


TLDR: We're introducing better client binding APIs. Both the fidl::Client type and the void Unbound(fidl::UnbindInfo) virtual method of the event handler are deprecated; new code should not use them.


fidl::Client is prone to use-after-free. There are two replacements depending on the architecture of your application: fidl::WireClient and fidl::WireSharedClient. Besides the header documentation, check out the LLCPP threading guide for more examples on picking the appropriate client type.


The void Unbound(fidl::UnbindInfo) virtual of the event handler is called whenever the client bindings is torn down, regardless if initiated by the user or by an error. Its replacement is void on_fidl_error(fidl::UnbindInfo), which is only called when the client bindings are torn down due to an error.


We're planning to migrate the remaining ~30 fidl::Client usage to one of the newer client types in the coming weeks, but you're more than welcome to try it out on code you own!


Feel free to shoot us an email at fidl...@fuchsia.dev if you have additional questions or comments.


Cheers,

Yifei


Reply all
Reply to author
Forward
0 new messages