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

[macOS, iOS] Migrate from assert to FML_DCHECK #38368

Merged
merged 1 commit into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache_Internal.h"

#include "flutter/fml/logging.h"
#include "flutter/lib/ui/plugins/callback_cache.h"

@implementation FlutterCallbackInformation
Expand Down Expand Up @@ -32,7 +33,7 @@ + (FlutterCallbackInformation*)lookupCallbackInformation:(int64_t)handle {
}

+ (void)setCachePath:(NSString*)path {
assert(path != nil);
FML_DCHECK(path != nil);
flutter::DartCallbackCache::SetCachePath([path UTF8String]);
NSString* cache_path =
[NSString stringWithUTF8String:flutter::DartCallbackCache::GetCachePath().c_str()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// found in the LICENSE file.

#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterFakeKeyEvents.h"

#include "flutter/fml/logging.h"
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/KeyCodeMap_Internal.h"

Expand Down Expand Up @@ -108,8 +110,8 @@ - (NSString*)charactersIgnoringModifiers API_AVAILABLE(ios(13.4)) {
const char* characters,
const char* charactersIgnoringModifiers)
API_AVAILABLE(ios(13.4)) {
assert(!(modifierFlags & kModifierFlagSidedMask) &&
"iOS doesn't supply modifier side flags, so don't create events with them.");
FML_DCHECK(!(modifierFlags & kModifierFlagSidedMask))
<< "iOS doesn't supply modifier side flags, so don't create events with them.";
UIKey* key =
[[FakeUIKey alloc] initWithData:keyCode
modifierFlags:modifierFlags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <utility>

#import "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h"

#include <utility>

#include "flutter/fml/logging.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Internal.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h"
Expand Down Expand Up @@ -243,7 +244,7 @@ static void ReplaceSemanticsObject(SemanticsObject* oldObject,
SemanticsObject* newObject,
NSMutableDictionary<NSNumber*, SemanticsObject*>* objects) {
// `newObject` should represent the same id as `oldObject`.
assert(oldObject.node.id == newObject.uid);
FML_DCHECK(oldObject.node.id == newObject.uid);
NSNumber* nodeId = @(oldObject.node.id);
NSUInteger positionInChildlist = [oldObject.parent.children indexOfObject:oldObject];
[[oldObject retain] autorelease];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
// found in the LICENSE file.

#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurface.h"

#import <Metal/Metal.h>

#include <algorithm>

#include "flutter/fml/logging.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurface.h"

@implementation FlutterSurfacePresentInfo
@end

Expand Down Expand Up @@ -75,7 +78,7 @@ - (FlutterSurface*)surfaceForSize:(CGSize)size {
}

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

// Release all unused back buffer surfaces and replace them with front surfaces.
[_backBufferCache replaceSurfaces:_frontSurfaces];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.h"
#import "fml/synchronization/waitable_event.h"

#import <QuartzCore/QuartzCore.h>

#include <mutex>
#include <vector>

#import "flutter/fml/logging.h"
#import "flutter/fml/synchronization/waitable_event.h"

@interface FlutterThreadSynchronizer () {
std::mutex _mutex;
BOOL _shuttingDown;
Expand All @@ -23,7 +25,7 @@ @interface FlutterThreadSynchronizer () {
@implementation FlutterThreadSynchronizer

- (void)drain {
assert([NSThread isMainThread]);
FML_DCHECK([NSThread isMainThread]);

[CATransaction begin];
[CATransaction setDisableActions:YES];
Expand Down