From 4d25d394c91b82002bde7e4926d6d1828fe5fa1f Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 21 Feb 2023 22:39:25 -0800 Subject: [PATCH] [common] Use FML macro to prevent copy/assignment Rather than explicitly delete the copy constructor and operator=, use the standard FML_DISALLOW_COPY_AND_ASSIGN macro used elsewhere across the codebase. Also ensure that files using this macro #include the correct FML header directly, rather than relying on a transitive include. No test changes/additions since this patch introduces no semantic changes. --- shell/platform/common/alert_platform_node_delegate.h | 7 +++---- shell/platform/darwin/common/buffer_conversions.mm | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/platform/common/alert_platform_node_delegate.h b/shell/platform/common/alert_platform_node_delegate.h index 1cce78484b324..135b1d13f7ed1 100644 --- a/shell/platform/common/alert_platform_node_delegate.h +++ b/shell/platform/common/alert_platform_node_delegate.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_SHELL_PLATFORM_COMMON_ALERT_PLATFORM_NODE_DELEGATE_H_ #define FLUTTER_SHELL_PLATFORM_COMMON_ALERT_PLATFORM_NODE_DELEGATE_H_ +#include "flutter/fml/macros.h" #include "flutter/third_party/accessibility/ax/ax_node_data.h" #include "flutter/third_party/accessibility/ax/platform/ax_platform_node_delegate_base.h" @@ -20,10 +21,6 @@ class AlertPlatformNodeDelegate : public ui::AXPlatformNodeDelegateBase { ui::AXPlatformNodeDelegate& parent_delegate); ~AlertPlatformNodeDelegate(); - AlertPlatformNodeDelegate(const AlertPlatformNodeDelegate& other) = delete; - AlertPlatformNodeDelegate operator=(const AlertPlatformNodeDelegate& other) = - delete; - // Set the alert text of the node for which this is the delegate. void SetText(const std::u16string& text); @@ -44,6 +41,8 @@ class AlertPlatformNodeDelegate : public ui::AXPlatformNodeDelegateBase { // A unique ID used to identify this node. Returned by GetUniqueId. ui::AXUniqueId id_; + + FML_DISALLOW_COPY_AND_ASSIGN(AlertPlatformNodeDelegate); }; } // namespace flutter diff --git a/shell/platform/darwin/common/buffer_conversions.mm b/shell/platform/darwin/common/buffer_conversions.mm index 6ba9b1e4a53ab..1aa07df2653a8 100644 --- a/shell/platform/darwin/common/buffer_conversions.mm +++ b/shell/platform/darwin/common/buffer_conversions.mm @@ -4,6 +4,7 @@ #import "flutter/shell/platform/darwin/common/buffer_conversions.h" +#include "flutter/fml/macros.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" namespace flutter {