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

Commit 974274d

Browse files
authored
[macOS] Mark move-only classes as such (#39734)
Applies the FML_DISALLOW_COPY_AND_ASSIGN to non-POD types in the macOS embedder. Specifically the following three accessibility-related classes: * FlutterPlatformNodeDelegateMac * FlutterTextPlatformNode * AccessibilityBridgeMac No new tests since no semantic change. Only has the compile-time effect of preventing copying of classes intended to be move-only.
1 parent 2fdce9a commit 974274d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

shell/platform/darwin/macos/framework/Source/AccessibilityBridgeMac.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#import <Cocoa/Cocoa.h>
99

10+
#include "flutter/fml/macros.h"
1011
#include "flutter/shell/platform/common/accessibility_bridge.h"
1112

1213
@class FlutterEngine;
@@ -94,6 +95,8 @@ class AccessibilityBridgeMac : public AccessibilityBridge {
9495

9596
__weak FlutterEngine* flutter_engine_;
9697
__weak FlutterViewController* view_controller_;
98+
99+
FML_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridgeMac);
97100
};
98101

99102
} // namespace flutter

shell/platform/darwin/macos/framework/Source/FlutterPlatformNodeDelegateMac.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h"
1111

12+
#include "flutter/fml/macros.h"
1213
#include "flutter/shell/platform/common/accessibility_bridge.h"
1314
#include "flutter/shell/platform/common/flutter_platform_node_delegate.h"
1415
#include "flutter/shell/platform/embedder/embedder.h"
@@ -56,6 +57,8 @@ class FlutterPlatformNodeDelegateMac : public FlutterPlatformNodeDelegate {
5657
const gfx::RectF& local_bounds) const;
5758
gfx::RectF ConvertBoundsFromScreenToGlobal(
5859
const gfx::RectF& window_bounds) const;
60+
61+
FML_DISALLOW_COPY_AND_ASSIGN(FlutterPlatformNodeDelegateMac);
5962
};
6063

6164
} // namespace flutter

shell/platform/darwin/macos/framework/Source/FlutterTextInputSemanticsObject.h

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

77
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterPlatformNodeDelegateMac.h"
88

9+
#include "flutter/fml/macros.h"
910
#include "flutter/third_party/accessibility/ax/platform/ax_platform_node_base.h"
1011

1112
@class FlutterTextField;
@@ -56,6 +57,8 @@ class FlutterTextPlatformNode : public ui::AXPlatformNodeBase {
5657
/// @brief Detaches the FlutterTextField from the FlutterView if it is not
5758
/// already detached.
5859
void EnsureDetachedFromView();
60+
61+
FML_DISALLOW_COPY_AND_ASSIGN(FlutterTextPlatformNode);
5962
};
6063

6164
} // namespace flutter

0 commit comments

Comments
 (0)