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

Conversation

@cbracken
Copy link
Member

@cbracken cbracken commented Oct 1, 2024

Migrates from manual reference counting to automatic reference counting. Migrates ivars to property syntax. Makes a minor update to a doc comment.

No semantic changes, therefore not changes to tests.

Issue: flutter/flutter#137801

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@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, 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.

@matanlurey
Copy link
Contributor

test-exempt: Semantically identical.

Migrates from manual reference counting to automatic reference counting.

Issue: flutter/flutter#137801
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 1, 2024
@auto-submit auto-submit bot merged commit 837f340 into flutter:main Oct 1, 2024
@cbracken cbracken deleted the arc-platform-plugin branch October 1, 2024 23:25
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 2, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 2, 2024
* info.plist makes this value to be false.
*/
@property(nonatomic, assign) BOOL enableViewControllerBasedStatusBarAppearance;
@property(nonatomic, weak) FlutterEngine* engine;
Copy link
Member

Choose a reason for hiding this comment

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

Can we also fix up -initWithEngine to take a normal FlutterEngine instead of a fml::WeakNSObject?

_platformPlugin.reset([[FlutterPlatformPlugin alloc] initWithEngine:[self getWeakNSObject]]);

  _platformPlugin.reset([[FlutterPlatformPlugin alloc] initWithEngine:self]);

Copy link
Member Author

@cbracken cbracken Oct 2, 2024

Choose a reason for hiding this comment

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

Yes -- I should have tagged that with the same TODO as the other two. Once all translation units importing the header are ARC-ified, I'll remove it. This patch just removed the use of it internal to the translation unit itself.

Copy link
Member

Choose a reason for hiding this comment

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

(how is this even working? It's assigning a FlutterEngine to a fml::WeakNSObject<FlutterEngine>)

- (instancetype)initWithEngine:(fml::WeakNSObject<FlutterEngine>)engine {
FML_DCHECK(engine) << "engine must be set";
self = [super init];
if (self) {
_engine = engine;

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Get outta town. I can't wait for this to be over.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@cbracken cbracken Oct 2, 2024

Choose a reason for hiding this comment

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

Oh sorry yeah didn't look at the class before I looked it up! You got the right class, but it's this line from the superclass since we're converting from a WeakNSObject<T> to a T:
https://chromium.googlesource.com/chromium/src.git/+/refs/tags/94.0.4606.43/base/ios/weak_nsobject.h#135

Copy link
Member Author

Choose a reason for hiding this comment

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

TL;DR this is all horrible and getting rid of it is all a huge win.

fluttermirroringbot pushed a commit to flutter/flutter that referenced this pull request Dec 18, 2024
Migrates from manual reference counting to automatic reference counting. Migrates ivars to property syntax. Makes a minor update to a doc comment.

No semantic changes, therefore not changes to tests.

Issue: #137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants