stuartmorgan f6ff52c644 Use references for C++ MethodResult and EventSink (flutter/engine#20651)
The response APIs for method channels and event channels used pointers
for optional parameters; this kept the API surface simple, but meant
that they couldn't take rvalues. As a result, returning success values
or error details often took an extra line, declaring a variable for the
result just to have something to pass the address of.

This converts them to using references, with function overloading to
allow for optional parameters, so that values can be inlined.

For now the pointer versions are still present, so that conversion can
be done before it becomes a breaking change; they will be removed soon.

Part of https://github.com/flutter/flutter/issues/63975
2020-08-20 15:10:28 -07:00
..