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

Commit 398e54a

Browse files
committed
Migrate a few "leaf import" MRC iOS files to ARC
1 parent 68301f2 commit 398e54a

File tree

7 files changed

+37
-15
lines changed

7 files changed

+37
-15
lines changed

shell/platform/darwin/ios/BUILD.gn

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,31 @@ source_set("flutter_framework_source_arc") {
6464
"framework/Source/FlutterTextInputDelegate.h",
6565
"framework/Source/FlutterTextInputPlugin.h",
6666
"framework/Source/FlutterTextInputPlugin.mm",
67+
"framework/Source/connection_collection.h",
68+
"framework/Source/connection_collection.mm",
69+
"framework/Source/platform_message_response_darwin.h",
70+
"framework/Source/platform_message_response_darwin.mm",
71+
"framework/Source/profiler_metrics_ios.h",
72+
"framework/Source/profiler_metrics_ios.mm",
73+
"ios_context.h",
74+
"ios_context.mm",
75+
"ios_context_software.h",
76+
"ios_context_software.mm",
77+
"rendering_api_selection.h",
78+
"rendering_api_selection.mm",
6779
]
6880

6981
frameworks = [
7082
"UIKit.framework",
7183
"IOSurface.framework",
7284
]
85+
86+
deps += [
87+
"//flutter/common/graphics",
88+
"//flutter/lib/ui",
89+
"//flutter/shell/platform/darwin/common",
90+
"//flutter/shell/profiling:profiling",
91+
]
7392
}
7493

7594
source_set("flutter_framework_source") {
@@ -137,18 +156,8 @@ source_set("flutter_framework_source") {
137156
"framework/Source/accessibility_bridge.mm",
138157
"framework/Source/accessibility_text_entry.h",
139158
"framework/Source/accessibility_text_entry.mm",
140-
"framework/Source/connection_collection.h",
141-
"framework/Source/connection_collection.mm",
142-
"framework/Source/platform_message_response_darwin.h",
143-
"framework/Source/platform_message_response_darwin.mm",
144-
"framework/Source/profiler_metrics_ios.h",
145-
"framework/Source/profiler_metrics_ios.mm",
146159
"framework/Source/vsync_waiter_ios.h",
147160
"framework/Source/vsync_waiter_ios.mm",
148-
"ios_context.h",
149-
"ios_context.mm",
150-
"ios_context_software.h",
151-
"ios_context_software.mm",
152161
"ios_external_view_embedder.h",
153162
"ios_external_view_embedder.mm",
154163
"ios_surface.h",
@@ -159,8 +168,6 @@ source_set("flutter_framework_source") {
159168
"platform_message_handler_ios.mm",
160169
"platform_view_ios.h",
161170
"platform_view_ios.mm",
162-
"rendering_api_selection.h",
163-
"rendering_api_selection.mm",
164171
]
165172

166173
sources += _flutter_framework_headers
@@ -190,10 +197,8 @@ source_set("flutter_framework_source") {
190197
deps += [
191198
":ios_gpu_configuration",
192199
"//flutter/common",
193-
"//flutter/common/graphics",
194200
"//flutter/flow",
195201
"//flutter/fml",
196-
"//flutter/lib/ui",
197202
"//flutter/runtime",
198203
"//flutter/runtime:libdart",
199204
"//flutter/shell/common",

shell/platform/darwin/ios/framework/Source/connection_collection.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
#import "flutter/shell/platform/darwin/ios/framework/Source/connection_collection.h"
66

7+
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
8+
9+
FLUTTER_ASSERT_ARC
10+
711
namespace flutter {
812
ConnectionCollection::Connection ConnectionCollection::AquireConnection(const std::string& name) {
913
Connection nextConnection = ++counter_;

shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
#import "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h"
66

7+
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
8+
9+
FLUTTER_ASSERT_ARC
10+
711
namespace flutter {
812

913
PlatformMessageResponseDarwin::PlatformMessageResponseDarwin(

shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
#import <Foundation/Foundation.h>
88

9+
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
910
#import "flutter/shell/platform/darwin/ios/framework/Source/IOKit.h"
1011

12+
FLUTTER_ASSERT_ARC
13+
1114
namespace {
1215

1316
// RAII holder for `thread_array_t` this is so any early returns in

shell/platform/darwin/ios/ios_context.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "flutter/shell/platform/darwin/ios/ios_context_metal_skia.h"
1414
#endif // SHELL_ENABLE_METAL
1515

16+
FLUTTER_ASSERT_ARC
17+
1618
namespace flutter {
1719

1820
IOSContext::IOSContext(MsaaSampleCount msaa_samples) : msaa_samples_(msaa_samples) {}

shell/platform/darwin/ios/ios_context_software.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#import "flutter/shell/platform/darwin/ios/ios_context_software.h"
66
#include "ios_context.h"
77

8+
FLUTTER_ASSERT_ARC
9+
810
namespace flutter {
911

1012
IOSContextSoftware::IOSContextSoftware() : IOSContext(MsaaSampleCount::kNone) {}

shell/platform/darwin/ios/rendering_api_selection.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414

1515
#include "flutter/fml/logging.h"
1616

17+
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
1718
#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.h"
1819

20+
FLUTTER_ASSERT_ARC
21+
1922
namespace flutter {
2023

2124
#if SHELL_ENABLE_METAL
@@ -24,7 +27,6 @@ bool ShouldUseMetalRenderer() {
2427
if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
2528
auto device = MTLCreateSystemDefaultDevice();
2629
ios_version_supports_metal = [device supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily1_v3];
27-
[device release];
2830
}
2931
return ios_version_supports_metal;
3032
}

0 commit comments

Comments
 (0)