-
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] move flutter_test_ios_mrc unittests to arc #48162
Conversation
@@ -261,7 +261,7 @@ class FlutterPlatformViewsController { | |||
const std::shared_ptr<IOSContext>& ios_context, | |||
std::unique_ptr<SurfaceFrame> frame); | |||
|
|||
void OnMethodCall(FlutterMethodCall* call, FlutterResult& result); | |||
void OnMethodCall(FlutterMethodCall* call, FlutterResult result); |
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.
FlutterResult& result in ARC doesn't work. And I don't think having a pointer to the objc block as the parameter made sense at first place? The objc block is already a pointer.
I might be wrong.
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.
Agreed, this looks like it was a mistake. Notably, the PR that introduced this pattern started its description with "Note that this is my first time writing ObjC, don't assume I know what I'm doing", and there was no discussion of this in the review, which is very strong evidence that there wasn't actually some good, well-though-out reason for this very unusual pattern that neither of us is seeing :)
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.
While you are here, do you want to fix all of the private methods below that do the same thing?
If I'm not able to land this before end of tomorrow, please feel free to adopt it :) |
@@ -74,6 +74,9 @@ source_set("flutter_framework_source") { | |||
deps = [] | |||
|
|||
sources = [ | |||
# iOS embedder is migrating to ARC. |
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.
I'm still a little nervous about sending the announcement since we haven't done any prod code migration to be sure we can truly start migrate. There could be a (small) chance that we'd have to fix some more stuff before the migration can really start.
I added this comment here so people would probably notice when they are trying to add new mrc files.
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 with nits
@@ -261,7 +261,7 @@ class FlutterPlatformViewsController { | |||
const std::shared_ptr<IOSContext>& ios_context, | |||
std::unique_ptr<SurfaceFrame> frame); | |||
|
|||
void OnMethodCall(FlutterMethodCall* call, FlutterResult& result); | |||
void OnMethodCall(FlutterMethodCall* call, FlutterResult result); |
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.
Agreed, this looks like it was a mistake. Notably, the PR that introduced this pattern started its description with "Note that this is my first time writing ObjC, don't assume I know what I'm doing", and there was no discussion of this in the review, which is very strong evidence that there wasn't actually some good, well-though-out reason for this very unusual pattern that neither of us is seeing :)
@@ -261,7 +261,7 @@ class FlutterPlatformViewsController { | |||
const std::shared_ptr<IOSContext>& ios_context, | |||
std::unique_ptr<SurfaceFrame> frame); | |||
|
|||
void OnMethodCall(FlutterMethodCall* call, FlutterResult& result); | |||
void OnMethodCall(FlutterMethodCall* call, FlutterResult result); |
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.
While you are here, do you want to fix all of the private methods below that do the same thing?
@class FlutterPlatformViewsTestMockPlatformView; | ||
static FlutterPlatformViewsTestMockPlatformView* gMockPlatformView = nil; | ||
__weak static FlutterPlatformViewsTestMockPlatformView* gMockPlatformView = nil; |
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.
Ew :(
(Not the change, just the pattern itself of using a global static to track deallocation of an individual object; no changed need in this PR.)
@@ -15,9 +15,9 @@ | |||
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" | |||
#import "flutter/shell/platform/darwin/ios/platform_view_ios.h" | |||
|
|||
FLUTTER_ASSERT_NOT_ARC | |||
FLUTTER_ASSERT_ARC |
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.
Nit: Let's put a newline after this.
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.
Should we FLUTTER_ASSERT_ARC
this file? Seems like it's probably a good idea to do in all our ARC files during the transition.
@@ -14,9 +14,8 @@ | |||
#import "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" | |||
#import "flutter/shell/platform/darwin/ios/platform_view_ios.h" | |||
|
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.
FLUTTER_ASSERT_ARC
@@ -12,9 +12,6 @@ | |||
#import "flutter/lib/ui/window/platform_message.h" | |||
#import "flutter/lib/ui/window/platform_message_response.h" | |||
#import "flutter/shell/common/thread_host.h" | |||
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h" | |||
|
|||
FLUTTER_ASSERT_NOT_ARC | |||
|
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.
FLUTTER_ASSERT_ARC? Even though nothing had to change, it could get code added in the future that assumes ARC.
…138643) flutter/engine@141a01c...e010f17 2023-11-17 [email protected] Roll Skia from 8e9e168418a0 to dd7a26ead897 (1 revision) (flutter/engine#48178) 2023-11-17 [email protected] [Ios] move flutter_test_ios_mrc unittests to arc (flutter/engine#48162) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…rScreenAndSceneIfLoaded to ARC (#51984) Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `FlutterRestorationPlugin`, `FlutterTextureRegistryRelay`, and `UIViewController+FlutterScreenAndSceneIfLoaded` from MRC to ARC. These files do not themselves import any MRC files, making them leaf nodes in the dependency graph of MRC files. Doing a few at a time to make the dependency graph manageable, and to easily revert if this causes retain cycles or other memory management issues. Part of flutter/flutter#137801.
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `FlutterEmbedderKeyResponder` from MRC to ARC. Clean up some header imports which made this seem like it depended on not-yet-migrated MRC files. Part of flutter/flutter#137801.
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate`FlutterCallbackCache` and `FlutterKeyboardManager` from MRC to ARC. These files do not themselves import any MRC files, making them leaf nodes in the dependency graph of MRC files. Doing a few at a time to make the dependency graph manageable, and to easily revert if this causes retain cycles or other memory management issues. Part of flutter/flutter#137801.
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `FlutterDartVMServicePublisher` from MRC to ARC. I validated `flutter attach` works on this engine PR, so the VM service URL is being advertised and the tool is discovering it. Part of flutter/flutter#137801.
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `vsync_waiter_ios` from MRC to ARC. Part of flutter/flutter#137801. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
…nd a few other files to ARC (#51633) Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate some files from MRC to ARC. These files do not themselves import any MRC files, only ARC-ified files like `FlutterMetalLayer.h`, making them leaf nodes in the dependency graph of MRC files. Just doing a few at a time to make the dependency graph manageable, and to easily revert if this causes retain cycles or other memory management issues. Part of flutter/flutter#137801. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `FlutterUndoManagerPlugin` from MRC to ARC. 1. Refactor so the plugin and its tests don't need to understand the details of `FlutterViewController` or `FlutterEngine` (its delegate). This decouples the plugin, and means it doesn't depend on any MRC classes. 2. Change the delegate so conforming only requires the objects the undo plugin actually needs. Part of flutter/flutter#137801.
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `ios_surface` classes from MRC to ARC. Decorate C functions that take or return Objective-C objects or structs containing Objective-C objects with [`cf_audited_transfer`](https://clang.llvm.org/docs/AutomaticReferenceCounting.html#auditing-of-c-retainable-pointer-interfaces). Part of flutter/flutter#137801.
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `PlatformMessageHandlerIos` from MRC to ARC. Clean up the `#include`s. Part of flutter/flutter#137801.
…52535) Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162. Migrate `FlutterView`, `FlutterPlatformViews`, and `FlutterOverlayView` from MRC to ARC. Part of flutter/flutter#137801.
Move all tests in flutter_test_ios_mrc to arc
Part of flutter/flutter#137801
Changes mostly involves trivial mrc to arc changes. non-trivial changes are commented inline.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.