-
Notifications
You must be signed in to change notification settings - Fork 6k
[ios] making objective-C smart pointers support ARC #47612
Conversation
Hmm I'm not sure why ci is not happy with excluding ../../../flutter/fml/platform/darwin/scoped_nsobject_unittests_arc.mm from license |
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!
fml::scoped_nsobject<FlutterOverlayView> overlay_view; | ||
fml::scoped_nsobject<FlutterOverlayView> overlay_view_wrapper; | ||
fml::scoped_nsobject<UIView> overlay_view; | ||
fml::scoped_nsobject<UIView> overlay_view_wrapper; |
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.
Why did these change?
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.
The newer version added explicit
to the move constructors. Since the impact is low (only PlatformViews.mm need to be updated). I think we should adopt the explicit
from chromium
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.
👍🏻
fake init to supress warning
I went through the history of scoped_nsobject and scoped_block and found that there were some custom updates we made to our own version that we probably want to keep. I will update the PR with those changes and request another review |
@Hixie Do you know what I should do to fix this? |
fml/platform/darwin/scoped_typeref.h
Outdated
// ScopedTypeRef<>::release() is like std::unique_ptr<>::release. It is NOT | ||
// a wrapper for Release(). To force a ScopedTypeRef<> object to call | ||
// Release(), use ScopedTypeRef<>::reset(). | ||
T release() __attribute((ns_returns_not_retained)) WARN_UNUSED_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.
If want to use [[nodiscard]]
instead of the macro, presumably we should remove the part of this PR that adds the macro to our codebase and replace any other usage as well?
I believe the problem here is that the script doesn't recognize this as a file that's not part of the build; see https://github.com/flutter/engine/blob/main/tools/licenses/lib/paths.dart (and in particular the regexes at the end of that file). Can you rename this |
@stuartmorgan Fixed per your last reviews |
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
…138034) flutter/engine@1b20752...f8961d2 2023-11-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] Add support for specialization constants redux." (flutter/engine#47762) 2023-11-07 [email protected] [Impeller] added tests for matrices (flutter/engine#47754) 2023-11-07 [email protected] Roll Skia from 62fc1374cc5d to 030e21befbc9 (2 revisions) (flutter/engine#47756) 2023-11-07 [email protected] [ios] making objective-C smart pointers support ARC (flutter/engine#47612) 2023-11-07 [email protected] Don't use Skia BUILD.gn files (flutter/engine#47677) 2023-11-07 [email protected] [Impeller] Add support for specialization constants redux. (flutter/engine#47678) 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.
Moving the implementation from https://codereview.chromium.org/1855483004 into the code base, including:
The implementation of the smart pointers are almost identical to https://codereview.chromium.org/1855483004 besides some syntax preference differences between chromium and flutter.
This PR also migrated VsyncWaiterIosTest.mm to ARC with scoped_nsobject
fixes flutter/flutter#137802
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.