-
Notifications
You must be signed in to change notification settings - Fork 6k
WIP - [Windows] Expose channel buffers 'resize' and 'overflow' control commands #46998
WIP - [Windows] Expose channel buffers 'resize' and 'overflow' control commands #46998
Conversation
@stuartmorgan On the other platforms there were somewhat obvious place to add this:
In this WIP PR (to be completed), I choose to add them to the core BinaryMessenger implementation, I'm not sure it is the best place. |
c314784
to
5cc3e7e
Compare
5cc3e7e
to
22dd8a8
Compare
We try to keep the channel API as consistent as possible across the platforms, so I would expect these to be exposed on the same conceptual object(s) as on the other platforms. |
I agree and i tried to find such a layer but it seems that for the Windows implementation it does not exist (probably because it was not required as the underlaying C++ API can be called directly). For instance, when generating a plugin project for Windows, the channel and embedder implementations are directly exposed: #include <flutter/method_channel.h>
#include <flutter/plugin_registrar_windows.h>
#include <flutter/standard_method_codec.h>
...
void WindowsPlugin::RegisterWithRegistrar(
flutter::PluginRegistrarWindows *registrar) {
auto channel =
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
registrar->messenger(), "windows_plugin",
&flutter::StandardMethodCodec::GetInstance());
... On the other platforms, the conceptual object(s) where I exposed those helper functions were:
|
What do you mean by "directly exposed"?
How are these conceptually different from |
The way I understand the Android implementation is that it uses JNI to call the C++ implementation of the binary messenger (i have not look closely at the JNI calls so I might be wrong).
I saw Great, if I understand well, instead of implementing |
The C++ code here was written for Windows; it's not used by Android.
That matches my high-level expectation of what we would want. Without having looked closely at the details I don't know if there are other considerations that need to lead to a different outcome (as we unfortunately have with Linux). |
Closing this WIP PR and I will file a new PR based on #46998 (comment) |
…ands exposed by the control channel. (#47158) ## Description This PR adds two helper functions to invoke the 'resize' and 'overflow' commands exposed by the control channel. See: https://github.com/flutter/engine/blob/93e8901490e78c7ba7e319cce4470d9c6478c6dc/lib/ui/channel_buffers.dart#L302-L309 Implementation based on the discussion from #46998. ## Related Issue Windows implementation for flutter/flutter#132386 ## Tests Adds 4 tests.
Description
This PR is a WIP PR to add two helper functions to invoke the 'resize' and 'overflow' commands exposed by the control channel.
See:
engine/lib/ui/channel_buffers.dart
Lines 302 to 309 in 93e8901
Related Issue
Windows implementation for flutter/flutter#132386
Tests
To do