Skip to content

Commit

Permalink
[common] Use FML macro to prevent copy/assignment (flutter#39786)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cbracken authored Feb 22, 2023
1 parent 50af613 commit eb5e562
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions shell/platform/common/alert_platform_node_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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);

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions shell/platform/darwin/common/buffer_conversions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit eb5e562

Please sign in to comment.