[common] Use FML macro to prevent copy/assignment (flutter/engine#39786)
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user