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

iOS: Eliminate fml::scoped_nsobject pointer use #56295

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

cbracken
Copy link
Member

@cbracken cbracken commented Nov 1, 2024

Eliminates use of fml::scoped_nsobject now that the codebase has been migrated to ARC.

Issue: flutter/flutter#137801

No changes to tests since this patch makes no semantic changes.

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.

@cbracken cbracken force-pushed the no-scoped-nsobject branch 2 times, most recently from 520e7d5 to 12e83bf Compare November 1, 2024 05:11
@cbracken
Copy link
Member Author

cbracken commented Nov 1, 2024

This will be followed by a separate patch that deletes scoped_nsobject, its tests, and cleans up the build file.

@cbracken cbracken requested a review from hellohuanlin November 1, 2024 05:12
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM

@stuartmorgan
Copy link
Contributor

test-exempt: code refactor with no semantic change

Eliminates use of `fml::scoped_nsobject` now that the codebase has been
migrated to ARC.

Issue: flutter/flutter#137801
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2024
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

Yay!

Comment on lines +100 to +101
NSMutableDictionary<NSNumber*, SemanticsObject*>* objects_;
FlutterBasicMessageChannel* accessibility_channel_;
Copy link
Member

Choose a reason for hiding this comment

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

I guess even if they are fully Objective-C isa objects we don't use Objective-C naming (objects and accessibilityChannel)?

Copy link
Member Author

@cbracken cbracken Nov 4, 2024

Choose a reason for hiding this comment

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

In C++ contexts (C++ class fields) the style guide says we have to use C++ naming, which really hits the code with an ugly stick :(

Ref: https://google.github.io/styleguide/objcguide.html#style-matches-the-language

Copy link
Contributor

Choose a reason for hiding this comment

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

If the naming of ivars and variables depended on the thing being pointed to rather than the context, things would be much, much uglier.

I guarantee nobody would be happier if individual lines of Obj-C++ code had mixes of different variable naming styles depending on the underlying types of the things the variables are referring to.

Copy link
Member Author

@cbracken cbracken Nov 4, 2024

Choose a reason for hiding this comment

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

Agreed, but it's still unfortunate. I'd much prefer we reduced the number of C++ classes with Obj-C++ implementations and used straight Obj-C[++] classes where possible. I realise that's not always possible -- e.g. cases where embedders have some translation unit containing subclasses of a common C++ superclass etc.

@auto-submit auto-submit bot merged commit 03a872d into flutter:main Nov 4, 2024
30 checks passed
@cbracken cbracken deleted the no-scoped-nsobject branch November 4, 2024 18:58
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 4, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 4, 2024
…158132)

flutter/engine@25c7e47...f880b56

2024-11-04 [email protected] Made it so angle builds on linux (flutter/engine#56328)
2024-11-04 [email protected] [Impeller] combine translate* scale mat mul when computing shader transform. (flutter/engine#56352)
2024-11-04 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.2.1 to 4.2.2 (flutter/engine#56191)
2024-11-04 [email protected] iOS: Eliminate fml::scoped_nsobject pointer use (flutter/engine#56295)
2024-11-04 [email protected] Roll Skia from e2ad60ea8039 to b2bb3af36da3 (1 revision) (flutter/engine#56355)

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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
Eliminates use of `fml::scoped_nsobject` now that the codebase has been migrated to ARC.

Issue: flutter#137801

No changes to tests since this patch makes no semantic changes.

[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
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.

4 participants