Skip to content
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

Migrate FlutterDartProject and FlutterPluginAppLifeCycleDelegate to ARC #52719

Merged
merged 2 commits into from May 13, 2024

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented May 10, 2024

  • Migrate FlutterDartProject and FlutterPluginAppLifeCycleDelegate from MRC to ARC.
  • Swap a few dictionary objectForKey: to subscripting.
  • Header cleanup.
  • Cleanup build DEPS.

Part of flutter/flutter#137801.

@@ -62,7 +61,7 @@ static BOOL DoesHardwareSupportWideGamut() {
// 4. Settings from the main NSBundle and default values.

NSBundle* mainBundle = FLTGetApplicationBundle();
NSBundle* engineBundle = [NSBundle bundleForClass:[FlutterViewController class]];
NSBundle* engineBundle = [NSBundle bundleForClass:[FlutterView class]];
Copy link
Member Author

@jmagman jmagman May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlutterViewController was an arbitrary choice, it just needs to be a class in Flutter.framework. Swap to FlutterView since that class was already migrated to ARC.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just use FlutterDartProject here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, that's a better idea. 🙂

@jmagman jmagman changed the title Migrate FlutterDartProject to ARC Migrate FlutterDartProject and FlutterPluginAppLifeCycleDelegate to ARC May 10, 2024
@@ -7,9 +7,10 @@
#include "flutter/fml/logging.h"
#include "flutter/fml/paths.h"
#include "flutter/lib/ui/plugins/callback_cache.h"
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused.

@jmagman jmagman marked this pull request as ready for review May 10, 2024 21:08
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

@@ -62,7 +61,7 @@ static BOOL DoesHardwareSupportWideGamut() {
// 4. Settings from the main NSBundle and default values.

NSBundle* mainBundle = FLTGetApplicationBundle();
NSBundle* engineBundle = [NSBundle bundleForClass:[FlutterViewController class]];
NSBundle* engineBundle = [NSBundle bundleForClass:[FlutterView class]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just use FlutterDartProject here?

@@ -73,9 +74,6 @@ - (void)dealloc {
for (dispatch_block_t unsubscribe in _notificationUnsubscribers) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete this code, all of dealloc, _notificationUnsubscribers itself, and optionally the addObserver:forSelector: helper that will just become a single line. This unregistration hasn't been necessary since we dropped iOS 8 support.

Copy link
Member Author

@jmagman jmagman May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to do all the unsubscribes separately, I didn't have a chance to put it out for review yet, it's waiting for this PR to merge.
jmagman@02a177c

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartmorgan
Copy link
Contributor

test-exempt: code refactor with no semantic change

@jmagman jmagman added the autosubmit Merge PR when tree becomes green via auto submit App label May 13, 2024
@auto-submit auto-submit bot merged commit aeff9b1 into flutter:main May 13, 2024
29 checks passed
@jmagman jmagman deleted the dart-project-arc branch May 13, 2024 19:16
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request May 13, 2024
…148260)

flutter/engine@1150240...aeff9b1

2024-05-13 [email protected] Migrate FlutterDartProject and FlutterPluginAppLifeCycleDelegate to ARC (flutter/engine#52719)
2024-05-13 [email protected] Roll Skia from dde1f5dba183 to 75b3286ecaac (1 revision) (flutter/engine#52763)

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] 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: desktop autosubmit Merge PR when tree becomes green via auto submit App platform-ios platform-macos
Projects
None yet
3 participants