-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS: Eliminate ScopedBlock, ScopedTypeRef, ScopedPolicy #56410
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
@@ -30,7 +29,7 @@ class PlatformMessageResponseDarwin : public flutter::PlatformMessageResponse { | |||
|
|||
~PlatformMessageResponseDarwin() override; | |||
|
|||
fml::ScopedBlock<PlatformMessageResponseCallback> callback_; | |||
PlatformMessageResponseCallback callback_; |
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.
For reference, the typedef is here:
engine/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h
Line 17 in eec1ba4
typedef void (^PlatformMessageResponseCallback)(NSData*); |
@@ -33,7 +32,7 @@ class PlatformMessageHandlerIos : public PlatformMessageHandler { | |||
|
|||
struct HandlerInfo { | |||
NSObject<FlutterTaskQueueDispatch>* task_queue; | |||
fml::ScopedBlock<FlutterBinaryMessageHandler> handler; | |||
FlutterBinaryMessageHandler handler; |
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.
Typedef is here:
typedef void (^FlutterBinaryMessageHandler)(NSData* _Nullable message, FlutterBinaryReply reply); |
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.
LGTM
test-exempt: code refactor with no semantic change |
auto label is removed for flutter/engine/56410, due to - The status or check suite Linux local_engine_builds has failed. Please fix the issues identified (or deflake) before re-applying this label. |
e016862
to
6de97ef
Compare
auto label is removed for flutter/engine/56410, due to - The status or check suite Mac mac_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
Eliminates the two remaining uses of ScopedBlock and with it, ScopedTypeRef which were only used by ScopedBlock. ARC automatically generates the necessary block copy/retain/release calls, including moving blocks to the heap during a retain so manual _Block_copy/_Block_release calls are no longer required. Though now unused, ScopedPolicy remains since I intend to use it in the CFRef constructor and Reset methods. Issue: flutter/flutter#137801
6de97ef
to
bd93f4d
Compare
Eliminates the two remaining uses of ScopedBlock and with it, ScopedTypeRef which was only used by ScopedBlock. ARC automatically generates the necessary block copy/retain/release calls, including moving blocks to the heap during a retain so manual _Block_copy/_Block_release calls are no longer required.
No test changes since no semantic changes.
Issue: flutter/flutter#137801
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.