From 4b00900ffecf9207406492f25eedda3c12db7cf0 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Fri, 11 Jun 2021 19:36:27 +0000 Subject: [PATCH] Remove DISALLOW_COPY_AND_ASSIGN from blink/renderer/core/page Bug: 1010217 Change-Id: Icae743ab8338141dd1d1fc89e55ea621cdf5bad1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2955302 Commit-Queue: Timothy Gu Commit-Queue: Peter Kasting Reviewed-by: Peter Kasting Cr-Commit-Position: refs/heads/master@{#891757} --- third_party/blink/renderer/core/page/chrome_client.h | 4 ++-- .../blink/renderer/core/page/context_menu_controller.h | 5 ++--- third_party/blink/renderer/core/page/drag_controller.h | 4 ++-- third_party/blink/renderer/core/page/drag_image.h | 6 +++--- third_party/blink/renderer/core/page/drag_state.h | 6 ++---- third_party/blink/renderer/core/page/focus_controller.h | 4 ++-- third_party/blink/renderer/core/page/frame_tree.h | 5 ++--- third_party/blink/renderer/core/page/page.h | 5 ++--- third_party/blink/renderer/core/page/plugin_data.h | 5 ++--- .../renderer/core/page/plugin_script_forbidden_scope.h | 7 +++---- .../blink/renderer/core/page/pointer_lock_controller.h | 5 ++--- third_party/blink/renderer/core/page/print_context.h | 4 ++-- third_party/blink/renderer/core/page/scoped_page_pauser.h | 4 ++-- 13 files changed, 28 insertions(+), 36 deletions(-) diff --git a/third_party/blink/renderer/core/page/chrome_client.h b/third_party/blink/renderer/core/page/chrome_client.h index ed7659e6a4b482..650c9bd489d02d 100644 --- a/third_party/blink/renderer/core/page/chrome_client.h +++ b/third_party/blink/renderer/core/page/chrome_client.h @@ -118,9 +118,9 @@ class TextAutosizerPageInfo; using CompositorElementId = cc::ElementId; class CORE_EXPORT ChromeClient : public GarbageCollected { - DISALLOW_COPY_AND_ASSIGN(ChromeClient); - public: + ChromeClient(const ChromeClient&) = delete; + ChromeClient& operator=(const ChromeClient&) = delete; virtual ~ChromeClient() = default; virtual WebViewImpl* GetWebView() const = 0; diff --git a/third_party/blink/renderer/core/page/context_menu_controller.h b/third_party/blink/renderer/core/page/context_menu_controller.h index b12cdd50a0b2ec..008ded230cbf72 100644 --- a/third_party/blink/renderer/core/page/context_menu_controller.h +++ b/third_party/blink/renderer/core/page/context_menu_controller.h @@ -26,7 +26,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_CONTEXT_MENU_CONTROLLER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_CONTEXT_MENU_CONTROLLER_H_ -#include "base/macros.h" #include "base/memory/scoped_refptr.h" #include "third_party/blink/public/common/input/web_menu_source_type.h" #include "third_party/blink/public/mojom/context_menu/context_menu.mojom-blink.h" @@ -49,6 +48,8 @@ class CORE_EXPORT ContextMenuController final public mojom::blink::ContextMenuClient { public: explicit ContextMenuController(Page*); + ContextMenuController(const ContextMenuController&) = delete; + ContextMenuController operator=(const ContextMenuController&) = delete; ~ContextMenuController() override; void Trace(Visitor*) const; @@ -138,8 +139,6 @@ class CORE_EXPORT ContextMenuController final Member menu_provider_; HitTestResult hit_test_result_; Member image_selection_cached_result_; - - DISALLOW_COPY_AND_ASSIGN(ContextMenuController); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/drag_controller.h b/third_party/blink/renderer/core/page/drag_controller.h index 498edf24f21266..5b3df0617870da 100644 --- a/third_party/blink/renderer/core/page/drag_controller.h +++ b/third_party/blink/renderer/core/page/drag_controller.h @@ -26,7 +26,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_DRAG_CONTROLLER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_DRAG_CONTROLLER_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/events/event_target.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" @@ -57,6 +56,8 @@ class CORE_EXPORT DragController final public ExecutionContextLifecycleObserver { public: explicit DragController(Page*); + DragController(const DragController&) = delete; + DragController& operator=(const DragController&) = delete; ui::mojom::blink::DragOperation DragEnteredOrUpdated(DragData*, LocalFrame& local_root); @@ -139,7 +140,6 @@ class CORE_EXPORT DragController final DragDestinationAction drag_destination_action_; bool did_initiate_drag_; - DISALLOW_COPY_AND_ASSIGN(DragController); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/drag_image.h b/third_party/blink/renderer/core/page/drag_image.h index 11d947d83875eb..a6b8cacf1a3b84 100644 --- a/third_party/blink/renderer/core/page/drag_image.h +++ b/third_party/blink/renderer/core/page/drag_image.h @@ -28,7 +28,6 @@ #include -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/geometry/float_size.h" #include "third_party/blink/renderer/platform/geometry/int_size.h" @@ -62,6 +61,9 @@ class CORE_EXPORT DragImage { const String& label, const FontDescription& system_font, float device_scale_factor); + + DragImage(const DragImage&) = delete; + DragImage& operator=(const DragImage&) = delete; ~DragImage(); static FloatSize ClampedImageScale(const IntSize&, @@ -80,8 +82,6 @@ class CORE_EXPORT DragImage { SkBitmap bitmap_; float resolution_scale_; InterpolationQuality interpolation_quality_; - - DISALLOW_COPY_AND_ASSIGN(DragImage); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/drag_state.h b/third_party/blink/renderer/core/page/drag_state.h index f9fc5095531d1e..4ef9d75444fae4 100644 --- a/third_party/blink/renderer/core/page/drag_state.h +++ b/third_party/blink/renderer/core/page/drag_state.h @@ -26,7 +26,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_DRAG_STATE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_DRAG_STATE_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/page/drag_actions.h" #include "third_party/blink/renderer/platform/heap/handle.h" @@ -38,6 +37,8 @@ class Node; class DragState final : public GarbageCollected { public: DragState() = default; + DragState(const DragState&) = delete; + DragState& operator=(const DragState&) = delete; // Element that may be a drag source, for the current mouse gesture. Member drag_src_; @@ -49,9 +50,6 @@ class DragState final : public GarbageCollected { visitor->Trace(drag_src_); visitor->Trace(drag_data_transfer_); } - - private: - DISALLOW_COPY_AND_ASSIGN(DragState); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/focus_controller.h b/third_party/blink/renderer/core/page/focus_controller.h index 7f1e61819b9d82..02cc44098f4e74 100644 --- a/third_party/blink/renderer/core/page/focus_controller.h +++ b/third_party/blink/renderer/core/page/focus_controller.h @@ -26,7 +26,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_FOCUS_CONTROLLER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_FOCUS_CONTROLLER_H_ -#include "base/macros.h" #include "base/memory/scoped_refptr.h" #include "third_party/blink/public/mojom/input/focus_type.mojom-blink-forward.h" #include "third_party/blink/renderer/core/core_export.h" @@ -54,6 +53,8 @@ class CORE_EXPORT FocusController final using OwnerMap = HeapHashMap, Member>; explicit FocusController(Page*); + FocusController(const FocusController&) = delete; + FocusController& operator=(const FocusController&) = delete; void SetFocusedFrame(Frame*, bool notify_embedder = true); void FocusDocumentView(Frame*, bool notify_embedder = true); @@ -129,7 +130,6 @@ class CORE_EXPORT FocusController final bool is_changing_focused_frame_; bool is_emulating_focus_; HeapHashSet> focus_changed_observers_; - DISALLOW_COPY_AND_ASSIGN(FocusController); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/frame_tree.h b/third_party/blink/renderer/core/page/frame_tree.h index a99e25ff681f4f..169d25680a1bf2 100644 --- a/third_party/blink/renderer/core/page/frame_tree.h +++ b/third_party/blink/renderer/core/page/frame_tree.h @@ -21,7 +21,6 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_FRAME_TREE_H_ #include "base/dcheck_is_on.h" -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/text/atomic_string.h" @@ -37,6 +36,8 @@ class CORE_EXPORT FrameTree final { public: explicit FrameTree(Frame* this_frame); + FrameTree(const FrameTree&) = delete; + FrameTree& operator=(const FrameTree&) = delete; ~FrameTree(); const AtomicString& GetName() const; @@ -109,8 +110,6 @@ class CORE_EXPORT FrameTree final { // TODO(shuuran): remove this once we have gathered the data bool cross_site_cross_browsing_context_group_set_nulled_name_; - - DISALLOW_COPY_AND_ASSIGN(FrameTree); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/page.h b/third_party/blink/renderer/core/page/page.h index 9a219bef355646..0a22204ae50c83 100644 --- a/third_party/blink/renderer/core/page/page.h +++ b/third_party/blink/renderer/core/page/page.h @@ -26,7 +26,6 @@ #include #include "base/dcheck_is_on.h" -#include "base/macros.h" #include "base/types/pass_key.h" #include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-blink-forward.h" #include "third_party/blink/public/mojom/frame/text_autosizer_page_info.mojom-blink.h" @@ -118,6 +117,8 @@ class CORE_EXPORT Page final : public GarbageCollected, ChromeClient& chrome_client, scheduler::WebAgentGroupScheduler& agent_group_scheduler, bool is_ordinary); + Page(const Page&) = delete; + Page& operator=(const Page&) = delete; ~Page() override; void CloseSoon(); @@ -496,8 +497,6 @@ class CORE_EXPORT Page final : public GarbageCollected, mojom::blink::TextAutosizerPageInfo web_text_autosizer_page_info_; WebScopedVirtualTimePauser history_navigation_virtual_time_pauser_; - - DISALLOW_COPY_AND_ASSIGN(Page); }; extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement; diff --git a/third_party/blink/renderer/core/page/plugin_data.h b/third_party/blink/renderer/core/page/plugin_data.h index 8dc24f5d25ace5..310319d4595bec 100644 --- a/third_party/blink/renderer/core/page/plugin_data.h +++ b/third_party/blink/renderer/core/page/plugin_data.h @@ -21,7 +21,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PLUGIN_DATA_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PLUGIN_DATA_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/graphics/color.h" #include "third_party/blink/renderer/platform/heap/handle.h" @@ -93,6 +92,8 @@ class CORE_EXPORT PluginData final : public GarbageCollected { void Trace(Visitor*) const; PluginData() = default; + PluginData(const PluginData&) = delete; + PluginData& operator=(const PluginData&) = delete; const HeapVector>& Plugins() const { return plugins_; } const HeapVector>& Mimes() const { return mimes_; } @@ -112,8 +113,6 @@ class CORE_EXPORT PluginData final : public GarbageCollected { HeapVector> plugins_; HeapVector> mimes_; scoped_refptr main_frame_origin_; - - DISALLOW_COPY_AND_ASSIGN(PluginData); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/plugin_script_forbidden_scope.h b/third_party/blink/renderer/core/page/plugin_script_forbidden_scope.h index 8ee2203cb13159..99b6cd6388fdd6 100644 --- a/third_party/blink/renderer/core/page/plugin_script_forbidden_scope.h +++ b/third_party/blink/renderer/core/page/plugin_script_forbidden_scope.h @@ -5,7 +5,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PLUGIN_SCRIPT_FORBIDDEN_SCOPE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PLUGIN_SCRIPT_FORBIDDEN_SCOPE_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -43,12 +42,12 @@ class CORE_EXPORT PluginScriptForbiddenScope final { public: PluginScriptForbiddenScope(); + PluginScriptForbiddenScope(const PluginScriptForbiddenScope&) = delete; + PluginScriptForbiddenScope& operator=(const PluginScriptForbiddenScope&) = + delete; ~PluginScriptForbiddenScope(); static bool IsForbidden(); - - private: - DISALLOW_COPY_AND_ASSIGN(PluginScriptForbiddenScope); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/pointer_lock_controller.h b/third_party/blink/renderer/core/page/pointer_lock_controller.h index 35cb3aa136896a..f2caf84dde451c 100644 --- a/third_party/blink/renderer/core/page/pointer_lock_controller.h +++ b/third_party/blink/renderer/core/page/pointer_lock_controller.h @@ -26,7 +26,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_POINTER_LOCK_CONTROLLER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_POINTER_LOCK_CONTROLLER_H_ -#include "base/macros.h" #include "base/memory/scoped_refptr.h" #include "third_party/blink/public/mojom/input/pointer_lock_context.mojom-blink.h" #include "third_party/blink/public/mojom/input/pointer_lock_result.mojom-blink-forward.h" @@ -54,6 +53,8 @@ class CORE_EXPORT PointerLockController final : public GarbageCollected { public: explicit PointerLockController(Page*); + PointerLockController(const PointerLockController&) = delete; + PointerLockController& operator=(const PointerLockController&) = delete; using ResultCallback = base::OnceCallback; @@ -124,8 +125,6 @@ class CORE_EXPORT PointerLockController final FloatPoint pointer_lock_screen_position_; bool current_unadjusted_movement_setting_ = false; - - DISALLOW_COPY_AND_ASSIGN(PointerLockController); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/print_context.h b/third_party/blink/renderer/core/page/print_context.h index dcb12b151ee40d..6922db6ea44dcf 100644 --- a/third_party/blink/renderer/core/page/print_context.h +++ b/third_party/blink/renderer/core/page/print_context.h @@ -137,14 +137,14 @@ class CORE_EXPORT ScopedPrintContext { public: explicit ScopedPrintContext(LocalFrame*); + ScopedPrintContext(const ScopedPrintContext&) = delete; + ScopedPrintContext& operator=(const ScopedPrintContext&) = delete; ~ScopedPrintContext(); PrintContext* operator->() const { return context_; } private: PrintContext* context_; - - DISALLOW_COPY_AND_ASSIGN(ScopedPrintContext); }; } // namespace blink diff --git a/third_party/blink/renderer/core/page/scoped_page_pauser.h b/third_party/blink/renderer/core/page/scoped_page_pauser.h index 5e34428fc007cd..9be24a4dd7c41c 100644 --- a/third_party/blink/renderer/core/page/scoped_page_pauser.h +++ b/third_party/blink/renderer/core/page/scoped_page_pauser.h @@ -20,7 +20,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_SCOPED_PAGE_PAUSER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_SCOPED_PAGE_PAUSER_H_ -#include "base/macros.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -34,6 +33,8 @@ class CORE_EXPORT ScopedPagePauser final { public: explicit ScopedPagePauser(); + ScopedPagePauser(const ScopedPagePauser&) = delete; + ScopedPagePauser& operator=(const ScopedPagePauser&) = delete; ~ScopedPagePauser(); private: @@ -43,7 +44,6 @@ class CORE_EXPORT ScopedPagePauser final { static bool IsActive(); std::unique_ptr pause_handle_; - DISALLOW_COPY_AND_ASSIGN(ScopedPagePauser); }; } // namespace blink