This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Implemented threadsafe platform channel replies on windows #36909
Merged
auto-submit
merged 13 commits into
flutter:main
from
gaaclarke:windows-thread-safe-platform-channel-response
Nov 9, 2022
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e64a9ae
Implemented threadsafe platform channel replies on windows
gaaclarke cf133e7
added unit test
gaaclarke e689f0a
added docstrings
gaaclarke c7a5376
implemented glfw
gaaclarke 77a85e9
added comments
gaaclarke 06d1b05
made glfw messenger unable to be copied
gaaclarke da83222
stuart feedback 1
gaaclarke cd82e4d
stuart feedback 2: replaced the shared_ptr
gaaclarke 5781f32
stuart feedback 3
gaaclarke e18fafc
stuart feedback: remove error log
gaaclarke 3f519f4
Moved FlutterDesktopMessenger to its own file.
gaaclarke 81da72e
updated licenses
gaaclarke 1794f65
stuart feedback
gaaclarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
#include "flutter/shell/platform/common/client_wrapper/testing/stub_flutter_api.h" | ||
|
||
#include <cassert> | ||
|
||
static flutter::testing::StubFlutterApi* s_stub_implementation; | ||
|
||
namespace flutter { | ||
|
@@ -93,6 +95,31 @@ void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger, | |
} | ||
} | ||
|
||
FlutterDesktopMessengerRef FlutterDesktopMessengerAddRef( | ||
FlutterDesktopMessengerRef messenger) { | ||
assert(false); // not implemented | ||
return nullptr; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No existing tests for the client_wrapper actually hit this code. In terms of code coverage it isn't strictly needed since I have coverage in the windows unit tests. |
||
} | ||
|
||
void FlutterDesktopMessengerRelease(FlutterDesktopMessengerRef messenger) { | ||
assert(false); // not implemented | ||
} | ||
|
||
bool FlutterDesktopMessengerIsAvailable(FlutterDesktopMessengerRef messenger) { | ||
assert(false); // not implemented | ||
return false; | ||
} | ||
|
||
FlutterDesktopMessengerRef FlutterDesktopMessengerLock( | ||
FlutterDesktopMessengerRef messenger) { | ||
assert(false); // not implemented | ||
return nullptr; | ||
} | ||
|
||
void FlutterDesktopMessengerUnlock(FlutterDesktopMessengerRef messenger) { | ||
assert(false); // not implemented | ||
} | ||
|
||
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar( | ||
FlutterDesktopPluginRegistrarRef registrar) { | ||
return reinterpret_cast<FlutterDesktopTextureRegistrarRef>(1); | ||
|
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional nit: this block is entirely local, so could be done before acquiring the lock instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsAvailable has to happen inside the safety of the lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment was on this code:
which doesn't have any calls to IsAvailable.