这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fix C++ MethodChannel reply type #17607

Merged

Conversation

stuartmorgan-g
Copy link
Contributor

Makes InvokeMethod's reply a high-level response object, rather than
binary data, matching the abstraction level of the class (and the other
languages' implementations).

In support of that:

  • Adds the logic to the codecs to decode response envelopes, which had
    never been implemented.
  • Adds a convience implementation of MethodResult that forwards to
    lambdas, so that one-off invocation handlers are easier to write.

Also simplified BinaryMessenger's API so that subclasses only need to
implement one version of Send, rather than two almost-identical versions.

Fixes flutter/flutter#53223

Makes InvokeMethod's reply a high-level response object, rather than
binary data, matching the abstraction level of the class (and the other
languages' implementations).

In support of that:
- Adds the logic to the codecs to decode response envelopes, which had
  never been implemented.
- Adds a convience implementation of MethodResult that forwards to
  lambdas, so that one-off invocation handlers are easier to write.

Fixes flutter/flutter#53223
@stuartmorgan-g stuartmorgan-g merged commit 9992a4a into flutter:master Apr 12, 2020
@stuartmorgan-g stuartmorgan-g deleted the fix-cpp-method-channel-reply-type branch April 12, 2020 02:06
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 12, 2020
goderbauer pushed a commit to goderbauer/engine that referenced this pull request Apr 16, 2020
Makes InvokeMethod's reply a high-level response object, rather than
binary data, matching the abstraction level of the class (and the other
languages' implementations).

In support of that:
- Adds the logic to the codecs to decode response envelopes, which had
  never been implemented.
- Adds a convience implementation of MethodResult that forwards to
  lambdas, so that one-off invocation handlers are easier to write.

Also simplified BinaryMessenger's API so that subclasses only need to
implement one version of Send, rather than two almost-identical versions.

Fixes flutter/flutter#53223
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MethodChannel reply is using the wrong type in the C++ wrapper
3 participants