-
Notifications
You must be signed in to change notification settings - Fork 6k
Migrate FlutterDartVMServicePublisher to ARC #52081
Conversation
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. |
test-exempt: code refactor with no semantic change |
shell/platform/darwin/ios/BUILD.gn
Outdated
@@ -78,6 +80,8 @@ source_set("flutter_framework_source_arc") { | |||
"UIKit.framework", | |||
"IOSurface.framework", | |||
] | |||
|
|||
deps += [ "//flutter/runtime" ] |
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.
what is this 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.
It's because of the #include "flutter/runtime/dart_service_isolate.h"
ERROR at //flutter/shell/platform/darwin/ios/framework/Source/FlutterDartVMServicePublisher.mm:45:11: Can't include this header from here.
#include "flutter/runtime/dart_service_isolate.h"
^-------------------------------------
The target:
//flutter/shell/platform/darwin/ios:flutter_framework_source_arc
is including a file from the target:
//flutter/runtime:runtime
It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.
Dependency chain (there may also be others):
//flutter/shell/platform/darwin/ios:flutter_framework_source_arc -->
//flutter/shell/platform/darwin/ios:flutter_framework_source --[private]-->
//flutter/runtime:runtime
@@ -14,7 +14,7 @@ | |||
- (instancetype)init NS_UNAVAILABLE; | |||
+ (instancetype)new NS_UNAVAILABLE; | |||
|
|||
@property(nonatomic, retain, readonly) NSURL* url; | |||
@property(nonatomic, strong, readonly) NSURL* url; |
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.
Nit: I thought from the last discussion that we were moving toward not putting strong
?
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.
You're right, I just saw a stray retain and didn't think about it. Removing.
weak.get().url = url; | ||
if (weak.get().enableVMServicePublication) { | ||
[[weak.get() delegate] publishServiceProtocolPort:url]; | ||
if (weakSelf) { |
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.
I'm surprised we aren't getting a warning here; this is violating the repeated-use-of-weak-self that Xcode usually warns on. The strongly preferred pattern is to have the first statement be a strongSelf = weakSelf
, and then have all the instances be strongSelf
, so that it's impossible to have self
become nil part way through the method.
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
…146791) flutter/engine@503e7e8...557ffb1 2024-04-15 [email protected] Migrate FlutterDartVMServicePublisher to ARC (flutter/engine#52081) 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
…lutter#146791) flutter/engine@503e7e8...557ffb1 2024-04-15 [email protected] Migrate FlutterDartVMServicePublisher to ARC (flutter/engine#52081) 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
Smart pointers support ARC as of #47612, and the unit tests were migrated in #48162.
Migrate
FlutterDartVMServicePublisher
from MRC to ARC. I validatedflutter 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.