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

Commit 5f2e3b2

Browse files
committed
[macOS] Migrate from assert to FML_DCHECK
Eliminates raw C asserts in the macOS embedder, replacing them with FML_DCHECK for consistency with the rest of the codebase. No semantic change so no changes to tests.
1 parent 42689ea commit 5f2e3b2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.mm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
// found in the LICENSE file.
44

55
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h"
6-
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurface.h"
76

87
#import <Metal/Metal.h>
8+
99
#include <algorithm>
1010

11+
#include "flutter/fml/logging.h"
12+
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurface.h"
13+
1114
@implementation FlutterSurfacePresentInfo
1215
@end
1316

@@ -75,7 +78,7 @@ - (FlutterSurface*)surfaceForSize:(CGSize)size {
7578
}
7679

7780
- (void)commit:(NSArray<FlutterSurfacePresentInfo*>*)surfaces {
78-
assert([NSThread isMainThread]);
81+
FML_DCHECK([NSThread isMainThread]);
7982

8083
// Release all unused back buffer surfaces and replace them with front surfaces.
8184
[_backBufferCache replaceSurfaces:_frontSurfaces];

shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.h"
2-
#import "fml/synchronization/waitable_event.h"
32

43
#import <QuartzCore/QuartzCore.h>
54

65
#include <mutex>
76
#include <vector>
87

8+
#import "flutter/fml/logging.h"
9+
#import "flutter/fml/synchronization/waitable_event.h"
10+
911
@interface FlutterThreadSynchronizer () {
1012
std::mutex _mutex;
1113
BOOL _shuttingDown;
@@ -23,7 +25,7 @@ @interface FlutterThreadSynchronizer () {
2325
@implementation FlutterThreadSynchronizer
2426

2527
- (void)drain {
26-
assert([NSThread isMainThread]);
28+
FML_DCHECK([NSThread isMainThread]);
2729

2830
[CATransaction begin];
2931
[CATransaction setDisableActions:YES];

0 commit comments

Comments
 (0)