Skip to content

Commit

Permalink
iOS: Migrate FlutterHeadlessDartRunner to ARC (#55502)
Browse files Browse the repository at this point in the history
This is a subclass of FlutterEngine, which is still manually reference counted, but that's not problematic since the headers have been migrated to ARC-safe syntax that preserves existing behaviour.

No test changes since this patch makes no semantic changes.

Issue: flutter/flutter#137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
  • Loading branch information
cbracken authored Sep 30, 2024
1 parent f4507e7 commit b466a0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ source_set("flutter_framework_source_arc") {
"framework/Source/FlutterDartVMServicePublisher.mm",
"framework/Source/FlutterEmbedderKeyResponder.h",
"framework/Source/FlutterEmbedderKeyResponder.mm",
"framework/Source/FlutterHeadlessDartRunner.mm",
"framework/Source/FlutterKeyPrimaryResponder.h",
"framework/Source/FlutterKeySecondaryResponder.h",
"framework/Source/FlutterKeyboardManager.h",
Expand Down Expand Up @@ -183,7 +184,6 @@ source_set("flutter_framework_source") {
"framework/Source/FlutterEngine.mm",
"framework/Source/FlutterEngineGroup.mm",
"framework/Source/FlutterEngine_Internal.h",
"framework/Source/FlutterHeadlessDartRunner.mm",
"framework/Source/FlutterPlatformPlugin.h",
"framework/Source/FlutterPlatformPlugin.mm",
"framework/Source/FlutterViewController.mm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
#import "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h"
#import "flutter/shell/platform/darwin/ios/platform_view_ios.h"

@implementation FlutterHeadlessDartRunner {
}
FLUTTER_ASSERT_ARC

@implementation FlutterHeadlessDartRunner

- (instancetype)initWithName:(NSString*)labelPrefix project:(FlutterDartProject*)projectOrNil {
return [self initWithName:labelPrefix project:projectOrNil allowHeadlessExecution:YES];
Expand Down Expand Up @@ -56,4 +57,5 @@ - (instancetype)initWithName:(NSString*)labelPrefix
- (instancetype)init {
return [self initWithName:@"io.flutter.headless" project:nil];
}

@end

0 comments on commit b466a0d

Please sign in to comment.