feat: Flutter engine integration#427
Open
LuckZAE wants to merge 7 commits into
Open
Conversation
| FlutterViewHost::Reply reply) override { | ||
| auto fn = std::make_shared<FlutterViewHost::Reply>(std::move(reply)); | ||
| auto fired = std::make_shared<bool>(false); | ||
| auto t = std::make_unique<wxTimer>(this); |
There was a problem hiding this comment.
handler 正常返回后主动取消对应的 timer 即可,这样写 m_timers 会无限增长
| // Middleware factory functions | ||
| std::shared_ptr<FlutterChannel::Middleware> makeLoggingMiddleware(); | ||
| std::shared_ptr<FlutterChannel::Middleware> makeThreadGuardMiddleware(); | ||
| std::shared_ptr<FlutterChannel::Middleware> makeTimeoutMiddleware(int seconds); |
There was a problem hiding this comment.
建议用 makeTimeoutMiddleware (std::chrono::seconds seconds)
| using MiddlewarePtr = std::shared_ptr<class Middleware>; | ||
|
|
||
| explicit FlutterChannel(const std::string& name); | ||
| FlutterChannel(const FlutterChannel&) = delete; |
There was a problem hiding this comment.
显式删除了拷贝构造/赋值,但没有声明移动构造/赋值,建议显式加上移动构造
…dartReady only set after m_view check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add FlutterChannel communication layer to establish structured message passing between the C++ backend and Flutter engine.
Changes
New Files
FlutterChannel.cpp/FlutterChannel.h— Core channel implementation for bidirectional C++ ↔ Flutter communicationFlutterMiddleware.cpp— Middleware layer for intercepting and processing channel messagestest_flutter.cpp— Unit tests for the FlutterChannel communication layerModified Files
CMakeLists.txt(src) — Register new Flutter source files in the build systemFlutterPanel.hpp— Wire up FlutterChannel into the Flutter panel componentCMakeLists.txt(tests) — Replace old test target with new test_flutterRemoved Files
test_flutter_platform.cpp— Superseded bytest_flutter.cpp