Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

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.


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 force-pushed the dart-project-arc branch from 3f2a514 to 766e00d Compare May 10, 2024 21:07
@jmagman jmagman changed the title Migrate FlutterDartProject to ARC Migrate FlutterDartProject and FlutterPluginAppLifeCycleDelegate to ARC May 10, 2024
#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
@jmagman jmagman force-pushed the dart-project-arc branch from 766e00d to 8ad2894 Compare May 10, 2024 21:15
@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.


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?

@jmagman jmagman force-pushed the dart-project-arc branch from bf4f0d5 to c9d07ce Compare May 11, 2024 01:06
}

- (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-g
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
@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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects: desktop autosubmit Merge PR when tree becomes green via auto submit App platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants