[macOS] Mark move-only classes as such (flutter/engine#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.
This commit is contained in:
Chris Bracken 2023-02-17 17:18:35 -08:00 committed by GitHub
parent f62f92f339
commit 1d4e36274f
3 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "flutter/fml/macros.h"
#include "flutter/shell/platform/common/accessibility_bridge.h"
@class FlutterEngine;
@ -94,6 +95,8 @@ class AccessibilityBridgeMac : public AccessibilityBridge {
__weak FlutterEngine* flutter_engine_;
__weak FlutterViewController* view_controller_;
FML_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridgeMac);
};
} // namespace flutter

View File

@ -9,6 +9,7 @@
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/platform/common/accessibility_bridge.h"
#include "flutter/shell/platform/common/flutter_platform_node_delegate.h"
#include "flutter/shell/platform/embedder/embedder.h"
@ -56,6 +57,8 @@ class FlutterPlatformNodeDelegateMac : public FlutterPlatformNodeDelegate {
const gfx::RectF& local_bounds) const;
gfx::RectF ConvertBoundsFromScreenToGlobal(
const gfx::RectF& window_bounds) const;
FML_DISALLOW_COPY_AND_ASSIGN(FlutterPlatformNodeDelegateMac);
};
} // namespace flutter

View File

@ -6,6 +6,7 @@
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterPlatformNodeDelegateMac.h"
#include "flutter/fml/macros.h"
#include "flutter/third_party/accessibility/ax/platform/ax_platform_node_base.h"
@class FlutterTextField;
@ -56,6 +57,8 @@ class FlutterTextPlatformNode : public ui::AXPlatformNodeBase {
/// @brief Detaches the FlutterTextField from the FlutterView if it is not
/// already detached.
void EnsureDetachedFromView();
FML_DISALLOW_COPY_AND_ASSIGN(FlutterTextPlatformNode);
};
} // namespace flutter