Skip to content
Snippets Groups Projects
Commit ef1f83bd authored by Yifei Teng's avatar Yifei Teng Committed by CQ bot account: commit-bot@chromium.org
Browse files

[fidl] [llcpp] Generate C-binding-like free helper functions for client calls.

Many existing uses of the C-binding client calls are one-off, and do not
assume channel ownership. E.g.

    zx_status_t do_this(zx_handle_t chan, int32_t arg) {
        return fuchsia_do_this(chan, arg, more_args);
    }

This is tricky to refactor into llcpp, because SyncClient owns the
channel. Setting up a SyncClient for every one-off call is also
un-ergonomic.

To faciliate those migrations,
this patch generates additional helper functions, nested under

    fuchsia::lib::Protocol::Call

e.g.

    fuchsia::lib::Protocol::Call::MyMethod(zx::unowned_channel client_end);

and modifies SyncClient to call these instead.

TEST: fidl-llcpp-interop-tests

Change-Id: I595504310433818985bc3876ec682b800c02956a
parent 2ef7804f
No related branches found
No related tags found
No related merge requests found
Showing
with 952 additions and 119 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment