diff --git a/libcef/browser/alloy/alloy_browser_context.cc b/libcef/browser/alloy/alloy_browser_context.cc index c31e14875..494008867 100644 --- a/libcef/browser/alloy/alloy_browser_context.cc +++ b/libcef/browser/alloy/alloy_browser_context.cc @@ -55,6 +55,9 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkWriter::Listener { public: CefVisitedLinkListener() { DCHECK(listener_map_.empty()); } + CefVisitedLinkListener(const CefVisitedLinkListener&) = delete; + CefVisitedLinkListener& operator=(const CefVisitedLinkListener&) = delete; + void CreateListenerForContext(content::BrowserContext* context) { CEF_REQUIRE_UIT(); auto listener = @@ -94,12 +97,10 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkWriter::Listener { private: // Map of AlloyBrowserContext to the associated VisitedLinkEventListener. - typedef std::map> - ListenerMap; + using ListenerMap = + std::map>; ListenerMap listener_map_; - - DISALLOW_COPY_AND_ASSIGN(CefVisitedLinkListener); }; AlloyBrowserContext::AlloyBrowserContext( diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index fb6c38d5f..d7756b258 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -39,6 +39,9 @@ class AlloyBrowserContext : public ChromeProfileAlloy, public: explicit AlloyBrowserContext(const CefRequestContextSettings& settings); + AlloyBrowserContext(const AlloyBrowserContext&) = delete; + AlloyBrowserContext& operator=(const AlloyBrowserContext&) = delete; + // CefBrowserContext overrides. content::BrowserContext* AsBrowserContext() override { return this; } Profile* AsProfile() override { return this; } @@ -142,8 +145,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy, std::unique_ptr resource_context_; scoped_refptr media_device_id_salt_; - - DISALLOW_COPY_AND_ASSIGN(AlloyBrowserContext); }; #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_ diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 2847e7c74..b5b3ecc0a 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -99,6 +99,9 @@ class CefWidgetHostInterceptor render_widget_host_->AddObserver(this); } + CefWidgetHostInterceptor(const CefWidgetHostInterceptor&) = delete; + CefWidgetHostInterceptor& operator=(const CefWidgetHostInterceptor&) = delete; + blink::mojom::WidgetHost* GetForwardingInterface() override { return impl_; } // WidgetHostInterceptorForTesting method: @@ -122,8 +125,6 @@ class CefWidgetHostInterceptor AlloyBrowserHostImpl* const browser_; content::RenderWidgetHostImpl* const render_widget_host_; blink::mojom::WidgetHost* const impl_; - - DISALLOW_COPY_AND_ASSIGN(CefWidgetHostInterceptor); }; static constexpr base::TimeDelta kRecentlyAudibleTimeout = base::Seconds(2); diff --git a/libcef/browser/alloy/alloy_browser_main.h b/libcef/browser/alloy/alloy_browser_main.h index 4e9c57ec0..057c7407b 100644 --- a/libcef/browser/alloy/alloy_browser_main.h +++ b/libcef/browser/alloy/alloy_browser_main.h @@ -9,7 +9,6 @@ #include "libcef/browser/request_context_impl.h" #include "base/command_line.h" -#include "base/macros.h" #include "base/strings/string_piece.h" #include "build/build_config.h" #include "components/prefs/pref_service.h" @@ -47,6 +46,10 @@ class CefDevToolsDelegate; class AlloyBrowserMainParts : public content::BrowserMainParts { public: explicit AlloyBrowserMainParts(const content::MainFunctionParams& parameters); + + AlloyBrowserMainParts(const AlloyBrowserMainParts&) = delete; + AlloyBrowserMainParts& operator=(const AlloyBrowserMainParts&) = delete; + ~AlloyBrowserMainParts() override; int PreEarlyInitialization() override; @@ -105,8 +108,6 @@ class AlloyBrowserMainParts : public content::BrowserMainParts { std::unique_ptr layout_provider_; #endif #endif // defined(TOOLKIT_VIEWS) - - DISALLOW_COPY_AND_ASSIGN(AlloyBrowserMainParts); }; #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_ diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 64a53173f..4509cb709 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -47,6 +47,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/json/json_reader.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/stl_util.h" #include "base/threading/thread_restrictions.h" @@ -176,6 +177,9 @@ class CefQuotaCallbackImpl : public CefCallback { explicit CefQuotaCallbackImpl(CallbackType callback) : callback_(std::move(callback)) {} + CefQuotaCallbackImpl(const CefQuotaCallbackImpl&) = delete; + CefQuotaCallbackImpl& operator=(const CefQuotaCallbackImpl&) = delete; + ~CefQuotaCallbackImpl() { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. @@ -217,17 +221,21 @@ class CefQuotaCallbackImpl : public CefCallback { CallbackType callback_; IMPLEMENT_REFCOUNTING(CefQuotaCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefQuotaCallbackImpl); }; class CefAllowCertificateErrorCallbackImpl : public CefCallback { public: - typedef base::OnceCallback - CallbackType; + using CallbackType = + base::OnceCallback; explicit CefAllowCertificateErrorCallbackImpl(CallbackType callback) : callback_(std::move(callback)) {} + CefAllowCertificateErrorCallbackImpl( + const CefAllowCertificateErrorCallbackImpl&) = delete; + CefAllowCertificateErrorCallbackImpl& operator=( + const CefAllowCertificateErrorCallbackImpl&) = delete; + ~CefAllowCertificateErrorCallbackImpl() { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. @@ -272,7 +280,6 @@ class CefAllowCertificateErrorCallbackImpl : public CefCallback { CallbackType callback_; IMPLEMENT_REFCOUNTING(CefAllowCertificateErrorCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefAllowCertificateErrorCallbackImpl); }; class CefSelectClientCertificateCallbackImpl @@ -282,6 +289,11 @@ class CefSelectClientCertificateCallbackImpl std::unique_ptr delegate) : delegate_(std::move(delegate)) {} + CefSelectClientCertificateCallbackImpl( + const CefSelectClientCertificateCallbackImpl&) = delete; + CefSelectClientCertificateCallbackImpl& operator=( + const CefSelectClientCertificateCallbackImpl&) = delete; + ~CefSelectClientCertificateCallbackImpl() { // If Select has not been called, call it with NULL to continue without any // client certificate. @@ -342,12 +354,15 @@ class CefSelectClientCertificateCallbackImpl std::unique_ptr delegate_; IMPLEMENT_REFCOUNTING(CefSelectClientCertificateCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefSelectClientCertificateCallbackImpl); }; class CefQuotaPermissionContext : public content::QuotaPermissionContext { public: - CefQuotaPermissionContext() {} + CefQuotaPermissionContext() = default; + + CefQuotaPermissionContext(const CefQuotaPermissionContext&) = delete; + CefQuotaPermissionContext& operator=(const CefQuotaPermissionContext&) = + delete; // The callback will be dispatched on the IO thread. void RequestQuotaPermission(const content::StorageQuotaParams& params, @@ -389,9 +404,7 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext { } private: - ~CefQuotaPermissionContext() override {} - - DISALLOW_COPY_AND_ASSIGN(CefQuotaPermissionContext); + ~CefQuotaPermissionContext() override = default; }; #if defined(OS_POSIX) && !defined(OS_MAC) diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 319ce3597..d007f7958 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -12,7 +12,6 @@ #include "include/cef_request_context_handler.h" #include "libcef/browser/request_context_impl.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "build/build_config.h" #include "content/public/browser/content_browser_client.h" diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.h b/libcef/browser/alloy/browser_platform_delegate_alloy.h index a5eef6b5c..f8f691bca 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.h +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.h @@ -16,6 +16,11 @@ // Implementation of Alloy-based browser functionality. class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate { public: + CefBrowserPlatformDelegateAlloy(const CefBrowserPlatformDelegateAlloy&) = + delete; + CefBrowserPlatformDelegateAlloy& operator=( + const CefBrowserPlatformDelegateAlloy&) = delete; + content::WebContents* CreateWebContents(CefBrowserCreateParams& create_params, bool& own_web_contents) override; void WebContentsCreated(content::WebContents* web_contents, @@ -108,8 +113,6 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate { bool primary_ = true; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegateAlloy); }; #endif // CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_ diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.h b/libcef/browser/alloy/chrome_browser_process_alloy.h index 5f6609d72..7d87a6986 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.h +++ b/libcef/browser/alloy/chrome_browser_process_alloy.h @@ -23,15 +23,21 @@ class ChromeProfileManagerAlloy; class BackgroundModeManager { public: BackgroundModeManager(); - virtual ~BackgroundModeManager(); - private: - DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); + BackgroundModeManager(const BackgroundModeManager&) = delete; + BackgroundModeManager& operator=(const BackgroundModeManager&) = delete; + + virtual ~BackgroundModeManager(); }; class ChromeBrowserProcessAlloy : public BrowserProcess { public: ChromeBrowserProcessAlloy(); + + ChromeBrowserProcessAlloy(const ChromeBrowserProcessAlloy&) = delete; + ChromeBrowserProcessAlloy& operator=(const ChromeBrowserProcessAlloy&) = + delete; + ~ChromeBrowserProcessAlloy() override; void Initialize(); @@ -122,8 +128,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { std::unique_ptr field_trial_list_; std::unique_ptr component_updater_; - - DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessAlloy); }; #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_ diff --git a/libcef/browser/alloy/chrome_profile_alloy.h b/libcef/browser/alloy/chrome_profile_alloy.h index 400571a38..8b21bb14a 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.h +++ b/libcef/browser/alloy/chrome_profile_alloy.h @@ -16,6 +16,10 @@ class ChromeProfileAlloy : public Profile { public: ChromeProfileAlloy(); + + ChromeProfileAlloy(const ChromeProfileAlloy&) = delete; + ChromeProfileAlloy& operator=(const ChromeProfileAlloy&) = delete; + ~ChromeProfileAlloy() override; protected: @@ -51,8 +55,6 @@ class ChromeProfileAlloy : public Profile { private: std::unique_ptr variations_client_; - - DISALLOW_COPY_AND_ASSIGN(ChromeProfileAlloy); }; #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_ diff --git a/libcef/browser/alloy/chrome_profile_manager_alloy.h b/libcef/browser/alloy/chrome_profile_manager_alloy.h index 6936b5a10..5473d2e7d 100644 --- a/libcef/browser/alloy/chrome_profile_manager_alloy.h +++ b/libcef/browser/alloy/chrome_profile_manager_alloy.h @@ -14,13 +14,15 @@ class ChromeProfileManagerAlloy : public ProfileManager { public: ChromeProfileManagerAlloy(); + + ChromeProfileManagerAlloy(const ChromeProfileManagerAlloy&) = delete; + ChromeProfileManagerAlloy& operator=(const ChromeProfileManagerAlloy&) = + delete; + ~ChromeProfileManagerAlloy() override; Profile* GetProfile(const base::FilePath& profile_dir) override; bool IsValidProfile(const void* profile) override; - - private: - DISALLOW_COPY_AND_ASSIGN(ChromeProfileManagerAlloy); }; #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_MANAGER_ALLOY_H_ diff --git a/libcef/browser/audio_loopback_stream_creator.cc b/libcef/browser/audio_loopback_stream_creator.cc index d6dd3a723..3e7a96764 100644 --- a/libcef/browser/audio_loopback_stream_creator.cc +++ b/libcef/browser/audio_loopback_stream_creator.cc @@ -35,6 +35,10 @@ class StreamCreatedCallbackAdapter final DCHECK(callback_); } + StreamCreatedCallbackAdapter(const StreamCreatedCallbackAdapter&) = delete; + StreamCreatedCallbackAdapter& operator=(const StreamCreatedCallbackAdapter&) = + delete; + ~StreamCreatedCallbackAdapter() override {} // blink::mojom::RendererAudioInputStreamFactoryClient implementation. @@ -52,8 +56,6 @@ class StreamCreatedCallbackAdapter final private: const CefAudioLoopbackStreamCreator::StreamCreatedCallback callback_; - - DISALLOW_COPY_AND_ASSIGN(StreamCreatedCallbackAdapter); }; void CreateLoopbackStreamHelper( diff --git a/libcef/browser/audio_loopback_stream_creator.h b/libcef/browser/audio_loopback_stream_creator.h index 629cc887c..ad3708c68 100644 --- a/libcef/browser/audio_loopback_stream_creator.h +++ b/libcef/browser/audio_loopback_stream_creator.h @@ -6,7 +6,6 @@ #define CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_ #include "base/callback.h" -#include "base/macros.h" #include "content/browser/media/forwarding_audio_stream_factory.h" #include "content/common/content_export.h" #include "media/mojo/mojom/audio_data_pipe.mojom.h" @@ -25,6 +24,11 @@ class AudioParameters; class CefAudioLoopbackStreamCreator final { public: CefAudioLoopbackStreamCreator(); + + CefAudioLoopbackStreamCreator(const CefAudioLoopbackStreamCreator&) = delete; + CefAudioLoopbackStreamCreator& operator=( + const CefAudioLoopbackStreamCreator&) = delete; + ~CefAudioLoopbackStreamCreator(); // The callback that is called when the requested stream is created. @@ -44,8 +48,6 @@ class CefAudioLoopbackStreamCreator final { private: content::ForwardingAudioStreamFactory factory_; - - DISALLOW_COPY_AND_ASSIGN(CefAudioLoopbackStreamCreator); }; #endif // CEF_LIBCEF_BROWSER_AUDIO_LOOPBACK_STREAM_CREATOR_H_ diff --git a/libcef/browser/browser_contents_delegate.h b/libcef/browser/browser_contents_delegate.h index 01aa157d1..4c6904d28 100644 --- a/libcef/browser/browser_contents_delegate.h +++ b/libcef/browser/browser_contents_delegate.h @@ -72,6 +72,10 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, explicit CefBrowserContentsDelegate( scoped_refptr browser_info); + CefBrowserContentsDelegate(const CefBrowserContentsDelegate&) = delete; + CefBrowserContentsDelegate& operator=(const CefBrowserContentsDelegate&) = + delete; + void ObserveWebContents(content::WebContents* new_contents); // Manage observer objects. The observer must either outlive this object or @@ -195,8 +199,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, // True if the focus is currently on an editable field on the page. bool focus_on_editable_field_ = false; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserContentsDelegate); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_CONTENTS_DELEGATE_H_ diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 1c0dfe88b..ca13d7e28 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -34,9 +34,13 @@ namespace { // Manages the global list of Impl instances. class ImplManager { public: - typedef std::vector Vector; + using Vector = std::vector; ImplManager() {} + + ImplManager(const ImplManager&) = delete; + ImplManager& operator=(const ImplManager&) = delete; + ~ImplManager() { DCHECK(all_.empty()); DCHECK(map_.empty()); @@ -122,12 +126,10 @@ class ImplManager { return all_.end(); } - typedef std::map PathMap; + using PathMap = std::map; PathMap map_; Vector all_; - - DISALLOW_COPY_AND_ASSIGN(ImplManager); }; #if DCHECK_IS_ON() diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index f2c61a769..3bae0202a 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -91,6 +91,9 @@ class Profile; // the UI thread unless otherwise indicated. class CefBrowserContext { public: + CefBrowserContext(const CefBrowserContext&) = delete; + CefBrowserContext& operator=(const CefBrowserContext&) = delete; + // Returns the existing instance, if any, associated with the specified // |cache_path|. static CefBrowserContext* FromCachePath(const base::FilePath& cache_path); @@ -226,7 +229,7 @@ class CefBrowserContext { CefRequestContextHandlerMap handler_map_; // Set of global IDs associated with this context. - typedef std::set RenderIdSet; + using RenderIdSet = std::set; RenderIdSet render_id_set_; #if DCHECK_IS_ON() @@ -235,8 +238,6 @@ class CefBrowserContext { Getter getter_; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserContext); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_ diff --git a/libcef/browser/browser_frame.h b/libcef/browser/browser_frame.h index d39e1ecc2..7a48cc224 100644 --- a/libcef/browser/browser_frame.h +++ b/libcef/browser/browser_frame.h @@ -22,6 +22,10 @@ class CefBrowserFrame public: CefBrowserFrame(content::RenderFrameHost* render_frame_host, mojo::PendingReceiver receiver); + + CefBrowserFrame(const CefBrowserFrame&) = delete; + CefBrowserFrame& operator=(const CefBrowserFrame&) = delete; + ~CefBrowserFrame() override; // Called from the ContentBrowserClient method of the same name. @@ -44,8 +48,6 @@ class CefBrowserFrame CefRefPtr GetFrameHost( bool prefer_speculative = false) const; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserFrame); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_FRAME_H_ diff --git a/libcef/browser/browser_host_base.cc b/libcef/browser/browser_host_base.cc index 20b9cd082..566347725 100644 --- a/libcef/browser/browser_host_base.cc +++ b/libcef/browser/browser_host_base.cc @@ -14,6 +14,7 @@ #include "libcef/common/net/url_util.h" #include "base/logging.h" +#include "base/macros.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_service.h" #include "components/favicon/core/favicon_url.h" diff --git a/libcef/browser/browser_host_base.h b/libcef/browser/browser_host_base.h index f10cab3b4..2359eb72b 100644 --- a/libcef/browser/browser_host_base.h +++ b/libcef/browser/browser_host_base.h @@ -134,6 +134,9 @@ class CefBrowserHostBase : public CefBrowserHost, scoped_refptr browser_info, CefRefPtr request_context); + CefBrowserHostBase(const CefBrowserHostBase&) = delete; + CefBrowserHostBase& operator=(const CefBrowserHostBase&) = delete; + // Called on the UI thread after the associated WebContents is created. virtual void InitializeBrowser(); @@ -310,7 +313,6 @@ class CefBrowserHostBase : public CefBrowserHost, private: IMPLEMENT_REFCOUNTING(CefBrowserHostBase); - DISALLOW_COPY_AND_ASSIGN(CefBrowserHostBase); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_HOST_BASE_H_ diff --git a/libcef/browser/browser_info.h b/libcef/browser/browser_info.h index 11796ad0b..1d7ee747c 100644 --- a/libcef/browser/browser_info.h +++ b/libcef/browser/browser_info.h @@ -39,6 +39,9 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { bool is_windowless, CefRefPtr extra_info); + CefBrowserInfo(const CefBrowserInfo&) = delete; + CefBrowserInfo& operator=(const CefBrowserInfo&) = delete; + int browser_id() const { return browser_id_; } bool is_popup() const { return is_popup_; } bool is_windowless() const { return is_windowless_; } @@ -119,7 +122,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { // Returns all non-speculative frame objects that currently exist. Guest views // will be excluded because they don't have a frame object. Safe to call from // any thread. - typedef std::set> FrameHostList; + using FrameHostList = std::set>; FrameHostList GetAllFrames() const; class NavigationLock final : public base::RefCounted { @@ -251,8 +254,6 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { // Only accessed on the UI thread. std::vector draggable_regions_; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserInfo); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_INFO_H_ diff --git a/libcef/browser/browser_info_manager.h b/libcef/browser/browser_info_manager.h index 6ad16d26e..b8cb281d4 100644 --- a/libcef/browser/browser_info_manager.h +++ b/libcef/browser/browser_info_manager.h @@ -44,6 +44,10 @@ class CefBrowserPlatformDelegate; class CefBrowserInfoManager : public content::RenderProcessHostObserver { public: CefBrowserInfoManager(); + + CefBrowserInfoManager(const CefBrowserInfoManager&) = delete; + CefBrowserInfoManager& operator=(const CefBrowserInfoManager&) = delete; + ~CefBrowserInfoManager() override; // Returns this singleton instance of this class. @@ -232,8 +236,6 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { PendingPopupList pending_popup_list_; int next_timeout_id_ = 0; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserInfoManager); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_INFO_H_ diff --git a/libcef/browser/browser_manager.h b/libcef/browser/browser_manager.h index 3c17e01cd..3087050ed 100644 --- a/libcef/browser/browser_manager.h +++ b/libcef/browser/browser_manager.h @@ -20,6 +20,10 @@ class RenderProcessHost; class CefBrowserManager : public cef::mojom::BrowserManager { public: explicit CefBrowserManager(int render_process_id); + + CefBrowserManager(const CefBrowserManager&) = delete; + CefBrowserManager& operator=(const CefBrowserManager&) = delete; + ~CefBrowserManager() override; // Called from the ContentBrowserClient method of the same name. @@ -47,8 +51,6 @@ class CefBrowserManager : public cef::mojom::BrowserManager { // The process ID of the renderer. const int render_process_id_; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserManager); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_MANAGER_H_ diff --git a/libcef/browser/browser_platform_delegate.h b/libcef/browser/browser_platform_delegate.h index 2c87042ab..d354a009a 100644 --- a/libcef/browser/browser_platform_delegate.h +++ b/libcef/browser/browser_platform_delegate.h @@ -74,6 +74,10 @@ class CefMenuRunner; // indicated. class CefBrowserPlatformDelegate { public: + CefBrowserPlatformDelegate(const CefBrowserPlatformDelegate&) = delete; + CefBrowserPlatformDelegate& operator=(const CefBrowserPlatformDelegate&) = + delete; + // Create a new CefBrowserPlatformDelegate instance. May be called on multiple // threads. static std::unique_ptr Create( @@ -368,8 +372,6 @@ class CefBrowserPlatformDelegate { // Not owned by this object. content::WebContents* web_contents_ = nullptr; CefBrowserHostBase* browser_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegate); }; #endif // CEF_LIBCEF_BROWSER_BROWSER_PLATFORM_DELEGATE_H_ diff --git a/libcef/browser/chrome/chrome_browser_context.h b/libcef/browser/chrome/chrome_browser_context.h index 2ffe413e2..fff34a765 100644 --- a/libcef/browser/chrome/chrome_browser_context.h +++ b/libcef/browser/chrome/chrome_browser_context.h @@ -20,6 +20,9 @@ class ChromeBrowserContext : public CefBrowserContext, public ProfileObserver { public: explicit ChromeBrowserContext(const CefRequestContextSettings& settings); + ChromeBrowserContext(const ChromeBrowserContext&) = delete; + ChromeBrowserContext& operator=(const ChromeBrowserContext&) = delete; + void InitializeAsync(base::OnceClosure initialized_cb); // CefBrowserContext overrides. @@ -47,8 +50,6 @@ class ChromeBrowserContext : public CefBrowserContext, public ProfileObserver { std::vector init_callbacks_; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(ChromeBrowserContext); }; #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_CONTEXT_H_ diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index aca06e4a2..bc6cd21d0 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -41,6 +41,10 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { public: ChromeBrowserDelegate(Browser* browser, const CefBrowserCreateParams& create_params); + + ChromeBrowserDelegate(const ChromeBrowserDelegate&) = delete; + ChromeBrowserDelegate& operator=(const ChromeBrowserDelegate&) = delete; + ~ChromeBrowserDelegate() override; // cef::BrowserDelegate methods: @@ -105,8 +109,6 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { // Used when creating a new browser host. const CefBrowserCreateParams create_params_; - - DISALLOW_COPY_AND_ASSIGN(ChromeBrowserDelegate); }; #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_DELEGATE_H_ diff --git a/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h b/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h index 8eaa7ce51..f91ad2948 100644 --- a/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h +++ b/libcef/browser/chrome/chrome_browser_main_extra_parts_cef.h @@ -9,7 +9,6 @@ #include "libcef/browser/request_context_impl.h" -#include "base/macros.h" #include "base/task/single_thread_task_runner.h" #include "chrome/browser/chrome_browser_main_extra_parts.h" @@ -17,6 +16,12 @@ class ChromeBrowserMainExtraPartsCef : public ChromeBrowserMainExtraParts { public: ChromeBrowserMainExtraPartsCef(); + + ChromeBrowserMainExtraPartsCef(const ChromeBrowserMainExtraPartsCef&) = + delete; + ChromeBrowserMainExtraPartsCef& operator=( + const ChromeBrowserMainExtraPartsCef&) = delete; + ~ChromeBrowserMainExtraPartsCef() override; CefRefPtr request_context() const { @@ -47,8 +52,6 @@ class ChromeBrowserMainExtraPartsCef : public ChromeBrowserMainExtraParts { scoped_refptr background_task_runner_; scoped_refptr user_visible_task_runner_; scoped_refptr user_blocking_task_runner_; - - DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsCef); }; #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_MAIN_EXTRA_PARTS_CEF_H_ diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index be40baa6e..564fb582f 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -24,6 +24,7 @@ #include "libcef/common/command_line_impl.h" #include "base/command_line.h" +#include "base/macros.h" #include "base/path_service.h" #include "chrome/browser/chrome_browser_main.h" #include "chrome/browser/net/system_network_context_manager.h" diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index 768b6861e..e793eb864 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -10,7 +10,6 @@ #include "libcef/browser/request_context_impl.h" -#include "base/macros.h" #include "chrome/browser/chrome_content_browser_client.h" class ChromeBrowserMainExtraPartsCef; @@ -19,6 +18,11 @@ class ChromeBrowserMainExtraPartsCef; class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { public: ChromeContentBrowserClientCef(); + + ChromeContentBrowserClientCef(const ChromeContentBrowserClientCef&) = delete; + ChromeContentBrowserClientCef& operator=( + const ChromeContentBrowserClientCef&) = delete; + ~ChromeContentBrowserClientCef() override; // ChromeContentBrowserClient overrides. @@ -114,8 +118,6 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { private: ChromeBrowserMainExtraPartsCef* browser_main_parts_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientCef); }; #endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_CONTENT_BROWSER_CLIENT_CEF_ diff --git a/libcef/browser/chrome/chrome_context_menu_handler.cc b/libcef/browser/chrome/chrome_context_menu_handler.cc index c474cb5ee..9b2f794a4 100644 --- a/libcef/browser/chrome/chrome_context_menu_handler.cc +++ b/libcef/browser/chrome/chrome_context_menu_handler.cc @@ -23,6 +23,9 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver, CefRefPtr handler) : context_menu_(context_menu), browser_(browser), handler_(handler) {} + CefContextMenuObserver(const CefContextMenuObserver&) = delete; + CefContextMenuObserver& operator=(const CefContextMenuObserver&) = delete; + // RenderViewContextMenuObserver methods: void InitMenu(const content::ContextMenuParams& params) override { @@ -177,8 +180,6 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver, // Map of command_id to ItemInfo. using ItemInfoMap = std::map; ItemInfoMap iteminfomap_; - - DISALLOW_COPY_AND_ASSIGN(CefContextMenuObserver); }; std::unique_ptr MenuCreatedCallback( diff --git a/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc b/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc index 6bfdef9c3..455037c03 100644 --- a/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc +++ b/libcef/browser/chrome/views/browser_platform_delegate_chrome_views.cc @@ -17,6 +17,9 @@ class PopupWindowDelegate : public CefWindowDelegate { explicit PopupWindowDelegate(CefRefPtr browser_view) : browser_view_(browser_view) {} + PopupWindowDelegate(const PopupWindowDelegate&) = delete; + PopupWindowDelegate& operator=(const PopupWindowDelegate&) = delete; + void OnWindowCreated(CefRefPtr window) override { window->AddChildView(browser_view_); window->Show(); @@ -38,7 +41,6 @@ class PopupWindowDelegate : public CefWindowDelegate { CefRefPtr browser_view_; IMPLEMENT_REFCOUNTING(PopupWindowDelegate); - DISALLOW_COPY_AND_ASSIGN(PopupWindowDelegate); }; } // namespace diff --git a/libcef/browser/chrome/views/chrome_browser_view.h b/libcef/browser/chrome/views/chrome_browser_view.h index 7583603ca..930774667 100644 --- a/libcef/browser/chrome/views/chrome_browser_view.h +++ b/libcef/browser/chrome/views/chrome_browser_view.h @@ -32,6 +32,9 @@ class ChromeBrowserView ChromeBrowserView(CefBrowserViewDelegate* cef_delegate, Delegate* browser_view_delegate); + ChromeBrowserView(const ChromeBrowserView&) = delete; + ChromeBrowserView& operator=(const ChromeBrowserView&) = delete; + // Called by ChromeBrowserHostImpl. void InitBrowser(std::unique_ptr browser, CefRefPtr browser_view); @@ -59,8 +62,6 @@ class ChromeBrowserView bool destroyed_ = false; CefRefPtr cef_toolbar_; - - DISALLOW_COPY_AND_ASSIGN(ChromeBrowserView); }; #endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_CHROME_BROWSER_VIEW_H_ diff --git a/libcef/browser/chrome/views/toolbar_view_impl.h b/libcef/browser/chrome/views/toolbar_view_impl.h index 5c483a673..9248614de 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.h +++ b/libcef/browser/chrome/views/toolbar_view_impl.h @@ -17,7 +17,10 @@ class BrowserView; class CefToolbarViewImpl : public CefViewImpl { public: - typedef CefViewImpl ParentClass; + using ParentClass = CefViewImpl; + + CefToolbarViewImpl(const CefToolbarViewImpl&) = delete; + CefToolbarViewImpl& operator=(const CefToolbarViewImpl&) = delete; // Create a new CefToolbarViewImpl instance. |delegate| may be nullptr. static CefRefPtr Create( @@ -49,7 +52,6 @@ class CefToolbarViewImpl absl::optional const display_mode_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl); - DISALLOW_COPY_AND_ASSIGN(CefToolbarViewImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_ diff --git a/libcef/browser/chrome/views/toolbar_view_view.h b/libcef/browser/chrome/views/toolbar_view_view.h index 030c97df7..489200081 100644 --- a/libcef/browser/chrome/views/toolbar_view_view.h +++ b/libcef/browser/chrome/views/toolbar_view_view.h @@ -12,7 +12,7 @@ class CefToolbarViewView : public CefViewView { public: - typedef CefViewView ParentClass; + using ParentClass = CefViewView; // |cef_delegate| may be nullptr. explicit CefToolbarViewView(CefViewDelegate* cef_delegate, @@ -20,8 +20,8 @@ class CefToolbarViewView : public CefViewView { BrowserView* browser_view, absl::optional display_mode); - private: - DISALLOW_COPY_AND_ASSIGN(CefToolbarViewView); + CefToolbarViewView(const CefToolbarViewView&) = delete; + CefToolbarViewView& operator=(const CefToolbarViewView&) = delete; }; #endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_TOOLBAR_VIEW_VIEW_H_ diff --git a/libcef/browser/context_menu_params_impl.h b/libcef/browser/context_menu_params_impl.h index c4033c32d..782848a03 100644 --- a/libcef/browser/context_menu_params_impl.h +++ b/libcef/browser/context_menu_params_impl.h @@ -17,6 +17,9 @@ class CefContextMenuParamsImpl public: explicit CefContextMenuParamsImpl(content::ContextMenuParams* value); + CefContextMenuParamsImpl(const CefContextMenuParamsImpl&) = delete; + CefContextMenuParamsImpl& operator=(const CefContextMenuParamsImpl&) = delete; + // CefContextMenuParams methods. int GetXCoord() override; int GetYCoord() override; @@ -38,8 +41,6 @@ class CefContextMenuParamsImpl bool IsSpellCheckEnabled() override; EditStateFlags GetEditStateFlags() override; bool IsCustomMenu() override; - - DISALLOW_COPY_AND_ASSIGN(CefContextMenuParamsImpl); }; #endif // CEF_LIBCEF_BROWSER_CONTEXT_MENU_PARAMS_IMPL_H_ diff --git a/libcef/browser/devtools/devtools_controller.h b/libcef/browser/devtools/devtools_controller.h index a1730b733..acaf13b9b 100644 --- a/libcef/browser/devtools/devtools_controller.h +++ b/libcef/browser/devtools/devtools_controller.h @@ -41,6 +41,10 @@ class CefDevToolsController : public content::DevToolsAgentHostClient { // |inspected_contents| will outlive this object. explicit CefDevToolsController(content::WebContents* inspected_contents); + + CefDevToolsController(const CefDevToolsController&) = delete; + CefDevToolsController& operator=(const CefDevToolsController&) = delete; + ~CefDevToolsController() override; // See CefBrowserHost methods of the same name for documentation. @@ -72,8 +76,6 @@ class CefDevToolsController : public content::DevToolsAgentHostClient { base::ObserverList observers_; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefDevToolsController); }; #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_CONTROLLER_H_ diff --git a/libcef/browser/devtools/devtools_file_manager.h b/libcef/browser/devtools/devtools_file_manager.h index 8a37677b6..c15d5d190 100644 --- a/libcef/browser/devtools/devtools_file_manager.h +++ b/libcef/browser/devtools/devtools_file_manager.h @@ -6,7 +6,6 @@ #define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_ #include "base/callback_forward.h" -#include "base/macros.h" #include "base/memory/weak_ptr.h" #include @@ -29,6 +28,9 @@ class CefDevToolsFileManager { CefDevToolsFileManager(AlloyBrowserHostImpl* browser_impl, PrefService* prefs); + CefDevToolsFileManager(const CefDevToolsFileManager&) = delete; + CefDevToolsFileManager& operator=(const CefDevToolsFileManager&) = delete; + void SaveToFile(const std::string& url, const std::string& content, bool save_as); @@ -36,8 +38,8 @@ class CefDevToolsFileManager { private: // SaveToFile implementation: - typedef base::OnceCallback SaveCallback; - typedef base::OnceCallback CancelCallback; + using SaveCallback = base::OnceCallback; + using CancelCallback = base::OnceCallback; void Save(const std::string& url, const std::string& content, bool save_as, @@ -57,7 +59,7 @@ class CefDevToolsFileManager { void CanceledFileSaveAs(const std::string& url); // AppendToFile implementation: - typedef base::OnceCallback AppendCallback; + using AppendCallback = base::OnceCallback; void Append(const std::string& url, const std::string& content, AppendCallback callback); @@ -72,12 +74,10 @@ class CefDevToolsFileManager { AlloyBrowserHostImpl* browser_impl_; PrefService* prefs_; - typedef std::map PathsMap; + using PathsMap = std::map; PathsMap saved_files_; scoped_refptr file_task_runner_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefDevToolsFileManager); }; #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_ diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index ce1cb02f0..031228779 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -22,7 +22,6 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/json/string_escape.h" -#include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -188,6 +187,9 @@ class CefDevToolsFrontend::NetworkResourceLoader loader_->DownloadAsStream(url_loader_factory, this); } + NetworkResourceLoader(const NetworkResourceLoader&) = delete; + NetworkResourceLoader& operator=(const NetworkResourceLoader&) = delete; + private: void OnResponseStarted(const GURL& final_url, const network::mojom::URLResponseHead& response_head) { @@ -230,8 +232,6 @@ class CefDevToolsFrontend::NetworkResourceLoader std::unique_ptr loader_; int request_id_; scoped_refptr response_headers_; - - DISALLOW_COPY_AND_ASSIGN(NetworkResourceLoader); }; // static diff --git a/libcef/browser/devtools/devtools_frontend.h b/libcef/browser/devtools/devtools_frontend.h index 5b89636bd..b1de9a91a 100644 --- a/libcef/browser/devtools/devtools_frontend.h +++ b/libcef/browser/devtools/devtools_frontend.h @@ -12,7 +12,6 @@ #include "base/compiler_specific.h" #include "base/files/file_path.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/values.h" @@ -41,6 +40,9 @@ enum class ProtocolMessageType { class CefDevToolsFrontend : public content::WebContentsObserver, public content::DevToolsAgentHostClient { public: + CefDevToolsFrontend(const CefDevToolsFrontend&) = delete; + CefDevToolsFrontend& operator=(const CefDevToolsFrontend&) = delete; + static CefDevToolsFrontend* Show( AlloyBrowserHostImpl* inspected_browser, const CefWindowInfo& windowInfo, @@ -109,8 +111,6 @@ class CefDevToolsFrontend : public content::WebContentsObserver, const base::FilePath protocol_log_file_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend); }; #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_H_ diff --git a/libcef/browser/devtools/devtools_manager.cc b/libcef/browser/devtools/devtools_manager.cc index 46438ea50..efbab31ed 100644 --- a/libcef/browser/devtools/devtools_manager.cc +++ b/libcef/browser/devtools/devtools_manager.cc @@ -22,6 +22,10 @@ class CefDevToolsRegistrationImpl : public CefRegistration, DCHECK(observer_); } + CefDevToolsRegistrationImpl(const CefDevToolsRegistrationImpl&) = delete; + CefDevToolsRegistrationImpl& operator=(const CefDevToolsRegistrationImpl&) = + delete; + ~CefDevToolsRegistrationImpl() override { CEF_REQUIRE_UIT(); @@ -88,7 +92,6 @@ class CefDevToolsRegistrationImpl : public CefRegistration, base::WeakPtr controller_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl); - DISALLOW_COPY_AND_ASSIGN(CefDevToolsRegistrationImpl); }; } // namespace diff --git a/libcef/browser/devtools/devtools_manager.h b/libcef/browser/devtools/devtools_manager.h index dfc968dbe..d390e4989 100644 --- a/libcef/browser/devtools/devtools_manager.h +++ b/libcef/browser/devtools/devtools_manager.h @@ -24,6 +24,10 @@ class CefDevToolsManager { public: // |inspected_browser| will outlive this object. explicit CefDevToolsManager(CefBrowserHostBase* inspected_browser); + + CefDevToolsManager(const CefDevToolsManager&) = delete; + CefDevToolsManager& operator=(const CefDevToolsManager&) = delete; + ~CefDevToolsManager(); // See CefBrowserHost methods of the same name for documentation. @@ -62,8 +66,6 @@ class CefDevToolsManager { std::unique_ptr devtools_controller_; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefDevToolsManager); }; #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_ diff --git a/libcef/browser/devtools/devtools_manager_delegate.cc b/libcef/browser/devtools/devtools_manager_delegate.cc index f53323d81..e36a3e80c 100644 --- a/libcef/browser/devtools/devtools_manager_delegate.cc +++ b/libcef/browser/devtools/devtools_manager_delegate.cc @@ -12,7 +12,6 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/files/file_path.h" -#include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" @@ -44,6 +43,9 @@ class TCPServerSocketFactory : public content::DevToolsSocketFactory { TCPServerSocketFactory(const std::string& address, uint16_t port) : address_(address), port_(port) {} + TCPServerSocketFactory(const TCPServerSocketFactory&) = delete; + TCPServerSocketFactory& operator=(const TCPServerSocketFactory&) = delete; + private: // content::DevToolsSocketFactory. std::unique_ptr CreateForHttpServer() override { @@ -61,8 +63,6 @@ class TCPServerSocketFactory : public content::DevToolsSocketFactory { std::string address_; uint16_t port_; - - DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); }; std::unique_ptr CreateSocketFactory() { diff --git a/libcef/browser/devtools/devtools_manager_delegate.h b/libcef/browser/devtools/devtools_manager_delegate.h index 7e65fb249..fb4477044 100644 --- a/libcef/browser/devtools/devtools_manager_delegate.h +++ b/libcef/browser/devtools/devtools_manager_delegate.h @@ -6,7 +6,6 @@ #define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_ #include "base/compiler_specific.h" -#include "base/macros.h" #include "content/public/browser/devtools_manager_delegate.h" namespace content { @@ -19,6 +18,11 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate { static void StopHttpHandler(); CefDevToolsManagerDelegate(); + + CefDevToolsManagerDelegate(const CefDevToolsManagerDelegate&) = delete; + CefDevToolsManagerDelegate& operator=(const CefDevToolsManagerDelegate&) = + delete; + ~CefDevToolsManagerDelegate() override; // DevToolsManagerDelegate implementation. @@ -26,9 +30,6 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate { const GURL& url) override; std::string GetDiscoveryPageHTML() override; bool HasBundledFrontendResources() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefDevToolsManagerDelegate); }; #endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_DELEGATE_H_ diff --git a/libcef/browser/download_item_impl.h b/libcef/browser/download_item_impl.h index ab7f4de2c..55ea89dc1 100644 --- a/libcef/browser/download_item_impl.h +++ b/libcef/browser/download_item_impl.h @@ -19,6 +19,9 @@ class CefDownloadItemImpl public: explicit CefDownloadItemImpl(download::DownloadItem* value); + CefDownloadItemImpl(const CefDownloadItemImpl&) = delete; + CefDownloadItemImpl& operator=(const CefDownloadItemImpl&) = delete; + // CefDownloadItem methods. bool IsValid() override; bool IsInProgress() override; @@ -37,9 +40,6 @@ class CefDownloadItemImpl CefString GetSuggestedFileName() override; CefString GetContentDisposition() override; CefString GetMimeType() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefDownloadItemImpl); }; #endif // CEF_LIBCEF_BROWSER_DOWNLOAD_ITEM_IMPL_H_ diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index d1b4a4b8b..21c21aa6f 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -13,6 +13,7 @@ #include "base/bind.h" #include "base/files/file_util.h" #include "base/logging.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -50,6 +51,10 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { suggested_name_(suggested_name), callback_(std::move(callback)) {} + CefBeforeDownloadCallbackImpl(const CefBeforeDownloadCallbackImpl&) = delete; + CefBeforeDownloadCallbackImpl& operator=( + const CefBeforeDownloadCallbackImpl&) = delete; + void Continue(const CefString& download_path, bool show_dialog) override { if (CEF_CURRENTLY_ON_UIT()) { if (download_id_ <= 0) @@ -182,7 +187,6 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { content::DownloadTargetCallback callback_; IMPLEMENT_REFCOUNTING(CefBeforeDownloadCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefBeforeDownloadCallbackImpl); }; // CefDownloadItemCallback implementation. @@ -193,6 +197,10 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { uint32 download_id) : manager_(manager), download_id_(download_id) {} + CefDownloadItemCallbackImpl(const CefDownloadItemCallbackImpl&) = delete; + CefDownloadItemCallbackImpl& operator=(const CefDownloadItemCallbackImpl&) = + delete; + void Cancel() override { CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefDownloadItemCallbackImpl::DoCancel, this)); @@ -248,7 +256,6 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { uint32 download_id_; IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefDownloadItemCallbackImpl); }; } // namespace diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index bf047446b..95f561f2a 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -24,6 +24,11 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer, public CefBrowserHostBase::Observer { public: explicit CefDownloadManagerDelegate(content::DownloadManager* manager); + + CefDownloadManagerDelegate(const CefDownloadManagerDelegate&) = delete; + CefDownloadManagerDelegate& operator=(const CefDownloadManagerDelegate&) = + delete; + ~CefDownloadManagerDelegate() override; private: @@ -55,11 +60,9 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer, // Map of DownloadItem to originating AlloyBrowserHostImpl. Maintaining this // map is necessary because DownloadItem::GetWebContents() may return NULL if // the browser navigates while the download is in progress. - typedef std::map - ItemBrowserMap; + using ItemBrowserMap = + std::map; ItemBrowserMap item_browser_map_; - - DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate); }; #endif // CEF_LIBCEF_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ diff --git a/libcef/browser/extension_impl.h b/libcef/browser/extension_impl.h index bcb629454..482e98c27 100644 --- a/libcef/browser/extension_impl.h +++ b/libcef/browser/extension_impl.h @@ -23,6 +23,9 @@ class CefExtensionImpl : public CefExtension { CefRequestContext* loader_context, CefRefPtr handler); + CefExtensionImpl(const CefExtensionImpl&) = delete; + CefExtensionImpl& operator=(const CefExtensionImpl&) = delete; + // CefExtension methods. CefString GetIdentifier() override; CefString GetPath() override; @@ -52,7 +55,6 @@ class CefExtensionImpl : public CefExtension { bool unloaded_ = false; IMPLEMENT_REFCOUNTING(CefExtensionImpl); - DISALLOW_COPY_AND_ASSIGN(CefExtensionImpl); }; #endif // CEF_LIBCEF_BROWSER_EXTENSION_IMPL_H_ diff --git a/libcef/browser/extensions/api/storage/sync_value_store_cache.h b/libcef/browser/extensions/api/storage/sync_value_store_cache.h index 0a3cb2f06..d425da478 100644 --- a/libcef/browser/extensions/api/storage/sync_value_store_cache.h +++ b/libcef/browser/extensions/api/storage/sync_value_store_cache.h @@ -9,7 +9,6 @@ #include #include "base/compiler_specific.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "extensions/browser/api/storage/settings_storage_quota_enforcer.h" #include "extensions/browser/api/storage/value_store_cache.h" @@ -28,6 +27,10 @@ class SyncValueStoreCache : public ValueStoreCache { public: explicit SyncValueStoreCache( scoped_refptr factory); + + SyncValueStoreCache(const SyncValueStoreCache&) = delete; + SyncValueStoreCache& operator=(const SyncValueStoreCache&) = delete; + ~SyncValueStoreCache() override; // ValueStoreCache implementation: @@ -50,8 +53,6 @@ class SyncValueStoreCache : public ValueStoreCache { // The collection of ValueStores for local storage. StorageMap storage_map_; - - DISALLOW_COPY_AND_ASSIGN(SyncValueStoreCache); }; } // namespace cef diff --git a/libcef/browser/extensions/component_extension_resource_manager.h b/libcef/browser/extensions/component_extension_resource_manager.h index 90810994c..d541d9cb1 100644 --- a/libcef/browser/extensions/component_extension_resource_manager.h +++ b/libcef/browser/extensions/component_extension_resource_manager.h @@ -8,7 +8,6 @@ #include #include "base/files/file_path.h" -#include "base/macros.h" #include "extensions/browser/component_extension_resource_manager.h" namespace webui { @@ -21,6 +20,12 @@ class CefComponentExtensionResourceManager : public ComponentExtensionResourceManager { public: CefComponentExtensionResourceManager(); + + CefComponentExtensionResourceManager( + const CefComponentExtensionResourceManager&) = delete; + CefComponentExtensionResourceManager& operator=( + const CefComponentExtensionResourceManager&) = delete; + ~CefComponentExtensionResourceManager() override; // Overridden from ComponentExtensionResourceManager: @@ -42,8 +47,6 @@ class CefComponentExtensionResourceManager using TemplateReplacementMap = std::map; TemplateReplacementMap template_replacements_; - - DISALLOW_COPY_AND_ASSIGN(CefComponentExtensionResourceManager); }; } // namespace extensions diff --git a/libcef/browser/extensions/extension_background_host.h b/libcef/browser/extensions/extension_background_host.h index 36e8cfad6..e8b69dff4 100644 --- a/libcef/browser/extensions/extension_background_host.h +++ b/libcef/browser/extensions/extension_background_host.h @@ -8,7 +8,6 @@ #include #include "base/callback_forward.h" -#include "base/macros.h" #include "extensions/browser/extension_host.h" class AlloyBrowserHostImpl; @@ -30,6 +29,11 @@ class CefExtensionBackgroundHost : public ExtensionHost { content::WebContents* host_contents, const GURL& url, mojom::ViewType host_type); + + CefExtensionBackgroundHost(const CefExtensionBackgroundHost&) = delete; + CefExtensionBackgroundHost& operator=(const CefExtensionBackgroundHost&) = + delete; + ~CefExtensionBackgroundHost() override; // content::WebContentsDelegate methods: @@ -39,8 +43,6 @@ class CefExtensionBackgroundHost : public ExtensionHost { private: // Callback that will be executed on host deletion. base::OnceClosure deleted_callback_; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionBackgroundHost); }; } // namespace extensions diff --git a/libcef/browser/extensions/extension_function_details.cc b/libcef/browser/extensions/extension_function_details.cc index c664bfffd..3196ce8c1 100644 --- a/libcef/browser/extensions/extension_function_details.cc +++ b/libcef/browser/extensions/extension_function_details.cc @@ -38,6 +38,11 @@ class CefGetExtensionLoadFileCallbackImpl CefExtensionFunctionDetails::LoadFileCallback callback) : file_(file), callback_(std::move(callback)) {} + CefGetExtensionLoadFileCallbackImpl( + const CefGetExtensionLoadFileCallbackImpl&) = delete; + CefGetExtensionLoadFileCallbackImpl& operator=( + const CefGetExtensionLoadFileCallbackImpl&) = delete; + ~CefGetExtensionLoadFileCallbackImpl() { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. @@ -127,7 +132,6 @@ class CefGetExtensionLoadFileCallbackImpl CefExtensionFunctionDetails::LoadFileCallback callback_; IMPLEMENT_REFCOUNTING(CefGetExtensionLoadFileCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefGetExtensionLoadFileCallbackImpl); }; } // namespace diff --git a/libcef/browser/extensions/extension_function_details.h b/libcef/browser/extensions/extension_function_details.h index 0ecdfd8ef..d89af3c5c 100644 --- a/libcef/browser/extensions/extension_function_details.h +++ b/libcef/browser/extensions/extension_function_details.h @@ -10,7 +10,6 @@ #include "include/cef_extension.h" #include "base/callback_forward.h" -#include "base/macros.h" #include "chrome/common/extensions/api/tabs.h" #include "ui/gfx/native_widget_types.h" @@ -30,6 +29,11 @@ class CefExtensionFunctionDetails { // Constructs a new ChromeExtensionFunctionDetails instance for |function|. // This instance does not own |function| and must outlive it. explicit CefExtensionFunctionDetails(ExtensionFunction* function); + + CefExtensionFunctionDetails(const CefExtensionFunctionDetails&) = delete; + CefExtensionFunctionDetails& operator=(const CefExtensionFunctionDetails&) = + delete; + ~CefExtensionFunctionDetails(); Profile* GetProfile() const; @@ -140,8 +144,6 @@ class CefExtensionFunctionDetails { // Verifies correct usage of GetBrowserForTabId* methods. mutable bool get_browser_called_first_time_ = false; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionFunctionDetails); }; } // namespace extensions diff --git a/libcef/browser/extensions/extension_host_delegate.h b/libcef/browser/extensions/extension_host_delegate.h index 2596849f9..ed8a7a08f 100644 --- a/libcef/browser/extensions/extension_host_delegate.h +++ b/libcef/browser/extensions/extension_host_delegate.h @@ -5,7 +5,6 @@ #ifndef LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_ #define LIBCEF_BROWSER_EXTENSIONS_EXTENSION_HOST_DELEGATE_H_ -#include "base/macros.h" #include "extensions/browser/extension_host_delegate.h" class AlloyBrowserHostImpl; @@ -15,6 +14,10 @@ namespace extensions { class CefExtensionHostDelegate : public ExtensionHostDelegate { public: explicit CefExtensionHostDelegate(AlloyBrowserHostImpl* browser); + + CefExtensionHostDelegate(const CefExtensionHostDelegate&) = delete; + CefExtensionHostDelegate& operator=(const CefExtensionHostDelegate&) = delete; + ~CefExtensionHostDelegate() override; // ExtensionHostDelegate implementation. @@ -39,9 +42,6 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate { const viz::SurfaceId& surface_id, const gfx::Size& natural_size) override; void ExitPictureInPicture() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefExtensionHostDelegate); }; } // namespace extensions diff --git a/libcef/browser/extensions/extension_system.h b/libcef/browser/extensions/extension_system.h index 8fd20d1c6..da8848842 100644 --- a/libcef/browser/extensions/extension_system.h +++ b/libcef/browser/extensions/extension_system.h @@ -35,6 +35,10 @@ class RendererStartupHelper; class CefExtensionSystem : public ExtensionSystem { public: explicit CefExtensionSystem(content::BrowserContext* browser_context); + + CefExtensionSystem(const CefExtensionSystem&) = delete; + CefExtensionSystem& operator=(const CefExtensionSystem&) = delete; + ~CefExtensionSystem() override; // Initializes the extension system. @@ -192,8 +196,6 @@ class CefExtensionSystem : public ExtensionSystem { // Must be the last member. base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionSystem); }; } // namespace extensions diff --git a/libcef/browser/extensions/extension_system_factory.h b/libcef/browser/extensions/extension_system_factory.h index fd7b99fe0..004ee93e1 100644 --- a/libcef/browser/extensions/extension_system_factory.h +++ b/libcef/browser/extensions/extension_system_factory.h @@ -13,6 +13,10 @@ namespace extensions { // Factory that provides CefExtensionSystem. class CefExtensionSystemFactory : public ExtensionSystemProvider { public: + CefExtensionSystemFactory(const CefExtensionSystemFactory&) = delete; + CefExtensionSystemFactory& operator=(const CefExtensionSystemFactory&) = + delete; + // ExtensionSystemProvider implementation: ExtensionSystem* GetForBrowserContext( content::BrowserContext* context) override; @@ -31,8 +35,6 @@ class CefExtensionSystemFactory : public ExtensionSystemProvider { content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* context) const override; bool ServiceIsCreatedWithBrowserContext() const override; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionSystemFactory); }; } // namespace extensions diff --git a/libcef/browser/extensions/extension_view_host.h b/libcef/browser/extensions/extension_view_host.h index 6dfde9353..65429b535 100644 --- a/libcef/browser/extensions/extension_view_host.h +++ b/libcef/browser/extensions/extension_view_host.h @@ -7,7 +7,6 @@ #include -#include "base/macros.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "extensions/browser/extension_host.h" @@ -32,6 +31,10 @@ class CefExtensionViewHost : public ExtensionHost, content::WebContents* host_contents, const GURL& url, mojom::ViewType host_type); + + CefExtensionViewHost(const CefExtensionViewHost&) = delete; + CefExtensionViewHost& operator=(const CefExtensionViewHost&) = delete; + ~CefExtensionViewHost() override; // ExtensionHost methods: @@ -55,8 +58,6 @@ class CefExtensionViewHost : public ExtensionHost, private: content::NotificationRegistrar registrar_; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionViewHost); }; } // namespace extensions diff --git a/libcef/browser/extensions/extension_web_contents_observer.h b/libcef/browser/extensions/extension_web_contents_observer.h index 742e53521..f40b97505 100644 --- a/libcef/browser/extensions/extension_web_contents_observer.h +++ b/libcef/browser/extensions/extension_web_contents_observer.h @@ -19,6 +19,11 @@ class CefExtensionWebContentsObserver : public ExtensionWebContentsObserver, public content::WebContentsUserData { public: + CefExtensionWebContentsObserver(const CefExtensionWebContentsObserver&) = + delete; + CefExtensionWebContentsObserver& operator=( + const CefExtensionWebContentsObserver&) = delete; + ~CefExtensionWebContentsObserver() override; // Creates and initializes an instance of this class for the given @@ -38,7 +43,6 @@ class CefExtensionWebContentsObserver std::unique_ptr script_executor_; WEB_CONTENTS_USER_DATA_KEY_DECL(); - DISALLOW_COPY_AND_ASSIGN(CefExtensionWebContentsObserver); }; } // namespace extensions diff --git a/libcef/browser/extensions/extensions_browser_api_provider.h b/libcef/browser/extensions/extensions_browser_api_provider.h index f6fce1494..d2131b72b 100644 --- a/libcef/browser/extensions/extensions_browser_api_provider.h +++ b/libcef/browser/extensions/extensions_browser_api_provider.h @@ -5,7 +5,6 @@ #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_API_PROVIDER_H_ #define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_BROWSER_API_PROVIDER_H_ -#include "base/macros.h" #include "extensions/browser/extensions_browser_api_provider.h" namespace extensions { @@ -13,12 +12,15 @@ namespace extensions { class CefExtensionsBrowserAPIProvider : public ExtensionsBrowserAPIProvider { public: CefExtensionsBrowserAPIProvider(); + + CefExtensionsBrowserAPIProvider(const CefExtensionsBrowserAPIProvider&) = + delete; + CefExtensionsBrowserAPIProvider& operator=( + const CefExtensionsBrowserAPIProvider&) = delete; + ~CefExtensionsBrowserAPIProvider() override; void RegisterExtensionFunctions(ExtensionFunctionRegistry* registry) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefExtensionsBrowserAPIProvider); }; } // namespace extensions diff --git a/libcef/browser/extensions/extensions_browser_client.h b/libcef/browser/extensions/extensions_browser_client.h index 858f3fcbb..d7cd38169 100644 --- a/libcef/browser/extensions/extensions_browser_client.h +++ b/libcef/browser/extensions/extensions_browser_client.h @@ -18,6 +18,11 @@ class ExtensionsAPIClient; class CefExtensionsBrowserClient : public ExtensionsBrowserClient { public: CefExtensionsBrowserClient(); + + CefExtensionsBrowserClient(const CefExtensionsBrowserClient&) = delete; + CefExtensionsBrowserClient& operator=(const CefExtensionsBrowserClient&) = + delete; + ~CefExtensionsBrowserClient() override; // Returns the singleton CefExtensionsBrowserClient instance. @@ -111,8 +116,6 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient { std::unique_ptr resource_manager_; std::unique_ptr kiosk_delegate_; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionsBrowserClient); }; } // namespace extensions diff --git a/libcef/browser/extensions/mime_handler_view_guest_delegate.h b/libcef/browser/extensions/mime_handler_view_guest_delegate.h index b1c926467..96b413b76 100644 --- a/libcef/browser/extensions/mime_handler_view_guest_delegate.h +++ b/libcef/browser/extensions/mime_handler_view_guest_delegate.h @@ -18,6 +18,12 @@ namespace extensions { class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate { public: explicit CefMimeHandlerViewGuestDelegate(MimeHandlerViewGuest* guest); + + CefMimeHandlerViewGuestDelegate(const CefMimeHandlerViewGuestDelegate&) = + delete; + CefMimeHandlerViewGuestDelegate& operator=( + const CefMimeHandlerViewGuestDelegate&) = delete; + ~CefMimeHandlerViewGuestDelegate() override; // MimeHandlerViewGuestDelegate methods. @@ -31,8 +37,6 @@ class CefMimeHandlerViewGuestDelegate : public MimeHandlerViewGuestDelegate { private: MimeHandlerViewGuest* guest_; // Owns us. content::WebContents* owner_web_contents_; - - DISALLOW_COPY_AND_ASSIGN(CefMimeHandlerViewGuestDelegate); }; } // namespace extensions diff --git a/libcef/browser/extensions/pdf_web_contents_helper_client.h b/libcef/browser/extensions/pdf_web_contents_helper_client.h index 13ed29e07..78c021593 100644 --- a/libcef/browser/extensions/pdf_web_contents_helper_client.h +++ b/libcef/browser/extensions/pdf_web_contents_helper_client.h @@ -5,7 +5,6 @@ #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_PDF_WEB_CONTENTS_HELPER_CLIENT_H_ #define CEF_LIBCEF_BROWSER_EXTENSIONS_PDF_WEB_CONTENTS_HELPER_CLIENT_H_ -#include "base/macros.h" #include "components/pdf/browser/pdf_web_contents_helper_client.h" namespace extensions { @@ -13,6 +12,11 @@ namespace extensions { class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient { public: CefPDFWebContentsHelperClient(); + + CefPDFWebContentsHelperClient(const CefPDFWebContentsHelperClient&) = delete; + CefPDFWebContentsHelperClient& operator=( + const CefPDFWebContentsHelperClient&) = delete; + ~CefPDFWebContentsHelperClient() override; private: @@ -22,8 +26,6 @@ class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient { void OnPDFHasUnsupportedFeature(content::WebContents* contents) override; void OnSaveURL(content::WebContents* contents) override; void SetPluginCanSave(content::WebContents* contents, bool can_save) override; - - DISALLOW_COPY_AND_ASSIGN(CefPDFWebContentsHelperClient); }; } // namespace extensions diff --git a/libcef/browser/extensions/value_store/cef_value_store.h b/libcef/browser/extensions/value_store/cef_value_store.h index 7de64a346..21fd700e3 100644 --- a/libcef/browser/extensions/value_store/cef_value_store.h +++ b/libcef/browser/extensions/value_store/cef_value_store.h @@ -12,7 +12,6 @@ #include #include "base/compiler_specific.h" -#include "base/macros.h" #include "components/value_store/value_store.h" namespace value_store { diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index d73471cdc..19aee67d8 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -99,6 +99,9 @@ class UploadFolderHelper CefFileDialogRunner::RunFileChooserCallback callback) : callback_(std::move(callback)) {} + UploadFolderHelper(const UploadFolderHelper&) = delete; + UploadFolderHelper& operator=(const UploadFolderHelper&) = delete; + ~UploadFolderHelper() override { if (!callback_.is_null()) { if (CEF_CURRENTLY_ON_UIT()) { @@ -133,8 +136,6 @@ class UploadFolderHelper CefFileDialogRunner::RunFileChooserCallback callback_; std::vector select_files_; - - DISALLOW_COPY_AND_ASSIGN(UploadFolderHelper); }; } // namespace diff --git a/libcef/browser/file_dialog_manager.h b/libcef/browser/file_dialog_manager.h index c285fa933..8fccda689 100644 --- a/libcef/browser/file_dialog_manager.h +++ b/libcef/browser/file_dialog_manager.h @@ -30,6 +30,10 @@ class CefFileDialogManager { // |runner| may be NULL if the platform doesn't implement dialogs. CefFileDialogManager(AlloyBrowserHostImpl* browser, std::unique_ptr runner); + + CefFileDialogManager(const CefFileDialogManager&) = delete; + CefFileDialogManager& operator=(const CefFileDialogManager&) = delete; + ~CefFileDialogManager(); // Delete the runner to free any platform constructs. @@ -99,8 +103,6 @@ class CefFileDialogManager { // Must be the last member. base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefFileDialogManager); }; #endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ diff --git a/libcef/browser/file_dialog_runner.h b/libcef/browser/file_dialog_runner.h index 548a4222f..6c9ad2ccd 100644 --- a/libcef/browser/file_dialog_runner.h +++ b/libcef/browser/file_dialog_runner.h @@ -17,6 +17,9 @@ class AlloyBrowserHostImpl; class CefFileDialogRunner { public: + CefFileDialogRunner(const CefFileDialogRunner&) = delete; + CefFileDialogRunner& operator=(const CefFileDialogRunner&) = delete; + // Extend blink::mojom::FileChooserParams with some options unique to CEF. struct FileChooserParams : public blink::mojom::FileChooserParams { // 0-based index of the selected value in |accept_types|. @@ -30,8 +33,8 @@ class CefFileDialogRunner { }; // The argument vector will be empty if the dialog was canceled. - typedef base::OnceCallback&)> - RunFileChooserCallback; + using RunFileChooserCallback = + base::OnceCallback&)>; // Display the file chooser dialog. Execute |callback| on completion. virtual void Run(AlloyBrowserHostImpl* browser, @@ -42,11 +45,8 @@ class CefFileDialogRunner { // Allow deletion via std::unique_ptr only. friend std::default_delete; - CefFileDialogRunner() {} - virtual ~CefFileDialogRunner() {} - - private: - DISALLOW_COPY_AND_ASSIGN(CefFileDialogRunner); + CefFileDialogRunner() = default; + virtual ~CefFileDialogRunner() = default; }; #endif // CEF_LIBCEF_BROWSER_FILE_DIALOG_RUNNER_H_ diff --git a/libcef/browser/frame_host_impl.h b/libcef/browser/frame_host_impl.h index e5ca3ee8c..4b3dd572a 100644 --- a/libcef/browser/frame_host_impl.h +++ b/libcef/browser/frame_host_impl.h @@ -40,6 +40,9 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { CefFrameHostImpl(scoped_refptr browser_info, content::RenderFrameHost* render_frame_host); + CefFrameHostImpl(const CefFrameHostImpl&) = delete; + CefFrameHostImpl& operator=(const CefFrameHostImpl&) = delete; + ~CefFrameHostImpl() override; // CefFrame methods @@ -183,7 +186,6 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { mojo::Remote render_frame_; IMPLEMENT_REFCOUNTING(CefFrameHostImpl); - DISALLOW_COPY_AND_ASSIGN(CefFrameHostImpl); }; #endif // CEF_LIBCEF_BROWSER_FRAME_HOST_IMPL_H_ diff --git a/libcef/browser/gpu/external_texture_manager.h b/libcef/browser/gpu/external_texture_manager.h index b090d7c0c..02a1cfded 100644 --- a/libcef/browser/gpu/external_texture_manager.h +++ b/libcef/browser/gpu/external_texture_manager.h @@ -36,7 +36,7 @@ class GPU_GLES2_EXPORT ExternalTextureManager { void DeleteTexture(void* handle, TextureManager* tex_man); private: - typedef std::map> ExternalSurfaceMap; + using ExternalSurfaceMap = std::map>; ExternalSurfaceMap surfaceMap_; }; diff --git a/libcef/browser/image_impl.h b/libcef/browser/image_impl.h index 1458f2765..36d75f4e5 100644 --- a/libcef/browser/image_impl.h +++ b/libcef/browser/image_impl.h @@ -21,6 +21,9 @@ class CefImageImpl : public CefImage { // representation. explicit CefImageImpl(const gfx::ImageSkia& image_skia); + CefImageImpl(const CefImageImpl&) = delete; + CefImageImpl& operator=(const CefImageImpl&) = delete; + // Deletes the image and, if the only owner of the storage, all of its cached // representations. ~CefImageImpl() override = default; @@ -95,9 +98,9 @@ class CefImageImpl : public CefImage { // The |bitmap| argument will be RGBA or BGRA and either opaque or transparent // with post-multiplied alpha. Writes the compressed output into |compressed|. - typedef base::OnceCallback* /*compressed*/)> - CompressionMethod; + using CompressionMethod = + base::OnceCallback* /*compressed*/)>; // Write |bitmap| into |compressed| using |method|. static bool WriteCompressedFormat(const SkBitmap& bitmap, @@ -121,7 +124,6 @@ class CefImageImpl : public CefImage { gfx::Image image_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefImageImpl); - DISALLOW_COPY_AND_ASSIGN(CefImageImpl); }; #endif // CEF_LIBCEF_BROWSER_IMAGE_IMPL_H_ diff --git a/libcef/browser/iothread_state.h b/libcef/browser/iothread_state.h index f265fbfaf..71457fd5d 100644 --- a/libcef/browser/iothread_state.h +++ b/libcef/browser/iothread_state.h @@ -29,6 +29,9 @@ class CefIOThreadState : public base::RefCountedThreadSafe< public: CefIOThreadState(); + CefIOThreadState(const CefIOThreadState&) = delete; + CefIOThreadState& operator=(const CefIOThreadState&) = delete; + // See comments in CefRequestContextHandlerMap. void AddHandler(const content::GlobalRenderFrameHostId& global_id, CefRefPtr handler); @@ -57,12 +60,9 @@ class CefIOThreadState : public base::RefCountedThreadSafe< CefRequestContextHandlerMap handler_map_; // Map (scheme, domain) to factories. - typedef std::map, - CefRefPtr> - SchemeHandlerFactoryMap; + using SchemeHandlerFactoryMap = std::map, + CefRefPtr>; SchemeHandlerFactoryMap scheme_handler_factory_map_; - - DISALLOW_COPY_AND_ASSIGN(CefIOThreadState); }; #endif // CEF_LIBCEF_BROWSER_IOTHREAD_STATE_H_ diff --git a/libcef/browser/javascript_dialog_manager.h b/libcef/browser/javascript_dialog_manager.h index a9a3deef8..20fcd632f 100644 --- a/libcef/browser/javascript_dialog_manager.h +++ b/libcef/browser/javascript_dialog_manager.h @@ -22,6 +22,11 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { // |runner| may be NULL if the platform doesn't implement dialogs. CefJavaScriptDialogManager(AlloyBrowserHostImpl* browser, std::unique_ptr runner); + + CefJavaScriptDialogManager(const CefJavaScriptDialogManager&) = delete; + CefJavaScriptDialogManager& operator=(const CefJavaScriptDialogManager&) = + delete; + ~CefJavaScriptDialogManager() override; // Delete the runner to free any platform constructs. @@ -58,8 +63,6 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { // Must be the last member. base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefJavaScriptDialogManager); }; #endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_ diff --git a/libcef/browser/javascript_dialog_runner.h b/libcef/browser/javascript_dialog_runner.h index befadcc5d..d9e2488e7 100644 --- a/libcef/browser/javascript_dialog_runner.h +++ b/libcef/browser/javascript_dialog_runner.h @@ -14,9 +14,13 @@ class AlloyBrowserHostImpl; class CefJavaScriptDialogRunner { public: - typedef base::OnceCallback - DialogClosedCallback; + CefJavaScriptDialogRunner(const CefJavaScriptDialogRunner&) = delete; + CefJavaScriptDialogRunner& operator=(const CefJavaScriptDialogRunner&) = + delete; + + using DialogClosedCallback = + base::OnceCallback; // Run the dialog. Execute |callback| on completion. virtual void Run(AlloyBrowserHostImpl* browser, @@ -33,11 +37,8 @@ class CefJavaScriptDialogRunner { // Allow deletion via std::unique_ptr only. friend std::default_delete; - CefJavaScriptDialogRunner() {} - virtual ~CefJavaScriptDialogRunner() {} - - private: - DISALLOW_COPY_AND_ASSIGN(CefJavaScriptDialogRunner); + CefJavaScriptDialogRunner() = default; + virtual ~CefJavaScriptDialogRunner() = default; }; #endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_RUNNER_H_ diff --git a/libcef/browser/main_runner.h b/libcef/browser/main_runner.h index ca8a56191..da68c9513 100644 --- a/libcef/browser/main_runner.h +++ b/libcef/browser/main_runner.h @@ -12,7 +12,6 @@ #include "libcef/common/main_runner_handler.h" #include "base/callback.h" -#include "base/macros.h" #include "content/public/browser/browser_main_runner.h" namespace base { @@ -30,6 +29,10 @@ class CefUIThread; class CefMainRunner : public CefMainRunnerHandler { public: CefMainRunner(bool multi_threaded_message_loop, bool external_message_pump); + + CefMainRunner(const CefMainRunner&) = delete; + CefMainRunner& operator=(const CefMainRunner&) = delete; + ~CefMainRunner(); // Called from CefContext::Initialize. @@ -90,8 +93,6 @@ class CefMainRunner : public CefMainRunnerHandler { // Used to quit the current base::RunLoop. base::OnceClosure quit_when_idle_callback_; - - DISALLOW_COPY_AND_ASSIGN(CefMainRunner); }; #endif // CEF_LIBCEF_BROWSER_MAIN_RUNNER_H_ diff --git a/libcef/browser/media_router/media_route_impl.h b/libcef/browser/media_router/media_route_impl.h index 6366cdd8f..8ca65c70d 100644 --- a/libcef/browser/media_router/media_route_impl.h +++ b/libcef/browser/media_router/media_route_impl.h @@ -17,6 +17,9 @@ class CefMediaRouteImpl : public CefMediaRoute { CefMediaRouteImpl(const media_router::MediaRoute& route, const CefBrowserContext::Getter& browser_context_getter); + CefMediaRouteImpl(const CefMediaRouteImpl&) = delete; + CefMediaRouteImpl& operator=(const CefMediaRouteImpl&) = delete; + // CefMediaRoute methods. CefString GetId() override; CefRefPtr GetSource() override; @@ -34,7 +37,6 @@ class CefMediaRouteImpl : public CefMediaRoute { const CefBrowserContext::Getter browser_context_getter_; IMPLEMENT_REFCOUNTING(CefMediaRouteImpl); - DISALLOW_COPY_AND_ASSIGN(CefMediaRouteImpl); }; #endif // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_IMPL_H_ diff --git a/libcef/browser/media_router/media_router_impl.cc b/libcef/browser/media_router/media_router_impl.cc index dd884a7b7..dcf5a553a 100644 --- a/libcef/browser/media_router/media_router_impl.cc +++ b/libcef/browser/media_router/media_router_impl.cc @@ -31,6 +31,9 @@ class CefRegistrationImpl : public CefRegistration, DCHECK(observer_); } + CefRegistrationImpl(const CefRegistrationImpl&) = delete; + CefRegistrationImpl& operator=(const CefRegistrationImpl&) = delete; + ~CefRegistrationImpl() override { CEF_REQUIRE_UIT(); @@ -132,7 +135,6 @@ class CefRegistrationImpl : public CefRegistration, CefBrowserContext::Getter browser_context_getter_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefRegistrationImpl); - DISALLOW_COPY_AND_ASSIGN(CefRegistrationImpl); }; CefMediaRouterImpl::CefMediaRouterImpl() { diff --git a/libcef/browser/media_router/media_router_impl.h b/libcef/browser/media_router/media_router_impl.h index 50ff8fcf3..f0aba10e9 100644 --- a/libcef/browser/media_router/media_router_impl.h +++ b/libcef/browser/media_router/media_router_impl.h @@ -18,6 +18,9 @@ class CefMediaRouterImpl : public CefMediaRouter { public: CefMediaRouterImpl(); + CefMediaRouterImpl(const CefMediaRouterImpl&) = delete; + CefMediaRouterImpl& operator=(const CefMediaRouterImpl&) = delete; + // Called on the UI thread after object creation and before any other object // methods are executed on the UI thread. void Initialize(const CefBrowserContext::Getter& browser_context_getter, @@ -58,7 +61,6 @@ class CefMediaRouterImpl : public CefMediaRouter { std::vector init_callbacks_; IMPLEMENT_REFCOUNTING(CefMediaRouterImpl); - DISALLOW_COPY_AND_ASSIGN(CefMediaRouterImpl); }; #endif // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_IMPL_H_ diff --git a/libcef/browser/media_router/media_router_manager.cc b/libcef/browser/media_router/media_router_manager.cc index b3da61eb8..0232876f6 100644 --- a/libcef/browser/media_router/media_router_manager.cc +++ b/libcef/browser/media_router/media_router_manager.cc @@ -25,6 +25,9 @@ class CefMediaRoutesObserver : public media_router::MediaRoutesObserver { : media_router::MediaRoutesObserver(manager->GetMediaRouter()), manager_(manager) {} + CefMediaRoutesObserver(const CefMediaRoutesObserver&) = delete; + CefMediaRoutesObserver& operator=(const CefMediaRoutesObserver&) = delete; + void OnRoutesUpdated(const std::vector& routes, const std::vector& joinable_route_ids) override { @@ -34,8 +37,6 @@ class CefMediaRoutesObserver : public media_router::MediaRoutesObserver { private: CefMediaRouterManager* const manager_; - - DISALLOW_COPY_AND_ASSIGN(CefMediaRoutesObserver); }; // Used to receive messages if PresentationConnection is not supported. @@ -48,6 +49,9 @@ class CefRouteMessageObserver : public media_router::RouteMessageObserver { manager_(manager), route_(route) {} + CefRouteMessageObserver(const CefRouteMessageObserver&) = delete; + CefRouteMessageObserver& operator=(const CefRouteMessageObserver&) = delete; + void OnMessagesReceived( CefMediaRouterManager::MediaMessageVector messages) override { manager_->OnMessagesReceived(route_, messages); @@ -56,8 +60,6 @@ class CefRouteMessageObserver : public media_router::RouteMessageObserver { private: CefMediaRouterManager* const manager_; const media_router::MediaRoute route_; - - DISALLOW_COPY_AND_ASSIGN(CefRouteMessageObserver); }; // Used for messaging and route status notifications with Cast. @@ -72,6 +74,10 @@ class CefPresentationConnection : public blink::mojom::PresentationConnection { connection_receiver_(this, std::move(connections->connection_receiver)), connection_remote_(std::move(connections->connection_remote)) {} + CefPresentationConnection(const CefPresentationConnection&) = delete; + CefPresentationConnection& operator=(const CefPresentationConnection&) = + delete; + void OnMessage( blink::mojom::PresentationConnectionMessagePtr message) override { CefMediaRouterManager::MediaMessageVector messages; @@ -117,8 +123,6 @@ class CefPresentationConnection : public blink::mojom::PresentationConnection { // Used to send messages to the MRP. mojo::Remote connection_remote_; - - DISALLOW_COPY_AND_ASSIGN(CefPresentationConnection); }; CefMediaRouterManager::CefMediaRouterManager( diff --git a/libcef/browser/media_router/media_router_manager.h b/libcef/browser/media_router/media_router_manager.h index 334f9385b..45611553e 100644 --- a/libcef/browser/media_router/media_router_manager.h +++ b/libcef/browser/media_router/media_router_manager.h @@ -49,6 +49,10 @@ class CefMediaRouterManager }; explicit CefMediaRouterManager(content::BrowserContext* browser_context); + + CefMediaRouterManager(const CefMediaRouterManager&) = delete; + CefMediaRouterManager& operator=(const CefMediaRouterManager&) = delete; + ~CefMediaRouterManager() override; // |observer| must outlive this object or be removed. @@ -119,8 +123,6 @@ class CefMediaRouterManager RouteStateMap route_state_map_; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefMediaRouterManager); }; #endif // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MANAGER_H_ diff --git a/libcef/browser/media_router/media_sink_impl.h b/libcef/browser/media_router/media_sink_impl.h index eef0b4c69..5c2e48962 100644 --- a/libcef/browser/media_router/media_sink_impl.h +++ b/libcef/browser/media_router/media_sink_impl.h @@ -18,6 +18,9 @@ class CefMediaSinkImpl : public CefMediaSink { const std::string& sink_name, media_router::mojom::MediaRouteProviderId provider_id); + CefMediaSinkImpl(const CefMediaSinkImpl&) = delete; + CefMediaSinkImpl& operator=(const CefMediaSinkImpl&) = delete; + // CefMediaSink methods. CefString GetId() override; CefString GetName() override; @@ -36,7 +39,6 @@ class CefMediaSinkImpl : public CefMediaSink { const media_router::MediaSink sink_; IMPLEMENT_REFCOUNTING(CefMediaSinkImpl); - DISALLOW_COPY_AND_ASSIGN(CefMediaSinkImpl); }; #endif // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SINK_IMPL_H_ diff --git a/libcef/browser/media_router/media_source_impl.h b/libcef/browser/media_router/media_source_impl.h index eb8961952..0c9664d08 100644 --- a/libcef/browser/media_router/media_source_impl.h +++ b/libcef/browser/media_router/media_source_impl.h @@ -16,6 +16,9 @@ class CefMediaSourceImpl : public CefMediaSource { explicit CefMediaSourceImpl(const media_router::MediaSource::Id& source_id); explicit CefMediaSourceImpl(const GURL& presentation_url); + CefMediaSourceImpl(const CefMediaSourceImpl&) = delete; + CefMediaSourceImpl& operator=(const CefMediaSourceImpl&) = delete; + // CefMediaSource methods. CefString GetId() override; bool IsCastSource() override; @@ -28,7 +31,6 @@ class CefMediaSourceImpl : public CefMediaSource { const media_router::MediaSource source_; IMPLEMENT_REFCOUNTING(CefMediaSourceImpl); - DISALLOW_COPY_AND_ASSIGN(CefMediaSourceImpl); }; #endif // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_IMPL_H_ diff --git a/libcef/browser/menu_manager.cc b/libcef/browser/menu_manager.cc index 4b020fe10..8f5aa7540 100644 --- a/libcef/browser/menu_manager.cc +++ b/libcef/browser/menu_manager.cc @@ -14,6 +14,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" +#include "base/macros.h" #include "cef/grit/cef_strings.h" #include "chrome/grit/generated_resources.h" #include "content/public/browser/render_frame_host.h" @@ -35,11 +36,15 @@ const cef_event_flags_t kEmptyEventFlags = static_cast(0); class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { public: - typedef base::OnceCallback Callback; + using Callback = base::OnceCallback; explicit CefRunContextMenuCallbackImpl(Callback callback) : callback_(std::move(callback)) {} + CefRunContextMenuCallbackImpl(const CefRunContextMenuCallbackImpl&) = delete; + CefRunContextMenuCallbackImpl& operator=( + const CefRunContextMenuCallbackImpl&) = delete; + ~CefRunContextMenuCallbackImpl() { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. @@ -82,7 +87,6 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { Callback callback_; IMPLEMENT_REFCOUNTING(CefRunContextMenuCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefRunContextMenuCallbackImpl); }; } // namespace diff --git a/libcef/browser/menu_manager.h b/libcef/browser/menu_manager.h index 931b0038e..239e3b7c3 100644 --- a/libcef/browser/menu_manager.h +++ b/libcef/browser/menu_manager.h @@ -27,6 +27,10 @@ class CefMenuManager : public CefMenuModelImpl::Delegate, public: CefMenuManager(AlloyBrowserHostImpl* browser, std::unique_ptr runner); + + CefMenuManager(const CefMenuManager&) = delete; + CefMenuManager& operator=(const CefMenuManager&) = delete; + ~CefMenuManager() override; // Delete the runner to free any platform constructs. @@ -72,8 +76,6 @@ class CefMenuManager : public CefMenuModelImpl::Delegate, // Must be the last member. base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefMenuManager); }; #endif // CEF_LIBCEF_BROWSER_MENU_MANAGER_H_ diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index 929b21701..7cfbd9279 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -33,6 +33,9 @@ class CefSimpleMenuModel : public ui::MenuModel { // disabled. explicit CefSimpleMenuModel(CefMenuModelImpl* impl) : impl_(impl) {} + CefSimpleMenuModel(const CefSimpleMenuModel&) = delete; + CefSimpleMenuModel& operator=(const CefSimpleMenuModel&) = delete; + // MenuModel methods. bool HasIcons() const override { return false; } @@ -165,8 +168,6 @@ class CefSimpleMenuModel : public ui::MenuModel { private: CefMenuModelImpl* impl_; - - DISALLOW_COPY_AND_ASSIGN(CefSimpleMenuModel); }; cef_menu_color_type_t GetMenuColorType(bool is_text, diff --git a/libcef/browser/menu_model_impl.h b/libcef/browser/menu_model_impl.h index e7254c4d3..df1e8ad61 100644 --- a/libcef/browser/menu_model_impl.h +++ b/libcef/browser/menu_model_impl.h @@ -58,6 +58,10 @@ class CefMenuModelImpl : public CefMenuModel { CefMenuModelImpl(Delegate* delegate, CefRefPtr menu_model_delegate, bool is_submenu); + + CefMenuModelImpl(const CefMenuModelImpl&) = delete; + CefMenuModelImpl& operator=(const CefMenuModelImpl&) = delete; + ~CefMenuModelImpl() override; // CefMenuModel methods. @@ -189,7 +193,7 @@ class CefMenuModelImpl : public CefMenuModel { private: struct Item; - typedef std::vector ItemVector; + using ItemVector = std::vector; // Functions for inserting items into |items_|. void AppendItem(const Item& item); @@ -226,7 +230,6 @@ class CefMenuModelImpl : public CefMenuModel { bool auto_notify_menu_closed_ = true; IMPLEMENT_REFCOUNTING(CefMenuModelImpl); - DISALLOW_COPY_AND_ASSIGN(CefMenuModelImpl); }; #endif // CEF_LIBCEF_BROWSER_MENU_MODEL_IMPL_H_ diff --git a/libcef/browser/menu_runner.h b/libcef/browser/menu_runner.h index 2e17ae07d..a0107dbec 100644 --- a/libcef/browser/menu_runner.h +++ b/libcef/browser/menu_runner.h @@ -8,8 +8,6 @@ #include #include -#include "base/macros.h" - namespace content { struct ContextMenuParams; } @@ -20,6 +18,9 @@ class CefMenuModelImpl; // Provides platform-specific menu implementations for CefMenuCreator. class CefMenuRunner { public: + CefMenuRunner(const CefMenuRunner&) = delete; + CefMenuRunner& operator=(const CefMenuRunner&) = delete; + virtual bool RunContextMenu(AlloyBrowserHostImpl* browser, CefMenuModelImpl* model, const content::ContextMenuParams& params) = 0; @@ -30,10 +31,8 @@ class CefMenuRunner { // Allow deletion via std::unique_ptr only. friend std::default_delete; - CefMenuRunner() {} - virtual ~CefMenuRunner() {} - - DISALLOW_COPY_AND_ASSIGN(CefMenuRunner); + CefMenuRunner() = default; + virtual ~CefMenuRunner() = default; }; #endif // CEF_LIBCEF_BROWSER_MENU_RUNNER_H_ diff --git a/libcef/browser/native/menu_2.h b/libcef/browser/native/menu_2.h index 7de1db0e5..b2d0fcbf6 100644 --- a/libcef/browser/native/menu_2.h +++ b/libcef/browser/native/menu_2.h @@ -9,7 +9,6 @@ #include "libcef/browser/native/menu_wrapper.h" -#include "base/macros.h" #include "ui/gfx/native_widget_types.h" namespace gfx { @@ -40,6 +39,10 @@ class Menu2 { // MyClass : menu_(this) {} // is likely to have problems. explicit Menu2(ui::MenuModel* model); + + Menu2(const Menu2&) = delete; + Menu2& operator=(const Menu2&) = delete; + virtual ~Menu2(); // Runs the menu at the specified point. This method blocks until done. @@ -78,8 +81,6 @@ class Menu2 { // The object that actually implements the menu. std::unique_ptr wrapper_; - - DISALLOW_COPY_AND_ASSIGN(Menu2); }; } // namespace views diff --git a/libcef/browser/native/native_menu_win.cc b/libcef/browser/native/native_menu_win.cc index 7573f4250..684c37710 100644 --- a/libcef/browser/native/native_menu_win.cc +++ b/libcef/browser/native/native_menu_win.cc @@ -136,6 +136,9 @@ class CefNativeMenuWin::MenuHostWindow { gfx::SetWindowUserData(hwnd_, this); } + MenuHostWindow(const MenuHostWindow&) = delete; + MenuHostWindow& operator=(const MenuHostWindow&) = delete; + ~MenuHostWindow() { DestroyWindow(hwnd_); } HWND hwnd() const { return hwnd_; } @@ -427,8 +430,6 @@ class CefNativeMenuWin::MenuHostWindow { } HWND hwnd_; - - DISALLOW_COPY_AND_ASSIGN(MenuHostWindow); }; struct CefNativeMenuWin::HighlightedMenuItemInfo { diff --git a/libcef/browser/native/native_menu_win.h b/libcef/browser/native/native_menu_win.h index cb0467486..77a2e7444 100644 --- a/libcef/browser/native/native_menu_win.h +++ b/libcef/browser/native/native_menu_win.h @@ -11,7 +11,6 @@ #include "libcef/browser/native/menu_wrapper.h" #include "base/compiler_specific.h" -#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" @@ -30,6 +29,10 @@ class CefNativeMenuWin : public MenuWrapper { // for that window. // The caller owns the model and the delegate. CefNativeMenuWin(ui::MenuModel* model, HWND system_menu_for); + + CefNativeMenuWin(const CefNativeMenuWin&) = delete; + CefNativeMenuWin& operator=(const CefNativeMenuWin&) = delete; + ~CefNativeMenuWin() override; // Overridden from MenuWrapper: @@ -118,7 +121,7 @@ class CefNativeMenuWin : public MenuWrapper { // An object that collects all of the data associated with an individual menu // item. struct ItemData; - typedef std::vector> ItemDataList; + using ItemDataList = std::vector>; ItemDataList items_; // The window that receives notifications from the menu. @@ -154,8 +157,6 @@ class CefNativeMenuWin : public MenuWrapper { // has a menu open, because our hook function that receives keyboard // events doesn't have a mechanism to get a user data pointer. static CefNativeMenuWin* open_native_menu_win_; - - DISALLOW_COPY_AND_ASSIGN(CefNativeMenuWin); }; } // namespace views diff --git a/libcef/browser/native/window_delegate_view.h b/libcef/browser/native/window_delegate_view.h index 4515c3856..1c574884a 100644 --- a/libcef/browser/native/window_delegate_view.h +++ b/libcef/browser/native/window_delegate_view.h @@ -24,6 +24,9 @@ class CefWindowDelegateView : public views::WidgetDelegateView { bool always_on_top, base::RepeatingClosure on_bounds_changed); + CefWindowDelegateView(const CefWindowDelegateView&) = delete; + CefWindowDelegateView& operator=(const CefWindowDelegateView&) = delete; + // Create the Widget and associated root window. void Init(gfx::AcceleratedWidget parent_widget, content::WebContents* web_contents, @@ -47,8 +50,6 @@ class CefWindowDelegateView : public views::WidgetDelegateView { views::WebView* web_view_; bool always_on_top_; base::RepeatingClosure on_bounds_changed_; - - DISALLOW_COPY_AND_ASSIGN(CefWindowDelegateView); }; #endif // CEF_LIBCEF_BROWSER_NATIVE_WINDOW_DELEGATE_VIEW_H_ diff --git a/libcef/browser/native/window_x11.h b/libcef/browser/native/window_x11.h index b708764d1..3f9616b72 100644 --- a/libcef/browser/native/window_x11.h +++ b/libcef/browser/native/window_x11.h @@ -36,6 +36,10 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, x11::Window parent_xwindow, const gfx::Rect& bounds, const std::string& title); + + CefWindowX11(const CefWindowX11&) = delete; + CefWindowX11& operator=(const CefWindowX11&) = delete; + ~CefWindowX11() override; void Close(); @@ -88,8 +92,6 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, // Must always be the last member. base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefWindowX11); }; #endif // CEF_LIBCEF_BROWSER_NATIVE_WINDOW_X11_H_ diff --git a/libcef/browser/navigation_entry_impl.h b/libcef/browser/navigation_entry_impl.h index 23d10ceea..c9afbafc6 100644 --- a/libcef/browser/navigation_entry_impl.h +++ b/libcef/browser/navigation_entry_impl.h @@ -19,6 +19,9 @@ class CefNavigationEntryImpl public: explicit CefNavigationEntryImpl(content::NavigationEntry* value); + CefNavigationEntryImpl(const CefNavigationEntryImpl&) = delete; + CefNavigationEntryImpl& operator=(const CefNavigationEntryImpl&) = delete; + // CefNavigationEntry methods. bool IsValid() override; CefString GetURL() override; @@ -30,9 +33,6 @@ class CefNavigationEntryImpl CefTime GetCompletionTime() override; int GetHttpStatusCode() override; CefRefPtr GetSSLStatus() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefNavigationEntryImpl); }; #endif // CEF_LIBCEF_BROWSER_NAVIGATION_ENTRY_IMPL_H_ diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index 2be2756c3..0e7fc4b89 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -214,7 +214,7 @@ std::string GetCommandLine() { base::CommandLine::ForCurrentProcess()->GetCommandLineString()); #elif defined(OS_POSIX) std::string command_line = ""; - typedef std::vector ArgvList; + using ArgvList = std::vector; const ArgvList& argv = base::CommandLine::ForCurrentProcess()->argv(); for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) command_line += " " + *iter; @@ -283,7 +283,7 @@ class TemplateParser { } private: - typedef std::map KeyMap; + using KeyMap = std::map; KeyMap values_; std::string ident_start_; std::string ident_end_; @@ -473,6 +473,9 @@ class CefURLDataSource : public content::URLDataSource { DCHECK(handled) << "Unhandled WebUI host: " << host; } + CefURLDataSource(const CefURLDataSource&) = delete; + CefURLDataSource& operator=(const CefURLDataSource&) = delete; + ~CefURLDataSource() override = default; // content::URLDataSource implementation. @@ -498,8 +501,6 @@ class CefURLDataSource : public content::URLDataSource { std::string mime_type_; scoped_refptr output_; - - DISALLOW_COPY_AND_ASSIGN(CefURLDataSource); }; class CefWebUIController : public content::WebUIController { @@ -513,16 +514,20 @@ class CefWebUIController : public content::WebUIController { profile, std::make_unique(host, host_id, profile)); } - ~CefWebUIController() override = default; + CefWebUIController(const CefWebUIController&) = delete; + CefWebUIController& operator=(const CefWebUIController&) = delete; - private: - DISALLOW_COPY_AND_ASSIGN(CefWebUIController); + ~CefWebUIController() override = default; }; // Intercepts all WebUI calls and either blocks them or forwards them to the // Content or Chrome WebUI factory as appropriate. class CefWebUIControllerFactory : public content::WebUIControllerFactory { public: + CefWebUIControllerFactory(const CefWebUIControllerFactory&) = delete; + CefWebUIControllerFactory& operator=(const CefWebUIControllerFactory&) = + delete; + // Returns true if WebUI is allowed to handle the specified |url|. static bool AllowWebUIForURL(const GURL& url) { if (!url.SchemeIs(content::kChromeUIScheme)) @@ -639,8 +644,8 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { static CefWebUIControllerFactory* GetInstance(); protected: - CefWebUIControllerFactory() {} - ~CefWebUIControllerFactory() override {} + CefWebUIControllerFactory() = default; + ~CefWebUIControllerFactory() override = default; private: friend struct base::LazyInstanceTraitsBase; @@ -661,8 +666,6 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { // No need to actually reverse-rewrite the URL. return false; } - - DISALLOW_COPY_AND_ASSIGN(CefWebUIControllerFactory); }; base::LazyInstance::Leaky diff --git a/libcef/browser/net/internal_scheme_handler.cc b/libcef/browser/net/internal_scheme_handler.cc index 0606532c6..6b725ebe2 100644 --- a/libcef/browser/net/internal_scheme_handler.cc +++ b/libcef/browser/net/internal_scheme_handler.cc @@ -53,6 +53,9 @@ class RedirectHandler : public CefResourceHandler { public: explicit RedirectHandler(const GURL& url) : url_(url) {} + RedirectHandler(const RedirectHandler&) = delete; + RedirectHandler& operator=(const RedirectHandler&) = delete; + bool Open(CefRefPtr request, bool& handle_request, CefRefPtr callback) override { @@ -82,7 +85,6 @@ class RedirectHandler : public CefResourceHandler { GURL url_; IMPLEMENT_REFCOUNTING(RedirectHandler); - DISALLOW_COPY_AND_ASSIGN(RedirectHandler); }; class InternalHandler : public CefResourceHandler { @@ -92,6 +94,9 @@ class InternalHandler : public CefResourceHandler { int size) : mime_type_(mime_type), reader_(reader), size_(size) {} + InternalHandler(const InternalHandler&) = delete; + InternalHandler& operator=(const InternalHandler&) = delete; + bool Open(CefRefPtr request, bool& handle_request, CefRefPtr callback) override { @@ -135,7 +140,6 @@ class InternalHandler : public CefResourceHandler { int size_; IMPLEMENT_REFCOUNTING(InternalHandler); - DISALLOW_COPY_AND_ASSIGN(InternalHandler); }; class InternalHandlerFactory : public CefSchemeHandlerFactory { @@ -144,6 +148,9 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory { std::unique_ptr delegate) : delegate_(std::move(delegate)) {} + InternalHandlerFactory(const InternalHandlerFactory&) = delete; + InternalHandlerFactory& operator=(const InternalHandlerFactory&) = delete; + CefRefPtr Create(CefRefPtr browser, CefRefPtr frame, const CefString& scheme_name, @@ -190,7 +197,6 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory { std::unique_ptr delegate_; IMPLEMENT_REFCOUNTING(InternalHandlerFactory); - DISALLOW_COPY_AND_ASSIGN(InternalHandlerFactory); }; } // namespace diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index d4a817b5d..86a3c471c 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -60,6 +60,10 @@ bool IsValidRequestID(int32_t request_id) { class RequestManager { public: RequestManager() {} + + RequestManager(const RequestManager&) = delete; + RequestManager& operator=(const RequestManager&) = delete; + ~RequestManager() { DCHECK(map_.empty()); } void Add(int32_t request_id, @@ -99,8 +103,6 @@ class RequestManager { using RequestMap = std::map; RequestMap map_; - - DISALLOW_COPY_AND_ASSIGN(RequestManager); }; #if DCHECK_IS_ON() diff --git a/libcef/browser/net_service/cookie_manager_impl.h b/libcef/browser/net_service/cookie_manager_impl.h index 036cc3edf..9ae1b9cbd 100644 --- a/libcef/browser/net_service/cookie_manager_impl.h +++ b/libcef/browser/net_service/cookie_manager_impl.h @@ -17,6 +17,9 @@ class CefCookieManagerImpl : public CefCookieManager { public: CefCookieManagerImpl(); + CefCookieManagerImpl(const CefCookieManagerImpl&) = delete; + CefCookieManagerImpl& operator=(const CefCookieManagerImpl&) = delete; + // Called on the UI thread after object creation and before any other object // methods are executed on the UI thread. void Initialize(CefBrowserContext::Getter browser_context_getter, @@ -61,7 +64,6 @@ class CefCookieManagerImpl : public CefCookieManager { std::vector init_callbacks_; IMPLEMENT_REFCOUNTING(CefCookieManagerImpl); - DISALLOW_COPY_AND_ASSIGN(CefCookieManagerImpl); }; #endif // CEF_LIBCEF_BROWSER_NET_SERVICE_COOKIE_MANAGER_IMPL_H_ diff --git a/libcef/browser/net_service/login_delegate.cc b/libcef/browser/net_service/login_delegate.cc index ff30d0de3..6346a4958 100644 --- a/libcef/browser/net_service/login_delegate.cc +++ b/libcef/browser/net_service/login_delegate.cc @@ -23,6 +23,9 @@ class AuthCallbackImpl : public CefAuthCallback { : delegate_(delegate), task_runner_(base::SequencedTaskRunnerHandle::Get()) {} + AuthCallbackImpl(const AuthCallbackImpl&) = delete; + AuthCallbackImpl& operator=(const AuthCallbackImpl&) = delete; + ~AuthCallbackImpl() override { if (delegate_.MaybeValid()) { // If |delegate_| isn't valid this will be a no-op. @@ -63,7 +66,6 @@ class AuthCallbackImpl : public CefAuthCallback { scoped_refptr task_runner_; IMPLEMENT_REFCOUNTING(AuthCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(AuthCallbackImpl); }; void RunCallbackOnIOThread( diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index 603b560ea..7845f4337 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -14,6 +14,7 @@ #include "base/barrier_closure.h" #include "base/command_line.h" +#include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "components/safe_browsing/core/common/safebrowsing_constants.h" #include "content/public/browser/browser_context.h" @@ -70,6 +71,9 @@ bool DisableRequestHandlingForTesting() { // ResourceContext. class ResourceContextData : public base::SupportsUserData::Data { public: + ResourceContextData(const ResourceContextData&) = delete; + ResourceContextData& operator=(const ResourceContextData&) = delete; + ~ResourceContextData() override {} static void AddProxyOnUIThread( @@ -138,8 +142,6 @@ class ResourceContextData : public base::SupportsUserData::Data { proxies_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(ResourceContextData); }; // CORS preflight requests are handled in the network process, so we just need @@ -155,6 +157,9 @@ class CorsPreflightRequest : public network::mojom::TrustedHeaderClient { &CorsPreflightRequest::OnDestroy, weak_factory_.GetWeakPtr())); } + CorsPreflightRequest(const CorsPreflightRequest&) = delete; + CorsPreflightRequest& operator=(const CorsPreflightRequest&) = delete; + // mojom::TrustedHeaderClient methods: void OnBeforeSendHeaders(const net::HttpRequestHeaders& headers, OnBeforeSendHeadersCallback callback) override { @@ -175,8 +180,6 @@ class CorsPreflightRequest : public network::mojom::TrustedHeaderClient { this}; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(CorsPreflightRequest); }; //============================== @@ -198,6 +201,10 @@ class InterceptedRequest : public network::mojom::URLLoader, mojo::PendingReceiver loader_receiver, mojo::PendingRemote client, mojo::PendingRemote target_factory); + + InterceptedRequest(const InterceptedRequest&) = delete; + InterceptedRequest& operator=(const InterceptedRequest&) = delete; + ~InterceptedRequest() override; // Restart the request. This happens on initial start and after redirect. @@ -348,8 +355,6 @@ class InterceptedRequest : public network::mojom::URLLoader, StreamReaderURLLoader* stream_loader_ = nullptr; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(InterceptedRequest); }; class InterceptDelegate : public StreamReaderURLLoader::Delegate { diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index 04d3bd59b..15b39054f 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -11,7 +11,6 @@ #include "base/callback.h" #include "base/containers/unique_ptr_adapters.h" #include "base/hash/hash.h" -#include "base/macros.h" #include "base/strings/string_piece.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/web_contents.h" @@ -35,6 +34,11 @@ class ResourceContextData; class InterceptedRequestHandler { public: InterceptedRequestHandler(); + + InterceptedRequestHandler(const InterceptedRequestHandler&) = delete; + InterceptedRequestHandler& operator=(const InterceptedRequestHandler&) = + delete; + virtual ~InterceptedRequestHandler(); // Optionally modify |request| and execute |callback| to continue the request. @@ -124,9 +128,6 @@ class InterceptedRequestHandler { const network::ResourceRequest& request, int error_code, bool safebrowsing_hit) {} - - private: - DISALLOW_COPY_AND_ASSIGN(InterceptedRequestHandler); }; // URL Loader Factory that supports request/response interception, processing @@ -137,6 +138,9 @@ class ProxyURLLoaderFactory : public network::mojom::URLLoaderFactory, public network::mojom::TrustedURLLoaderHeaderClient { public: + ProxyURLLoaderFactory(const ProxyURLLoaderFactory&) = delete; + ProxyURLLoaderFactory& operator=(const ProxyURLLoaderFactory&) = delete; + ~ProxyURLLoaderFactory() override; // Create a proxy object on the UI thread. @@ -216,8 +220,6 @@ class ProxyURLLoaderFactory std::map> requests_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(ProxyURLLoaderFactory); }; } // namespace net_service diff --git a/libcef/browser/net_service/resource_handler_wrapper.cc b/libcef/browser/net_service/resource_handler_wrapper.cc index 44aabe5fe..bb14e4f69 100644 --- a/libcef/browser/net_service/resource_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_handler_wrapper.cc @@ -22,6 +22,9 @@ class SkipCallbackWrapper : public CefResourceSkipCallback { : callback_(std::move(callback)), work_thread_task_runner_(base::SequencedTaskRunnerHandle::Get()) {} + SkipCallbackWrapper(const SkipCallbackWrapper&) = delete; + SkipCallbackWrapper& operator=(const SkipCallbackWrapper&) = delete; + ~SkipCallbackWrapper() override { if (!callback_.is_null()) { // Make sure it executes on the correct thread. @@ -50,7 +53,6 @@ class SkipCallbackWrapper : public CefResourceSkipCallback { scoped_refptr work_thread_task_runner_; IMPLEMENT_REFCOUNTING(SkipCallbackWrapper); - DISALLOW_COPY_AND_ASSIGN(SkipCallbackWrapper); }; class ReadCallbackWrapper : public CefResourceReadCallback { @@ -59,6 +61,9 @@ class ReadCallbackWrapper : public CefResourceReadCallback { : callback_(std::move(callback)), work_thread_task_runner_(base::SequencedTaskRunnerHandle::Get()) {} + ReadCallbackWrapper(const ReadCallbackWrapper&) = delete; + ReadCallbackWrapper& operator=(const ReadCallbackWrapper&) = delete; + ~ReadCallbackWrapper() override { if (!callback_.is_null()) { // Make sure it executes on the correct thread. @@ -87,7 +92,6 @@ class ReadCallbackWrapper : public CefResourceReadCallback { scoped_refptr work_thread_task_runner_; IMPLEMENT_REFCOUNTING(ReadCallbackWrapper); - DISALLOW_COPY_AND_ASSIGN(ReadCallbackWrapper); }; // Helper for accessing a CefResourceHandler without creating reference loops. @@ -126,6 +130,10 @@ class HandlerProvider : public base::RefCountedThreadSafe { class ReadResponseCallbackWrapper : public CefCallback { public: + ReadResponseCallbackWrapper(const ReadResponseCallbackWrapper&) = delete; + ReadResponseCallbackWrapper& operator=(const ReadResponseCallbackWrapper&) = + delete; + ~ReadResponseCallbackWrapper() override { if (callback_) { // This will post to the correct thread if necessary. @@ -218,7 +226,6 @@ class ReadResponseCallbackWrapper : public CefCallback { CefRefPtr callback_; IMPLEMENT_REFCOUNTING(ReadResponseCallbackWrapper); - DISALLOW_COPY_AND_ASSIGN(ReadResponseCallbackWrapper); }; class InputStreamWrapper : public InputStream { @@ -226,6 +233,9 @@ class InputStreamWrapper : public InputStream { explicit InputStreamWrapper(scoped_refptr handler_provider) : handler_provider_(handler_provider) {} + InputStreamWrapper(const InputStreamWrapper&) = delete; + InputStreamWrapper& operator=(const InputStreamWrapper&) = delete; + ~InputStreamWrapper() override { Cancel(); } // InputStream methods: @@ -294,8 +304,6 @@ class InputStreamWrapper : public InputStream { private: scoped_refptr handler_provider_; - - DISALLOW_COPY_AND_ASSIGN(InputStreamWrapper); }; class OpenCallbackWrapper : public CefCallback { @@ -306,6 +314,9 @@ class OpenCallbackWrapper : public CefCallback { stream_(std::move(stream)), work_thread_task_runner_(base::SequencedTaskRunnerHandle::Get()) {} + OpenCallbackWrapper(const OpenCallbackWrapper&) = delete; + OpenCallbackWrapper& operator=(const OpenCallbackWrapper&) = delete; + ~OpenCallbackWrapper() override { if (!callback_.is_null()) { // Make sure it executes on the correct thread. @@ -351,7 +362,6 @@ class OpenCallbackWrapper : public CefCallback { scoped_refptr work_thread_task_runner_; IMPLEMENT_REFCOUNTING(OpenCallbackWrapper); - DISALLOW_COPY_AND_ASSIGN(OpenCallbackWrapper); }; void CallProcessRequestOnIOThread( @@ -377,6 +387,9 @@ class ResourceResponseWrapper : public ResourceResponse { : request_id_(request_id), handler_provider_(new HandlerProvider(handler)) {} + ResourceResponseWrapper(const ResourceResponseWrapper&) = delete; + ResourceResponseWrapper& operator=(const ResourceResponseWrapper&) = delete; + ~ResourceResponseWrapper() override { // Triggers a call to Cancel on the handler. handler_provider_->Detach(); @@ -491,8 +504,6 @@ class ResourceResponseWrapper : public ResourceResponse { CefRefPtr request_; scoped_refptr handler_provider_; - - DISALLOW_COPY_AND_ASSIGN(ResourceResponseWrapper); }; } // namespace diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index 029bdb22d..02806f481 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -48,6 +48,9 @@ class RequestCallbackWrapper : public CefCallback { : callback_(std::move(callback)), work_thread_task_runner_(base::SequencedTaskRunnerHandle::Get()) {} + RequestCallbackWrapper(const RequestCallbackWrapper&) = delete; + RequestCallbackWrapper& operator=(const RequestCallbackWrapper&) = delete; + ~RequestCallbackWrapper() override { if (!callback_.is_null()) { // Make sure it executes on the correct thread. @@ -78,7 +81,6 @@ class RequestCallbackWrapper : public CefCallback { scoped_refptr work_thread_task_runner_; IMPLEMENT_REFCOUNTING(RequestCallbackWrapper); - DISALLOW_COPY_AND_ASSIGN(RequestCallbackWrapper); }; class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { @@ -155,6 +157,9 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { } } + DestructionObserver(const DestructionObserver&) = delete; + DestructionObserver& operator=(const DestructionObserver&) = delete; + virtual ~DestructionObserver() { CEF_REQUIRE_UIT(); if (!registered_) @@ -208,7 +213,6 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { bool registered_ = true; base::WeakPtr wrapper_; - DISALLOW_COPY_AND_ASSIGN(DestructionObserver); }; // Holds state information for InterceptedRequestHandlerWrapper. State is @@ -315,6 +319,9 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { explicit InitHelper(InterceptedRequestHandlerWrapper* wrapper) : wrapper_(wrapper) {} + InitHelper(const InitHelper&) = delete; + InitHelper& operator=(const InitHelper&) = delete; + void MaybeSetInitialized(std::unique_ptr init_state) { CEF_POST_TASK(CEF_IOT, base::BindOnce(&InitHelper::SetInitialized, this, std::move(init_state))); @@ -344,6 +351,11 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { : init_helper_(base::MakeRefCounted(this)), weak_ptr_factory_(this) {} + InterceptedRequestHandlerWrapper(const InterceptedRequestHandlerWrapper&) = + delete; + InterceptedRequestHandlerWrapper& operator=( + const InterceptedRequestHandlerWrapper&) = delete; + ~InterceptedRequestHandlerWrapper() override { CEF_REQUIRE_IOT(); @@ -1174,8 +1186,6 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { PendingRequests pending_requests_; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(InterceptedRequestHandlerWrapper); }; } // namespace diff --git a/libcef/browser/net_service/response_filter_wrapper.cc b/libcef/browser/net_service/response_filter_wrapper.cc index 7c189a259..3769d83e3 100644 --- a/libcef/browser/net_service/response_filter_wrapper.cc +++ b/libcef/browser/net_service/response_filter_wrapper.cc @@ -24,6 +24,9 @@ class ResponseFilterWrapper { mojo::ScopedDataPipeConsumerHandle source_handle, base::OnceClosure error_callback); + ResponseFilterWrapper(const ResponseFilterWrapper&) = delete; + ResponseFilterWrapper& operator=(const ResponseFilterWrapper&) = delete; + // Creates and returns the output handle, or |source_handle| on failure. bool CreateOutputHandle(mojo::ScopedDataPipeConsumerHandle* output_handle); @@ -47,8 +50,6 @@ class ResponseFilterWrapper { bool write_pending_ = false; std::queue> pending_data_; cef_response_filter_status_t last_status_ = RESPONSE_FILTER_NEED_MORE_DATA; - - DISALLOW_COPY_AND_ASSIGN(ResponseFilterWrapper); }; ResponseFilterWrapper::ResponseFilterWrapper( diff --git a/libcef/browser/net_service/stream_reader_url_loader.cc b/libcef/browser/net_service/stream_reader_url_loader.cc index baf31c5e2..9f6833d2f 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.cc +++ b/libcef/browser/net_service/stream_reader_url_loader.cc @@ -35,6 +35,9 @@ using OnInputStreamOpenedCallback = class OpenInputStreamWrapper : public base::RefCountedThreadSafe { public: + OpenInputStreamWrapper(const OpenInputStreamWrapper&) = delete; + OpenInputStreamWrapper& operator=(const OpenInputStreamWrapper&) = delete; + static base::OnceClosure Open( std::unique_ptr delegate, scoped_refptr work_thread_task_runner, @@ -61,7 +64,7 @@ class OpenInputStreamWrapper work_thread_task_runner_(work_thread_task_runner), job_thread_task_runner_(job_thread_task_runner), callback_(std::move(callback)) {} - virtual ~OpenInputStreamWrapper() {} + virtual ~OpenInputStreamWrapper() = default; void Start(int32_t request_id, const network::ResourceRequest& request) { work_thread_task_runner_->PostTask( @@ -142,8 +145,6 @@ class OpenInputStreamWrapper // Only accessed on |work_thread_task_runner_|. bool is_canceled_ = false; - - DISALLOW_COPY_AND_ASSIGN(OpenInputStreamWrapper); }; } // namespace @@ -161,6 +162,9 @@ class InputStreamReader : public base::RefCountedThreadSafe { std::unique_ptr stream, scoped_refptr work_thread_task_runner); + InputStreamReader(const InputStreamReader&) = delete; + InputStreamReader& operator=(const InputStreamReader&) = delete; + // Skip |skip_bytes| number of bytes from |stream_|. |callback| will be // executed asynchronously on the IO thread. A negative value passed to // |callback| will indicate an error code, a positive value will indicate the @@ -229,8 +233,6 @@ class InputStreamReader : public base::RefCountedThreadSafe { int pending_callback_id_ = -1; int next_callback_id_ = 0; - - DISALLOW_COPY_AND_ASSIGN(InputStreamReader); }; InputStreamReader::InputStreamReader( diff --git a/libcef/browser/net_service/stream_reader_url_loader.h b/libcef/browser/net_service/stream_reader_url_loader.h index 3c36f04b5..edc79b619 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.h +++ b/libcef/browser/net_service/stream_reader_url_loader.h @@ -118,6 +118,10 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { mojo::PendingRemote header_client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, std::unique_ptr response_delegate); + + StreamReaderURLLoader(const StreamReaderURLLoader&) = delete; + StreamReaderURLLoader& operator=(const StreamReaderURLLoader&) = delete; + ~StreamReaderURLLoader() override; void Start(); @@ -184,8 +188,6 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { base::OnceClosure open_cancel_callback_; base::WeakPtrFactory weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(StreamReaderURLLoader); }; } // namespace net_service diff --git a/libcef/browser/net_service/url_loader_factory_getter.h b/libcef/browser/net_service/url_loader_factory_getter.h index 999f8d6e0..c91baca8a 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.h +++ b/libcef/browser/net_service/url_loader_factory_getter.h @@ -6,7 +6,6 @@ #ifndef CEF_LIBCEF_BROWSER_NET_SERVICE_URL_LOADER_FACTORY_GETTER_H_ #define CEF_LIBCEF_BROWSER_NET_SERVICE_URL_LOADER_FACTORY_GETTER_H_ -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner_helpers.h" @@ -32,6 +31,9 @@ class URLLoaderFactoryGetter : public base::RefCountedThreadSafe { public: + URLLoaderFactoryGetter(const URLLoaderFactoryGetter&) = delete; + URLLoaderFactoryGetter& operator=(const URLLoaderFactoryGetter&) = delete; + // Create a URLLoaderFactoryGetter on the UI thread. // |render_frame_host| may be nullptr. static scoped_refptr Create( @@ -62,8 +64,6 @@ class URLLoaderFactoryGetter network::mojom::URLLoaderFactoryPtrInfo proxy_factory_ptr_info_; network::mojom::URLLoaderFactoryRequest proxy_factory_request_; scoped_refptr task_runner_; - - DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryGetter); }; struct URLLoaderFactoryGetterDeleter { diff --git a/libcef/browser/origin_whitelist_impl.cc b/libcef/browser/origin_whitelist_impl.cc index 88e1ac8fb..7bb83b875 100644 --- a/libcef/browser/origin_whitelist_impl.cc +++ b/libcef/browser/origin_whitelist_impl.cc @@ -28,7 +28,11 @@ namespace { // Class that manages cross-origin whitelist registrations. class CefOriginWhitelistManager { public: - CefOriginWhitelistManager() {} + CefOriginWhitelistManager() = default; + + CefOriginWhitelistManager(const CefOriginWhitelistManager&) = delete; + CefOriginWhitelistManager& operator=(const CefOriginWhitelistManager&) = + delete; // Retrieve the singleton instance. static CefOriginWhitelistManager* GetInstance(); @@ -190,8 +194,6 @@ class CefOriginWhitelistManager { // List of registered origins. Access must be protected by |lock_|. CrossOriginWhiteList origin_list_; - - DISALLOW_COPY_AND_ASSIGN(CefOriginWhitelistManager); }; base::LazyInstance::Leaky g_manager = diff --git a/libcef/browser/osr/host_display_client_osr.cc b/libcef/browser/osr/host_display_client_osr.cc index cf9580904..966075b55 100644 --- a/libcef/browser/osr/host_display_client_osr.cc +++ b/libcef/browser/osr/host_display_client_osr.cc @@ -28,6 +28,11 @@ class CefLayeredWindowUpdaterOSR : public viz::mojom::LayeredWindowUpdater { CefLayeredWindowUpdaterOSR( CefRenderWidgetHostViewOSR* const view, mojo::PendingReceiver receiver); + + CefLayeredWindowUpdaterOSR(const CefLayeredWindowUpdaterOSR&) = delete; + CefLayeredWindowUpdaterOSR& operator=(const CefLayeredWindowUpdaterOSR&) = + delete; + ~CefLayeredWindowUpdaterOSR() override; void SetActive(bool active); @@ -45,8 +50,6 @@ class CefLayeredWindowUpdaterOSR : public viz::mojom::LayeredWindowUpdater { bool active_ = false; base::WritableSharedMemoryMapping shared_memory_; gfx::Size pixel_size_; - - DISALLOW_COPY_AND_ASSIGN(CefLayeredWindowUpdaterOSR); }; CefLayeredWindowUpdaterOSR::CefLayeredWindowUpdaterOSR( diff --git a/libcef/browser/osr/host_display_client_osr.h b/libcef/browser/osr/host_display_client_osr.h index 545f5539c..1c4a6b9b6 100644 --- a/libcef/browser/osr/host_display_client_osr.h +++ b/libcef/browser/osr/host_display_client_osr.h @@ -19,6 +19,10 @@ class CefHostDisplayClientOSR : public viz::HostDisplayClient { public: CefHostDisplayClientOSR(CefRenderWidgetHostViewOSR* const view, gfx::AcceleratedWidget widget); + + CefHostDisplayClientOSR(const CefHostDisplayClientOSR&) = delete; + CefHostDisplayClientOSR& operator=(const CefHostDisplayClientOSR&) = delete; + ~CefHostDisplayClientOSR() override; void SetActive(bool active); @@ -40,8 +44,6 @@ class CefHostDisplayClientOSR : public viz::HostDisplayClient { CefRenderWidgetHostViewOSR* const view_; std::unique_ptr layered_window_updater_; bool active_ = false; - - DISALLOW_COPY_AND_ASSIGN(CefHostDisplayClientOSR); }; #endif // CEF_LIBCEF_BROWSER_OSR_HOST_DISPLAY_CLIENT_OSR_H_ diff --git a/libcef/browser/osr/motion_event_osr.h b/libcef/browser/osr/motion_event_osr.h index eefac5eeb..ffc2402b0 100644 --- a/libcef/browser/osr/motion_event_osr.h +++ b/libcef/browser/osr/motion_event_osr.h @@ -17,6 +17,10 @@ class CefMotionEventOSR : public ui::MotionEventGeneric { public: CefMotionEventOSR(); + + CefMotionEventOSR(const CefMotionEventOSR&) = delete; + CefMotionEventOSR& operator=(const CefMotionEventOSR&) = delete; + ~CefMotionEventOSR() override; int GetSourceDeviceId(size_t pointer_index) const override; @@ -52,8 +56,6 @@ class CefMotionEventOSR : public ui::MotionEventGeneric { ui::PointerProperties GetPointerPropertiesFromTouchEvent( const CefTouchEvent& touch, int id); - - DISALLOW_COPY_AND_ASSIGN(CefMotionEventOSR); }; #endif diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index c14087f46..e8d2b61d2 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -81,6 +81,10 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient { explicit CefDelegatedFrameHostClient(CefRenderWidgetHostViewOSR* view) : view_(view) {} + CefDelegatedFrameHostClient(const CefDelegatedFrameHostClient&) = delete; + CefDelegatedFrameHostClient& operator=(const CefDelegatedFrameHostClient&) = + delete; + ui::Layer* DelegatedFrameHostGetLayer() const override { return view_->GetRootLayer(); } @@ -122,8 +126,6 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient { private: CefRenderWidgetHostViewOSR* const view_; - - DISALLOW_COPY_AND_ASSIGN(CefDelegatedFrameHostClient); }; ui::GestureProvider::Config CreateGestureProviderConfig() { diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index f04b0d42c..ab1dccfa5 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -99,6 +99,11 @@ class CefRenderWidgetHostViewOSR bool use_external_begin_frame, content::RenderWidgetHost* widget, CefRenderWidgetHostViewOSR* parent_host_view); + + CefRenderWidgetHostViewOSR(const CefRenderWidgetHostViewOSR&) = delete; + CefRenderWidgetHostViewOSR& operator=(const CefRenderWidgetHostViewOSR&) = + delete; + ~CefRenderWidgetHostViewOSR() override; // RenderWidgetHostView implementation. @@ -408,8 +413,6 @@ class CefRenderWidgetHostViewOSR bool forward_touch_to_popup_ = false; base::WeakPtrFactory weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(CefRenderWidgetHostViewOSR); }; #endif // CEF_LIBCEF_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_OSR_H_ diff --git a/libcef/browser/osr/software_output_device_proxy.h b/libcef/browser/osr/software_output_device_proxy.h index 38e9ce3f3..c9f8c8394 100644 --- a/libcef/browser/osr/software_output_device_proxy.h +++ b/libcef/browser/osr/software_output_device_proxy.h @@ -19,6 +19,11 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceProxy public: explicit SoftwareOutputDeviceProxy( mojom::LayeredWindowUpdaterPtr layered_window_updater); + + SoftwareOutputDeviceProxy(const SoftwareOutputDeviceProxy&) = delete; + SoftwareOutputDeviceProxy& operator=(const SoftwareOutputDeviceProxy&) = + delete; + ~SoftwareOutputDeviceProxy() override; // SoftwareOutputDevice implementation. @@ -43,8 +48,6 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceProxy base::WritableSharedMemoryMapping shm_; THREAD_CHECKER(thread_checker_); - - DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceProxy); }; } // namespace viz diff --git a/libcef/browser/osr/synthetic_gesture_target_osr.h b/libcef/browser/osr/synthetic_gesture_target_osr.h index 9c970d4ed..5e96534b7 100644 --- a/libcef/browser/osr/synthetic_gesture_target_osr.h +++ b/libcef/browser/osr/synthetic_gesture_target_osr.h @@ -5,7 +5,6 @@ #ifndef CEF_LIBCEF_BROWSER_OSR_SYNTHETIC_GESTURE_TARGET_OSR_H_ #define CEF_LIBCEF_BROWSER_OSR_SYNTHETIC_GESTURE_TARGET_OSR_H_ -#include "base/macros.h" #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" // SyntheticGestureTarget implementation for OSR. @@ -14,6 +13,10 @@ class CefSyntheticGestureTargetOSR public: explicit CefSyntheticGestureTargetOSR(content::RenderWidgetHostImpl* host); + CefSyntheticGestureTargetOSR(const CefSyntheticGestureTargetOSR&) = delete; + CefSyntheticGestureTargetOSR& operator=(const CefSyntheticGestureTargetOSR&) = + delete; + // SyntheticGestureTargetBase: void DispatchWebTouchEventToPlatform( const blink::WebTouchEvent& web_touch, @@ -34,9 +37,6 @@ class CefSyntheticGestureTargetOSR float GetTouchSlopInDips() const override; float GetSpanSlopInDips() const override; float GetMinScalingSpanInDips() const override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefSyntheticGestureTargetOSR); }; #endif // CEF_LIBCEF_BROWSER_OSR_SYNTHETIC_GESTURE_TARGET_OSR_H_ diff --git a/libcef/browser/osr/video_consumer_osr.h b/libcef/browser/osr/video_consumer_osr.h index 840296010..4efdc29c8 100644 --- a/libcef/browser/osr/video_consumer_osr.h +++ b/libcef/browser/osr/video_consumer_osr.h @@ -11,6 +11,10 @@ class CefRenderWidgetHostViewOSR; class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer { public: explicit CefVideoConsumerOSR(CefRenderWidgetHostViewOSR* view); + + CefVideoConsumerOSR(const CefVideoConsumerOSR&) = delete; + CefVideoConsumerOSR& operator=(const CefVideoConsumerOSR&) = delete; + ~CefVideoConsumerOSR() override; void SetActive(bool active); @@ -34,8 +38,6 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer { gfx::Size size_in_pixels_; absl::optional bounds_in_pixels_; - - DISALLOW_COPY_AND_ASSIGN(CefVideoConsumerOSR); }; #endif // LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ \ No newline at end of file diff --git a/libcef/browser/osr/web_contents_view_osr.h b/libcef/browser/osr/web_contents_view_osr.h index b85e74b8a..7339eeb90 100644 --- a/libcef/browser/osr/web_contents_view_osr.h +++ b/libcef/browser/osr/web_contents_view_osr.h @@ -26,6 +26,10 @@ class CefWebContentsViewOSR : public content::WebContentsView, explicit CefWebContentsViewOSR(SkColor background_color, bool use_shared_texture, bool use_external_begin_frame); + + CefWebContentsViewOSR(const CefWebContentsViewOSR&) = delete; + CefWebContentsViewOSR& operator=(const CefWebContentsViewOSR&) = delete; + ~CefWebContentsViewOSR() override; void WebContentsCreated(content::WebContents* web_contents); @@ -84,8 +88,6 @@ class CefWebContentsViewOSR : public content::WebContentsView, const bool use_external_begin_frame_; content::WebContents* web_contents_; - - DISALLOW_COPY_AND_ASSIGN(CefWebContentsViewOSR); }; #endif // CEF_LIBCEF_BROWSER_OSR_WEB_CONTENTS_VIEW_OSR_H_ diff --git a/libcef/browser/prefs/pref_store.h b/libcef/browser/prefs/pref_store.h index 600677088..b794ce094 100644 --- a/libcef/browser/prefs/pref_store.h +++ b/libcef/browser/prefs/pref_store.h @@ -10,7 +10,6 @@ #include #include "base/compiler_specific.h" -#include "base/macros.h" #include "base/observer_list.h" #include "components/prefs/persistent_pref_store.h" #include "components/prefs/pref_value_map.h" @@ -22,6 +21,9 @@ class CefPrefStore : public PersistentPrefStore { public: CefPrefStore(); + CefPrefStore(const CefPrefStore&) = delete; + CefPrefStore& operator=(const CefPrefStore&) = delete; + // Overriden from PrefStore. bool GetValue(const std::string& key, const base::Value** result) const override; @@ -113,8 +115,6 @@ class CefPrefStore : public PersistentPrefStore { std::unique_ptr error_delegate_; base::ObserverList::Unchecked observers_; - - DISALLOW_COPY_AND_ASSIGN(CefPrefStore); }; #endif // COMPONENTS_PREFS_TESTING_PREF_STORE_H_ diff --git a/libcef/browser/print_settings_impl.h b/libcef/browser/print_settings_impl.h index a12d92f4d..5436b3d0a 100644 --- a/libcef/browser/print_settings_impl.h +++ b/libcef/browser/print_settings_impl.h @@ -18,6 +18,9 @@ class CefPrintSettingsImpl CefPrintSettingsImpl(std::unique_ptr settings, bool read_only); + CefPrintSettingsImpl(const CefPrintSettingsImpl&) = delete; + CefPrintSettingsImpl& operator=(const CefPrintSettingsImpl&) = delete; + // CefPrintSettings methods. bool IsValid() override; bool IsReadOnly() override; @@ -45,9 +48,6 @@ class CefPrintSettingsImpl DuplexMode GetDuplexMode() override; std::unique_ptr TakeOwnership() WARN_UNUSED_RESULT; - - private: - DISALLOW_COPY_AND_ASSIGN(CefPrintSettingsImpl); }; #endif // CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_ diff --git a/libcef/browser/printing/constrained_window_views_client.cc b/libcef/browser/printing/constrained_window_views_client.cc index 413a9f3d2..78ee5c1af 100644 --- a/libcef/browser/printing/constrained_window_views_client.cc +++ b/libcef/browser/printing/constrained_window_views_client.cc @@ -5,7 +5,6 @@ #include "libcef/browser/printing/constrained_window_views_client.h" #include "base/logging.h" -#include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/notreached.h" #include "chrome/browser/platform_util.h" @@ -18,6 +17,12 @@ class CefConstrainedWindowViewsClient : public constrained_window::ConstrainedWindowViewsClient { public: CefConstrainedWindowViewsClient() {} + + CefConstrainedWindowViewsClient(const CefConstrainedWindowViewsClient&) = + delete; + CefConstrainedWindowViewsClient& operator=( + const CefConstrainedWindowViewsClient&) = delete; + ~CefConstrainedWindowViewsClient() override {} private: @@ -31,8 +36,6 @@ class CefConstrainedWindowViewsClient NOTREACHED(); return gfx::NativeView(); } - - DISALLOW_COPY_AND_ASSIGN(CefConstrainedWindowViewsClient); }; } // namespace diff --git a/libcef/browser/printing/print_dialog_linux.cc b/libcef/browser/printing/print_dialog_linux.cc index 04a532ac2..d51cf40e2 100644 --- a/libcef/browser/printing/print_dialog_linux.cc +++ b/libcef/browser/printing/print_dialog_linux.cc @@ -35,6 +35,10 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { explicit CefPrintDialogCallbackImpl(CefRefPtr dialog) : dialog_(dialog) {} + CefPrintDialogCallbackImpl(const CefPrintDialogCallbackImpl&) = delete; + CefPrintDialogCallbackImpl& operator=(const CefPrintDialogCallbackImpl&) = + delete; + void Continue(CefRefPtr settings) override { if (CEF_CURRENTLY_ON_UIT()) { if (dialog_.get()) { @@ -66,7 +70,6 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { CefRefPtr dialog_; IMPLEMENT_REFCOUNTING(CefPrintDialogCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefPrintDialogCallbackImpl); }; class CefPrintJobCallbackImpl : public CefPrintJobCallback { @@ -74,6 +77,9 @@ class CefPrintJobCallbackImpl : public CefPrintJobCallback { explicit CefPrintJobCallbackImpl(CefRefPtr dialog) : dialog_(dialog) {} + CefPrintJobCallbackImpl(const CefPrintJobCallbackImpl&) = delete; + CefPrintJobCallbackImpl& operator=(const CefPrintJobCallbackImpl&) = delete; + void Continue() override { if (CEF_CURRENTLY_ON_UIT()) { if (dialog_.get()) { @@ -92,7 +98,6 @@ class CefPrintJobCallbackImpl : public CefPrintJobCallback { CefRefPtr dialog_; IMPLEMENT_REFCOUNTING(CefPrintJobCallbackImpl); - DISALLOW_COPY_AND_ASSIGN(CefPrintJobCallbackImpl); }; // static diff --git a/libcef/browser/printing/print_dialog_linux.h b/libcef/browser/printing/print_dialog_linux.h index 2e59ababd..88e9c9529 100644 --- a/libcef/browser/printing/print_dialog_linux.h +++ b/libcef/browser/printing/print_dialog_linux.h @@ -30,6 +30,9 @@ class CefPrintDialogLinux : public printing::PrintDialogGtkInterface, CefPrintDialogLinux, content::BrowserThread::DeleteOnUIThread> { public: + CefPrintDialogLinux(const CefPrintDialogLinux&) = delete; + CefPrintDialogLinux& operator=(const CefPrintDialogLinux&) = delete; + // Creates and returns a print dialog. static printing::PrintDialogGtkInterface* CreatePrintDialog( PrintingContextLinux* context); @@ -90,8 +93,6 @@ class CefPrintDialogLinux : public printing::PrintDialogGtkInterface, CefRefPtr browser_; base::FilePath path_to_pdf_; - - DISALLOW_COPY_AND_ASSIGN(CefPrintDialogLinux); }; #endif // LIBCEF_BROWSER_PRINTING_PRINT_DIALOG_LINUX_H_ diff --git a/libcef/browser/printing/print_view_manager.h b/libcef/browser/printing/print_view_manager.h index 3cc35f3c9..c49b392cd 100644 --- a/libcef/browser/printing/print_view_manager.h +++ b/libcef/browser/printing/print_view_manager.h @@ -8,7 +8,6 @@ #include "include/internal/cef_types_wrappers.h" #include "base/callback_forward.h" -#include "base/macros.h" #include "chrome/browser/printing/print_view_manager.h" #include "components/printing/common/print.mojom-forward.h" #include "content/public/browser/web_contents_observer.h" @@ -29,6 +28,9 @@ namespace printing { class CefPrintViewManager : public PrintViewManager, public mojom::PrintPreviewUI { public: + CefPrintViewManager(const CefPrintViewManager&) = delete; + CefPrintViewManager& operator=(const CefPrintViewManager&) = delete; + ~CefPrintViewManager() override; static void BindPrintManagerHost( @@ -36,7 +38,7 @@ class CefPrintViewManager : public PrintViewManager, content::RenderFrameHost* rfh); // Callback executed on PDF printing completion. - typedef base::OnceCallback PdfPrintCallback; + using PdfPrintCallback = base::OnceCallback; // Print the current document to a PDF file. Execute |callback| on completion. bool PrintToPDF(content::RenderFrameHost* rfh, @@ -98,8 +100,6 @@ class CefPrintViewManager : public PrintViewManager, struct PdfPrintState; std::unique_ptr pdf_print_state_; mojo::AssociatedReceiver pdf_print_receiver_{this}; - - DISALLOW_COPY_AND_ASSIGN(CefPrintViewManager); }; } // namespace printing diff --git a/libcef/browser/request_context_handler_map.h b/libcef/browser/request_context_handler_map.h index 343dbcb2e..8f2422dce 100644 --- a/libcef/browser/request_context_handler_map.h +++ b/libcef/browser/request_context_handler_map.h @@ -11,13 +11,17 @@ #include "include/cef_request_context.h" #include "include/cef_request_context_handler.h" -#include "base/macros.h" #include "content/public/browser/global_routing_id.h" // Tracks CefRequestContextHandler associations on a single thread. class CefRequestContextHandlerMap { public: CefRequestContextHandlerMap(); + + CefRequestContextHandlerMap(const CefRequestContextHandlerMap&) = delete; + CefRequestContextHandlerMap& operator=(const CefRequestContextHandlerMap&) = + delete; + ~CefRequestContextHandlerMap(); // Keep track of handlers associated with specific frames. This information @@ -43,8 +47,6 @@ class CefRequestContextHandlerMap { using RenderIdHandlerMap = std::map>; RenderIdHandlerMap render_id_handler_map_; - - DISALLOW_COPY_AND_ASSIGN(CefRequestContextHandlerMap); }; #endif // CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_HANDLER_MAP_ diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index e6d2476f4..3dfbda67c 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -85,6 +85,9 @@ class ResolveHostHelper : public network::ResolveHostClientBase { explicit ResolveHostHelper(CefRefPtr callback) : callback_(callback), receiver_(this) {} + ResolveHostHelper(const ResolveHostHelper&) = delete; + ResolveHostHelper& operator=(const ResolveHostHelper&) = delete; + void Start(CefBrowserContext* browser_context, const CefString& origin) { CEF_REQUIRE_UIT(); @@ -129,8 +132,6 @@ class ResolveHostHelper : public network::ResolveHostClientBase { mojo::Remote host_resolver_; mojo::Receiver receiver_; - - DISALLOW_COPY_AND_ASSIGN(ResolveHostHelper); }; } // namespace diff --git a/libcef/browser/request_context_impl.h b/libcef/browser/request_context_impl.h index f1e5ae2a0..3589f539c 100644 --- a/libcef/browser/request_context_impl.h +++ b/libcef/browser/request_context_impl.h @@ -22,6 +22,9 @@ class CefBrowserContext; // safe unless otherwise indicated. Will be deleted on the UI thread. class CefRequestContextImpl : public CefRequestContext { public: + CefRequestContextImpl(const CefRequestContextImpl&) = delete; + CefRequestContextImpl& operator=(const CefRequestContextImpl&) = delete; + ~CefRequestContextImpl() override; // Creates the singleton global RequestContext. Called from @@ -170,7 +173,6 @@ class CefRequestContextImpl : public CefRequestContext { Config config_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefRequestContextImpl); - DISALLOW_COPY_AND_ASSIGN(CefRequestContextImpl); }; #endif // CEF_LIBCEF_REQUEST_CONTEXT_IMPL_H_ diff --git a/libcef/browser/server_impl.cc b/libcef/browser/server_impl.cc index a8b78ba73..9ad8cfc36 100644 --- a/libcef/browser/server_impl.cc +++ b/libcef/browser/server_impl.cc @@ -106,6 +106,9 @@ class AcceptWebSocketCallback : public CefCallback { connection_id_(connection_id), request_info_(request_info) {} + AcceptWebSocketCallback(const AcceptWebSocketCallback&) = delete; + AcceptWebSocketCallback& operator=(const AcceptWebSocketCallback&) = delete; + ~AcceptWebSocketCallback() override { if (impl_) impl_->ContinueWebSocketRequest(connection_id_, request_info_, false); @@ -141,7 +144,6 @@ class AcceptWebSocketCallback : public CefCallback { net::HttpServerRequestInfo request_info_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(AcceptWebSocketCallback); - DISALLOW_COPY_AND_ASSIGN(AcceptWebSocketCallback); }; } // namespace diff --git a/libcef/browser/server_impl.h b/libcef/browser/server_impl.h index f4a07e3eb..59fb8260e 100644 --- a/libcef/browser/server_impl.h +++ b/libcef/browser/server_impl.h @@ -22,6 +22,9 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate { public: explicit CefServerImpl(CefRefPtr handler); + CefServerImpl(const CefServerImpl&) = delete; + CefServerImpl& operator=(const CefServerImpl&) = delete; + void Start(const std::string& address, uint16 port, int backlog); // CefServer methods: @@ -107,7 +110,6 @@ class CefServerImpl : public CefServer, net::HttpServer::Delegate { ConnectionInfoMap connection_info_map_; IMPLEMENT_REFCOUNTING(CefServerImpl); - DISALLOW_COPY_AND_ASSIGN(CefServerImpl); }; #endif // CEF_LIBCEF_BROWSER_SERVER_IMPL_H_ diff --git a/libcef/browser/simple_menu_model_impl.h b/libcef/browser/simple_menu_model_impl.h index 1923c9ee5..66a1625ef 100644 --- a/libcef/browser/simple_menu_model_impl.h +++ b/libcef/browser/simple_menu_model_impl.h @@ -36,6 +36,10 @@ class CefSimpleMenuModelImpl : public CefMenuModel { StateDelegate* state_delegate, bool is_owned, bool is_submenu); + + CefSimpleMenuModelImpl(const CefSimpleMenuModelImpl&) = delete; + CefSimpleMenuModelImpl& operator=(const CefSimpleMenuModelImpl&) = delete; + ~CefSimpleMenuModelImpl() override; // Must be called before the object is deleted. @@ -160,7 +164,6 @@ class CefSimpleMenuModelImpl : public CefMenuModel { SubMenuMap submenumap_; IMPLEMENT_REFCOUNTING(CefSimpleMenuModelImpl); - DISALLOW_COPY_AND_ASSIGN(CefSimpleMenuModelImpl); }; #endif // CEF_LIBCEF_BROWSER_SIMPLE_MENU_MODEL_IMPL_H_ diff --git a/libcef/browser/speech_recognition_manager_delegate.h b/libcef/browser/speech_recognition_manager_delegate.h index 932781879..add61eac8 100644 --- a/libcef/browser/speech_recognition_manager_delegate.h +++ b/libcef/browser/speech_recognition_manager_delegate.h @@ -18,6 +18,12 @@ class CefSpeechRecognitionManagerDelegate public content::SpeechRecognitionEventListener { public: CefSpeechRecognitionManagerDelegate(); + + CefSpeechRecognitionManagerDelegate( + const CefSpeechRecognitionManagerDelegate&) = delete; + CefSpeechRecognitionManagerDelegate& operator=( + const CefSpeechRecognitionManagerDelegate&) = delete; + ~CefSpeechRecognitionManagerDelegate() override; protected: @@ -50,8 +56,6 @@ class CefSpeechRecognitionManagerDelegate private: bool filter_profanities_; - - DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionManagerDelegate); }; #endif // CEF_LIBCEF_BROWSER_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ diff --git a/libcef/browser/ssl_host_state_delegate.h b/libcef/browser/ssl_host_state_delegate.h index 1623c7b54..0cb1768f7 100644 --- a/libcef/browser/ssl_host_state_delegate.h +++ b/libcef/browser/ssl_host_state_delegate.h @@ -44,6 +44,10 @@ class CertPolicy { class CefSSLHostStateDelegate : public content::SSLHostStateDelegate { public: CefSSLHostStateDelegate(); + + CefSSLHostStateDelegate(const CefSSLHostStateDelegate&) = delete; + CefSSLHostStateDelegate& operator=(const CefSSLHostStateDelegate&) = delete; + ~CefSSLHostStateDelegate() override; // SSLHostStateDelegate methods: @@ -75,8 +79,6 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate { private: // Certificate policies for each host. std::map cert_policy_for_host_; - - DISALLOW_COPY_AND_ASSIGN(CefSSLHostStateDelegate); }; #endif // CEF_LIBCEF_BROWSER_SSL_HOST_STATE_DELEGATE_H_ diff --git a/libcef/browser/ssl_info_impl.h b/libcef/browser/ssl_info_impl.h index f1a912443..2179a0f98 100644 --- a/libcef/browser/ssl_info_impl.h +++ b/libcef/browser/ssl_info_impl.h @@ -15,6 +15,9 @@ class CefSSLInfoImpl : public CefSSLInfo { public: explicit CefSSLInfoImpl(const net::SSLInfo& value); + CefSSLInfoImpl(const CefSSLInfoImpl&) = delete; + CefSSLInfoImpl& operator=(const CefSSLInfoImpl&) = delete; + // CefSSLInfo methods. cef_cert_status_t GetCertStatus() override; CefRefPtr GetX509Certificate() override; @@ -24,7 +27,6 @@ class CefSSLInfoImpl : public CefSSLInfo { CefRefPtr cert_; IMPLEMENT_REFCOUNTING(CefSSLInfoImpl); - DISALLOW_COPY_AND_ASSIGN(CefSSLInfoImpl); }; #endif // CEF_LIBCEF_BROWSER_SSL_INFO_IMPL_H_ diff --git a/libcef/browser/ssl_status_impl.h b/libcef/browser/ssl_status_impl.h index cd07060af..43ef322e6 100644 --- a/libcef/browser/ssl_status_impl.h +++ b/libcef/browser/ssl_status_impl.h @@ -15,6 +15,9 @@ class CefSSLStatusImpl : public CefSSLStatus { public: explicit CefSSLStatusImpl(const content::SSLStatus& value); + CefSSLStatusImpl(const CefSSLStatusImpl&) = delete; + CefSSLStatusImpl& operator=(const CefSSLStatusImpl&) = delete; + // CefSSLStatus methods. bool IsSecureConnection() override; cef_cert_status_t GetCertStatus() override; @@ -32,7 +35,6 @@ class CefSSLStatusImpl : public CefSSLStatus { CefRefPtr cef_certificate_; IMPLEMENT_REFCOUNTING(CefSSLStatusImpl); - DISALLOW_COPY_AND_ASSIGN(CefSSLStatusImpl); }; #endif // CEF_LIBCEF_BROWSER_SSL_STATUS_IMPL_H_ diff --git a/libcef/browser/trace_subscriber.cc b/libcef/browser/trace_subscriber.cc index 243b08bc7..edd0a8519 100644 --- a/libcef/browser/trace_subscriber.cc +++ b/libcef/browser/trace_subscriber.cc @@ -33,6 +33,10 @@ class CefCompletionCallbackWrapper : public CefCompletionCallback { CefRefPtr callback) : callback_(callback) {} + CefCompletionCallbackWrapper(const CefCompletionCallbackWrapper&) = delete; + CefCompletionCallbackWrapper& operator=(const CefCompletionCallbackWrapper&) = + delete; + void OnComplete() override { if (callback_) { callback_->OnComplete(); @@ -44,7 +48,6 @@ class CefCompletionCallbackWrapper : public CefCompletionCallback { CefRefPtr callback_; IMPLEMENT_REFCOUNTING(CefCompletionCallbackWrapper); - DISALLOW_COPY_AND_ASSIGN(CefCompletionCallbackWrapper); }; } // namespace diff --git a/libcef/browser/views/basic_label_button_impl.h b/libcef/browser/views/basic_label_button_impl.h index 2849649d2..8621c71c6 100644 --- a/libcef/browser/views/basic_label_button_impl.h +++ b/libcef/browser/views/basic_label_button_impl.h @@ -17,10 +17,11 @@ class CefBasicLabelButtonImpl : public CefLabelButtonImpl { public: - typedef CefLabelButtonImpl - ParentClass; + using ParentClass = + CefLabelButtonImpl; + + CefBasicLabelButtonImpl(const CefBasicLabelButtonImpl&) = delete; + CefBasicLabelButtonImpl& operator=(const CefBasicLabelButtonImpl&) = delete; // Create a new CefLabelButton instance. |delegate| may be nullptr. static CefRefPtr Create( @@ -41,7 +42,6 @@ class CefBasicLabelButtonImpl : public CefLabelButtonImpl { public: - typedef CefLabelButtonView ParentClass; + using ParentClass = CefLabelButtonView; // |cef_delegate| may be nullptr. explicit CefBasicLabelButtonView(CefButtonDelegate* cef_delegate); - private: - DISALLOW_COPY_AND_ASSIGN(CefBasicLabelButtonView); + CefBasicLabelButtonView(const CefBasicLabelButtonView&) = delete; + CefBasicLabelButtonView& operator=(const CefBasicLabelButtonView&) = delete; }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BASIC_LABEL_BUTTON_VIEW_H_ diff --git a/libcef/browser/views/basic_panel_impl.h b/libcef/browser/views/basic_panel_impl.h index 209be5e0f..06ffb7ee4 100644 --- a/libcef/browser/views/basic_panel_impl.h +++ b/libcef/browser/views/basic_panel_impl.h @@ -16,7 +16,10 @@ class CefBasicPanelImpl : public CefPanelImpl { public: - typedef CefPanelImpl ParentClass; + using ParentClass = CefPanelImpl; + + CefBasicPanelImpl(const CefBasicPanelImpl&) = delete; + CefBasicPanelImpl& operator=(const CefBasicPanelImpl&) = delete; // Create a new CefPanel instance. |delegate| may be nullptr. static CefRefPtr Create( @@ -36,7 +39,6 @@ class CefBasicPanelImpl void InitializeRootView() override; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefBasicPanelImpl); - DISALLOW_COPY_AND_ASSIGN(CefBasicPanelImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BASIC_PANEL_IMPL_H_ diff --git a/libcef/browser/views/basic_panel_view.h b/libcef/browser/views/basic_panel_view.h index 477573dab..659b7cb18 100644 --- a/libcef/browser/views/basic_panel_view.h +++ b/libcef/browser/views/basic_panel_view.h @@ -12,13 +12,13 @@ class CefBasicPanelView : public CefPanelView { public: - typedef CefPanelView ParentClass; + using ParentClass = CefPanelView; // |cef_delegate| may be nullptr. explicit CefBasicPanelView(CefPanelDelegate* cef_delegate); - private: - DISALLOW_COPY_AND_ASSIGN(CefBasicPanelView); + CefBasicPanelView(const CefBasicPanelView&) = delete; + CefBasicPanelView& operator=(const CefBasicPanelView&) = delete; }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BASIC_PANEL_VIEW_H_ diff --git a/libcef/browser/views/box_layout_impl.h b/libcef/browser/views/box_layout_impl.h index c1c4d9c5f..a6ae5f1ce 100644 --- a/libcef/browser/views/box_layout_impl.h +++ b/libcef/browser/views/box_layout_impl.h @@ -14,7 +14,10 @@ class CefBoxLayoutImpl : public CefLayoutImpl { public: // Necessary for the CEF_REQUIRE_VALID_*() macros to compile. - typedef CefLayoutImpl ParentClass; + using ParentClass = CefLayoutImpl; + + CefBoxLayoutImpl(const CefBoxLayoutImpl&) = delete; + CefBoxLayoutImpl& operator=(const CefBoxLayoutImpl&) = delete; // Create a new CefBoxLayout insance. |owner_view| must be non-nullptr. static CefRefPtr Create( @@ -36,7 +39,6 @@ class CefBoxLayoutImpl : public CefLayoutImpl { CefBoxLayoutSettings settings_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefBoxLayoutImpl); - DISALLOW_COPY_AND_ASSIGN(CefBoxLayoutImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BOX_LAYOUT_IMPL_H_ diff --git a/libcef/browser/views/browser_platform_delegate_views.cc b/libcef/browser/views/browser_platform_delegate_views.cc index 6a9e30922..82f20cc03 100644 --- a/libcef/browser/views/browser_platform_delegate_views.cc +++ b/libcef/browser/views/browser_platform_delegate_views.cc @@ -23,6 +23,9 @@ class PopupWindowDelegate : public CefWindowDelegate { explicit PopupWindowDelegate(CefRefPtr browser_view) : browser_view_(browser_view) {} + PopupWindowDelegate(const PopupWindowDelegate&) = delete; + PopupWindowDelegate& operator=(const PopupWindowDelegate&) = delete; + void OnWindowCreated(CefRefPtr window) override { window->AddChildView(browser_view_); window->Show(); @@ -44,7 +47,6 @@ class PopupWindowDelegate : public CefWindowDelegate { CefRefPtr browser_view_; IMPLEMENT_REFCOUNTING(PopupWindowDelegate); - DISALLOW_COPY_AND_ASSIGN(PopupWindowDelegate); }; } // namespace diff --git a/libcef/browser/views/browser_view_impl.h b/libcef/browser/views/browser_view_impl.h index d01a6e153..98c071bce 100644 --- a/libcef/browser/views/browser_view_impl.h +++ b/libcef/browser/views/browser_view_impl.h @@ -23,8 +23,11 @@ class CefBrowserViewImpl : public CefViewImpl, public CefBrowserViewView::Delegate { public: - typedef CefViewImpl - ParentClass; + using ParentClass = + CefViewImpl; + + CefBrowserViewImpl(const CefBrowserViewImpl&) = delete; + CefBrowserViewImpl& operator=(const CefBrowserViewImpl&) = delete; // Create a new CefBrowserView instance. |delegate| may be nullptr. static CefRefPtr Create( @@ -113,7 +116,6 @@ class CefBrowserViewImpl base::WeakPtrFactory weak_ptr_factory_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefBrowserViewImpl); - DISALLOW_COPY_AND_ASSIGN(CefBrowserViewImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BROWSER_VIEW_IMPL_H_ diff --git a/libcef/browser/views/browser_view_view.h b/libcef/browser/views/browser_view_view.h index 7a50d8afb..955bd709e 100644 --- a/libcef/browser/views/browser_view_view.h +++ b/libcef/browser/views/browser_view_view.h @@ -22,7 +22,10 @@ class WebViewEx : public views::WebView { class CefBrowserViewView : public CefViewView { public: - typedef CefViewView ParentClass; + using ParentClass = CefViewView; + + CefBrowserViewView(const CefBrowserViewView&) = delete; + CefBrowserViewView& operator=(const CefBrowserViewView&) = delete; class Delegate { public: @@ -49,8 +52,6 @@ class CefBrowserViewView private: // Not owned by this object. Delegate* browser_view_delegate_; - - DISALLOW_COPY_AND_ASSIGN(CefBrowserViewView); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_BROWSER_VIEW_VIEW_H_ diff --git a/libcef/browser/views/button_impl.h b/libcef/browser/views/button_impl.h index 4ff9b0ec4..247b11be6 100644 --- a/libcef/browser/views/button_impl.h +++ b/libcef/browser/views/button_impl.h @@ -25,7 +25,7 @@ // view_impl.h for a usage overview. CEF_BUTTON_IMPL_T class CefButtonImpl : public CEF_VIEW_IMPL_D { public: - typedef CEF_VIEW_IMPL_D ParentClass; + using ParentClass = CEF_VIEW_IMPL_D; // CefButton methods. When adding new As*() methods make sure to update // CefViewAdapter::GetFor() in view_adapter.cc. diff --git a/libcef/browser/views/button_view.h b/libcef/browser/views/button_view.h index 1d4f76c2d..eecaf53e4 100644 --- a/libcef/browser/views/button_view.h +++ b/libcef/browser/views/button_view.h @@ -26,7 +26,7 @@ // basic_label_button_view.h). See comments in view_impl.h for a usage overview. CEF_BUTTON_VIEW_T class CefButtonView : public CEF_VIEW_VIEW_D { public: - typedef CEF_VIEW_VIEW_D ParentClass; + using ParentClass = CEF_VIEW_VIEW_D; // |cef_delegate| may be nullptr. template diff --git a/libcef/browser/views/display_impl.cc b/libcef/browser/views/display_impl.cc index 4f6d7234f..f174c2ed1 100644 --- a/libcef/browser/views/display_impl.cc +++ b/libcef/browser/views/display_impl.cc @@ -45,7 +45,7 @@ void CefDisplay::GetAllDisplays(std::vector>& displays) { displays.clear(); - typedef std::vector DisplayVector; + using DisplayVector = std::vector; DisplayVector vec = display::Screen::GetScreen()->GetAllDisplays(); for (size_t i = 0; i < vec.size(); ++i) displays.push_back(new CefDisplayImpl(vec[i])); diff --git a/libcef/browser/views/display_impl.h b/libcef/browser/views/display_impl.h index 79562e354..41fce2c0f 100644 --- a/libcef/browser/views/display_impl.h +++ b/libcef/browser/views/display_impl.h @@ -14,6 +14,10 @@ class CefDisplayImpl : public CefDisplay { public: explicit CefDisplayImpl(const display::Display& display); + + CefDisplayImpl(const CefDisplayImpl&) = delete; + CefDisplayImpl& operator=(const CefDisplayImpl&) = delete; + ~CefDisplayImpl() override; // CefDisplay methods: @@ -31,7 +35,6 @@ class CefDisplayImpl : public CefDisplay { display::Display display_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDisplayImpl); - DISALLOW_COPY_AND_ASSIGN(CefDisplayImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_DISPLAY_IMPL_H_ diff --git a/libcef/browser/views/fill_layout_impl.h b/libcef/browser/views/fill_layout_impl.h index e4b28a29c..f0757677d 100644 --- a/libcef/browser/views/fill_layout_impl.h +++ b/libcef/browser/views/fill_layout_impl.h @@ -14,6 +14,9 @@ class CefFillLayoutImpl : public CefLayoutImpl { public: + CefFillLayoutImpl(const CefFillLayoutImpl&) = delete; + CefFillLayoutImpl& operator=(const CefFillLayoutImpl&) = delete; + // Create a new CefFillLayout insance. |owner_view| must be non-nullptr. static CefRefPtr Create(views::View* owner_view); @@ -26,7 +29,6 @@ class CefFillLayoutImpl views::FillLayout* CreateLayout() override; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefFillLayoutImpl); - DISALLOW_COPY_AND_ASSIGN(CefFillLayoutImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_FILL_LAYOUT_IMPL_H_ diff --git a/libcef/browser/views/label_button_impl.h b/libcef/browser/views/label_button_impl.h index 98dc9d8aa..a0b3197ff 100644 --- a/libcef/browser/views/label_button_impl.h +++ b/libcef/browser/views/label_button_impl.h @@ -25,7 +25,7 @@ // view_impl.h for a usage overview. CEF_LABEL_BUTTON_IMPL_T class CefLabelButtonImpl : public CEF_BUTTON_IMPL_D { public: - typedef CEF_BUTTON_IMPL_D ParentClass; + using ParentClass = CEF_BUTTON_IMPL_D; // CefLabelButton methods. When adding new As*() methods make sure to update // CefViewAdapter::GetFor() in view_adapter.cc. diff --git a/libcef/browser/views/label_button_view.h b/libcef/browser/views/label_button_view.h index db0738b97..a628dfd8b 100644 --- a/libcef/browser/views/label_button_view.h +++ b/libcef/browser/views/label_button_view.h @@ -22,7 +22,7 @@ // view_impl.h for a usage overview. CEF_LABEL_BUTTON_VIEW_T class CefLabelButtonView : public CEF_BUTTON_VIEW_D { public: - typedef CEF_BUTTON_VIEW_D ParentClass; + using ParentClass = CEF_BUTTON_VIEW_D; // |cef_delegate| may be nullptr. template diff --git a/libcef/browser/views/menu_button_impl.h b/libcef/browser/views/menu_button_impl.h index 682cddb48..26bb14ff9 100644 --- a/libcef/browser/views/menu_button_impl.h +++ b/libcef/browser/views/menu_button_impl.h @@ -18,10 +18,12 @@ class CefMenuButtonImpl : public CefLabelButtonImpl { public: - typedef CefLabelButtonImpl - ParentClass; + using ParentClass = CefLabelButtonImpl; + + CefMenuButtonImpl(const CefMenuButtonImpl&) = delete; + CefMenuButtonImpl& operator=(const CefMenuButtonImpl&) = delete; // Create a new CefMenuButton instance. |delegate| must not be nullptr. static CefRefPtr Create( @@ -54,7 +56,6 @@ class CefMenuButtonImpl : public CefLabelButtonImplbutton_controller()) {} + ButtonPressedLock(const ButtonPressedLock&) = delete; + ButtonPressedLock& operator=(const ButtonPressedLock&) = delete; + private: views::MenuButtonController::PressedLock pressed_lock_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(ButtonPressedLock); - DISALLOW_COPY_AND_ASSIGN(ButtonPressedLock); }; } // namespace diff --git a/libcef/browser/views/menu_button_view.h b/libcef/browser/views/menu_button_view.h index 27ca24e4a..e5c94d721 100644 --- a/libcef/browser/views/menu_button_view.h +++ b/libcef/browser/views/menu_button_view.h @@ -31,11 +31,14 @@ class MenuButtonEx : public views::MenuButton { class CefMenuButtonView : public CefLabelButtonView { public: - typedef CefLabelButtonView ParentClass; + using ParentClass = CefLabelButtonView; // |cef_delegate| must not be nullptr. explicit CefMenuButtonView(CefMenuButtonDelegate* cef_delegate); + CefMenuButtonView(const CefMenuButtonView&) = delete; + CefMenuButtonView& operator=(const CefMenuButtonView&) = delete; + void Initialize() override; // Returns the CefMenuButton associated with this view. See comments on @@ -47,9 +50,6 @@ class CefMenuButtonView // MenuButtonEx methods: void ButtonPressed(const ui::Event& event) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefMenuButtonView); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_MENU_BUTTON_VIEW_H_ diff --git a/libcef/browser/views/overlay_view_host.cc b/libcef/browser/views/overlay_view_host.cc index e7c862093..000e21b8e 100644 --- a/libcef/browser/views/overlay_view_host.cc +++ b/libcef/browser/views/overlay_view_host.cc @@ -26,6 +26,9 @@ class CefOverlayControllerImpl : public CefOverlayController { CefOverlayControllerImpl(CefOverlayViewHost* host, CefRefPtr view) : host_(host), view_(view) {} + CefOverlayControllerImpl(const CefOverlayControllerImpl&) = delete; + CefOverlayControllerImpl& operator=(const CefOverlayControllerImpl&) = delete; + bool IsValid() override { // View validity implies that CefOverlayViewHost is still valid, because the // Widget that it owns (and that owns the View) is still valid. @@ -161,7 +164,6 @@ class CefOverlayControllerImpl : public CefOverlayController { CefRefPtr view_; IMPLEMENT_REFCOUNTING(CefOverlayControllerImpl); - DISALLOW_COPY_AND_ASSIGN(CefOverlayControllerImpl); }; } // namespace diff --git a/libcef/browser/views/overlay_view_host.h b/libcef/browser/views/overlay_view_host.h index 6946c26d7..9ba3231cc 100644 --- a/libcef/browser/views/overlay_view_host.h +++ b/libcef/browser/views/overlay_view_host.h @@ -12,7 +12,6 @@ #include "include/views/cef_view.h" #include "base/compiler_specific.h" -#include "base/macros.h" #include "ui/views/view_observer.h" #include "ui/views/widget/widget_delegate.h" @@ -27,6 +26,9 @@ class CefOverlayViewHost : public views::WidgetDelegate, CefOverlayViewHost(CefWindowView* window_view, cef_docking_mode_t docking_mode); + CefOverlayViewHost(const CefOverlayViewHost&) = delete; + CefOverlayViewHost& operator=(const CefOverlayViewHost&) = delete; + // Initializes the CefOverlayViewHost. This creates the Widget that |view| // paints into. |host_view| is the view whose position in the |window_view_| // view hierarchy determines the z-order of the widget relative to views with @@ -72,8 +74,6 @@ class CefOverlayViewHost : public views::WidgetDelegate, bool bounds_changing_ = false; CefInsets insets_; - - DISALLOW_COPY_AND_ASSIGN(CefOverlayViewHost); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_OVERLAY_VIEW_HOST_H_ diff --git a/libcef/browser/views/panel_impl.h b/libcef/browser/views/panel_impl.h index c8b11003b..3a23a897c 100644 --- a/libcef/browser/views/panel_impl.h +++ b/libcef/browser/views/panel_impl.h @@ -27,7 +27,7 @@ // view_impl.h for a usage overview. CEF_PANEL_IMPL_T class CefPanelImpl : public CEF_VIEW_IMPL_D { public: - typedef CEF_VIEW_IMPL_D ParentClass; + using ParentClass = CEF_VIEW_IMPL_D; // CefPanel methods. When adding new As*() methods make sure to update // CefViewAdapter::GetFor() in view_adapter.cc. diff --git a/libcef/browser/views/panel_view.h b/libcef/browser/views/panel_view.h index ebbab9936..ef6d0e229 100644 --- a/libcef/browser/views/panel_view.h +++ b/libcef/browser/views/panel_view.h @@ -23,7 +23,7 @@ // view_impl.h for a usage overview. CEF_PANEL_VIEW_T class CefPanelView : public CEF_VIEW_VIEW_D { public: - typedef CEF_VIEW_VIEW_D ParentClass; + using ParentClass = CEF_VIEW_VIEW_D; // |cef_delegate| may be nullptr. template diff --git a/libcef/browser/views/scroll_view_impl.h b/libcef/browser/views/scroll_view_impl.h index ca2769004..fd5a7c389 100644 --- a/libcef/browser/views/scroll_view_impl.h +++ b/libcef/browser/views/scroll_view_impl.h @@ -15,8 +15,11 @@ class CefScrollViewImpl : public CefViewImpl { public: - typedef CefViewImpl - ParentClass; + using ParentClass = + CefViewImpl; + + CefScrollViewImpl(const CefScrollViewImpl&) = delete; + CefScrollViewImpl& operator=(const CefScrollViewImpl&) = delete; // Create a new CefScrollView instance. |delegate| may be nullptr. static CefRefPtr Create( @@ -48,7 +51,6 @@ class CefScrollViewImpl void InitializeRootView() override; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefScrollViewImpl); - DISALLOW_COPY_AND_ASSIGN(CefScrollViewImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_ diff --git a/libcef/browser/views/scroll_view_view.h b/libcef/browser/views/scroll_view_view.h index 62a7c4be3..89d7e5d57 100644 --- a/libcef/browser/views/scroll_view_view.h +++ b/libcef/browser/views/scroll_view_view.h @@ -15,13 +15,13 @@ class CefScrollViewView : public CefViewView { public: - typedef CefViewView ParentClass; + using ParentClass = CefViewView; // |cef_delegate| may be nullptr. explicit CefScrollViewView(CefViewDelegate* cef_delegate); - private: - DISALLOW_COPY_AND_ASSIGN(CefScrollViewView); + CefScrollViewView(const CefScrollViewView&) = delete; + CefScrollViewView& operator=(const CefScrollViewView&) = delete; }; #endif // CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_VIEW_H_ diff --git a/libcef/browser/views/textfield_impl.h b/libcef/browser/views/textfield_impl.h index a0c8a9905..8a5ac406e 100644 --- a/libcef/browser/views/textfield_impl.h +++ b/libcef/browser/views/textfield_impl.h @@ -15,8 +15,11 @@ class CefTextfieldImpl : public CefViewImpl { public: - typedef CefViewImpl - ParentClass; + using ParentClass = + CefViewImpl; + + CefTextfieldImpl(const CefTextfieldImpl&) = delete; + CefTextfieldImpl& operator=(const CefTextfieldImpl&) = delete; // Create a new CefTextfield instance. |delegate| may be nullptr. static CefRefPtr Create( @@ -76,7 +79,6 @@ class CefTextfieldImpl void InitializeRootView() override; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefTextfieldImpl); - DISALLOW_COPY_AND_ASSIGN(CefTextfieldImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_TEXTFIELD_IMPL_H_ diff --git a/libcef/browser/views/textfield_view.h b/libcef/browser/views/textfield_view.h index b97187b23..f4e4f5ee4 100644 --- a/libcef/browser/views/textfield_view.h +++ b/libcef/browser/views/textfield_view.h @@ -18,11 +18,14 @@ class CefTextfieldView : public CefViewView, public views::TextfieldController { public: - typedef CefViewView ParentClass; + using ParentClass = CefViewView; // |cef_delegate| may be nullptr. explicit CefTextfieldView(CefTextfieldDelegate* cef_delegate); + CefTextfieldView(const CefTextfieldView&) = delete; + CefTextfieldView& operator=(const CefTextfieldView&) = delete; + void Initialize() override; // Returns the CefTextfield associated with this view. See comments on @@ -37,9 +40,6 @@ class CefTextfieldView bool HandleKeyEvent(views::Textfield* sender, const ui::KeyEvent& key_event) override; void OnAfterUserAction(views::Textfield* sender) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefTextfieldView); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_TEXTFIELD_VIEW_H_ diff --git a/libcef/browser/views/view_impl.h b/libcef/browser/views/view_impl.h index ef66a8527..173736e73 100644 --- a/libcef/browser/views/view_impl.h +++ b/libcef/browser/views/view_impl.h @@ -314,7 +314,7 @@ CEF_VIEW_IMPL_T class CefViewImpl : public CefViewAdapter, public CefViewClass { public: // Necessary for the CEF_REQUIRE_VALID_*() macros to compile. - typedef CEF_VIEW_IMPL_D ParentClass; + using ParentClass = CEF_VIEW_IMPL_D; // Returns the content views::View object that should be the target of most // customization actions. May be the root view or a child of the root view. diff --git a/libcef/browser/views/view_view.h b/libcef/browser/views/view_view.h index 6215c85df..1e2fbd0e6 100644 --- a/libcef/browser/views/view_view.h +++ b/libcef/browser/views/view_view.h @@ -29,7 +29,7 @@ // in view_impl.h for a usage overview. CEF_VIEW_VIEW_T class CefViewView : public ViewsViewClass { public: - typedef ViewsViewClass ParentClass; + using ParentClass = ViewsViewClass; // Should be created from CreateRootView() in a CefViewImpl-derived class. // Do not call complex views::View-derived methods from a CefViewView-derived diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc index 449b2aea5..cba9fcc2f 100644 --- a/libcef/browser/views/window_impl.cc +++ b/libcef/browser/views/window_impl.cc @@ -83,6 +83,10 @@ class CefUnhandledKeyEventHandler : public ui::EventHandler { window_->AddPostTargetHandler(this); } + CefUnhandledKeyEventHandler(const CefUnhandledKeyEventHandler&) = delete; + CefUnhandledKeyEventHandler& operator=(const CefUnhandledKeyEventHandler&) = + delete; + ~CefUnhandledKeyEventHandler() override { window_->RemovePostTargetHandler(this); } @@ -112,8 +116,6 @@ class CefUnhandledKeyEventHandler : public ui::EventHandler { // |window_| is the event target that is associated with this class. aura::Window* window_; - - DISALLOW_COPY_AND_ASSIGN(CefUnhandledKeyEventHandler); }; #endif // defined(USE_AURA) diff --git a/libcef/browser/views/window_impl.h b/libcef/browser/views/window_impl.h index 755fd18ef..092fa6204 100644 --- a/libcef/browser/views/window_impl.h +++ b/libcef/browser/views/window_impl.h @@ -28,7 +28,10 @@ class CefWindowImpl public CefWindowView::Delegate, public ui::AcceleratorTarget { public: - typedef CefPanelImpl ParentClass; + using ParentClass = CefPanelImpl; + + CefWindowImpl(const CefWindowImpl&) = delete; + CefWindowImpl& operator=(const CefWindowImpl&) = delete; // Create a new CefWindow instance. |delegate| may be nullptr. static CefRefPtr Create(CefRefPtr delegate); @@ -150,7 +153,7 @@ class CefWindowImpl std::unique_ptr menu_runner_; // Map of command_id to accelerator. - typedef std::map AcceleratorMap; + using AcceleratorMap = std::map; AcceleratorMap accelerator_map_; #if defined(USE_AURA) @@ -159,7 +162,6 @@ class CefWindowImpl #endif IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefWindowImpl); - DISALLOW_COPY_AND_ASSIGN(CefWindowImpl); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_WINDOW_IMPL_H_ diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 1d1b7418b..fba6fbee2 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -39,6 +39,9 @@ class ClientViewEx : public views::ClientView { DCHECK(window_delegate_); } + ClientViewEx(const ClientViewEx&) = delete; + ClientViewEx& operator=(const ClientViewEx&) = delete; + views::CloseRequestResult OnWindowCloseRequested() override { return window_delegate_->CanWidgetClose() ? views::CloseRequestResult::kCanClose @@ -47,8 +50,6 @@ class ClientViewEx : public views::ClientView { private: CefWindowView::Delegate* window_delegate_; // Not owned by this object. - - DISALLOW_COPY_AND_ASSIGN(ClientViewEx); }; // Extend NativeFrameView with draggable region handling. @@ -57,6 +58,9 @@ class NativeFrameViewEx : public views::NativeFrameView { NativeFrameViewEx(views::Widget* widget, CefWindowView* view) : views::NativeFrameView(widget), widget_(widget), view_(view) {} + NativeFrameViewEx(const NativeFrameViewEx&) = delete; + NativeFrameViewEx& operator=(const NativeFrameViewEx&) = delete; + gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const override { #if defined(OS_WIN) @@ -93,8 +97,6 @@ class NativeFrameViewEx : public views::NativeFrameView { // Not owned by this object. views::Widget* widget_; CefWindowView* view_; - - DISALLOW_COPY_AND_ASSIGN(NativeFrameViewEx); }; // The area inside the frame border that can be clicked and dragged for resizing @@ -112,6 +114,9 @@ class CaptionlessFrameView : public views::NonClientFrameView { CaptionlessFrameView(views::Widget* widget, CefWindowView* view) : widget_(widget), view_(view) {} + CaptionlessFrameView(const CaptionlessFrameView&) = delete; + CaptionlessFrameView& operator=(const CaptionlessFrameView&) = delete; + gfx::Rect GetBoundsForClientView() const override { return client_view_bounds_; } @@ -222,8 +227,6 @@ class CaptionlessFrameView : public views::NonClientFrameView { // The bounds of the client view, in this view's coordinates. gfx::Rect client_view_bounds_; - - DISALLOW_COPY_AND_ASSIGN(CaptionlessFrameView); }; bool IsWindowBorderHit(int code) { diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index 2f551b4b4..cbaaab6cc 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -25,8 +25,8 @@ class CefWindowView : public CefPanelView, public views::WidgetObserver { public: - typedef CefPanelView - ParentClass; + using ParentClass = + CefPanelView; class Delegate { public: @@ -47,6 +47,9 @@ class CefWindowView // |window_delegate| must be non-nullptr. CefWindowView(CefWindowDelegate* cef_delegate, Delegate* window_delegate); + CefWindowView(const CefWindowView&) = delete; + CefWindowView& operator=(const CefWindowView&) = delete; + // Create the Widget. void CreateWidget(); @@ -129,8 +132,6 @@ class CefWindowView // Hosts for overlay widgets. std::vector> overlay_hosts_; - - DISALLOW_COPY_AND_ASSIGN(CefWindowView); }; #endif // CEF_LIBCEF_BROWSER_VIEWS_WINDOW_VIEW_H_ diff --git a/libcef/browser/x509_cert_principal_impl.h b/libcef/browser/x509_cert_principal_impl.h index 20b409e4f..59f9fb8e9 100644 --- a/libcef/browser/x509_cert_principal_impl.h +++ b/libcef/browser/x509_cert_principal_impl.h @@ -15,6 +15,9 @@ class CefX509CertPrincipalImpl : public CefX509CertPrincipal { public: explicit CefX509CertPrincipalImpl(const net::CertPrincipal& value); + CefX509CertPrincipalImpl(const CefX509CertPrincipalImpl&) = delete; + CefX509CertPrincipalImpl& operator=(const CefX509CertPrincipalImpl&) = delete; + // CefX509CertPrincipal methods. CefString GetDisplayName() override; CefString GetCommonName() override; @@ -30,7 +33,6 @@ class CefX509CertPrincipalImpl : public CefX509CertPrincipal { net::CertPrincipal value_; IMPLEMENT_REFCOUNTING(CefX509CertPrincipalImpl); - DISALLOW_COPY_AND_ASSIGN(CefX509CertPrincipalImpl); }; #endif // CEF_LIBCEF_BROWSER_X509_CERT_PRINCIPAL_IMPL_H_ diff --git a/libcef/browser/x509_certificate_impl.h b/libcef/browser/x509_certificate_impl.h index f5c22250f..1685a8b2a 100644 --- a/libcef/browser/x509_certificate_impl.h +++ b/libcef/browser/x509_certificate_impl.h @@ -17,6 +17,9 @@ class CefX509CertificateImpl : public CefX509Certificate { public: explicit CefX509CertificateImpl(scoped_refptr cert); + CefX509CertificateImpl(const CefX509CertificateImpl&) = delete; + CefX509CertificateImpl& operator=(const CefX509CertificateImpl&) = delete; + // Used with AlloyContentBrowserClient::SelectClientCertificate only. explicit CefX509CertificateImpl( std::unique_ptr identity); @@ -47,7 +50,6 @@ class CefX509CertificateImpl : public CefX509Certificate { IssuerChainBinaryList der_encoded_issuer_chain_; IMPLEMENT_REFCOUNTING(CefX509CertificateImpl); - DISALLOW_COPY_AND_ASSIGN(CefX509CertificateImpl); }; #endif // CEF_LIBCEF_BROWSER_X509_CERTIFICATE_IMPL_H_ diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index 8be3d2bf3..1cbf23dd2 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -17,6 +17,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/files/file_util.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" diff --git a/libcef/common/alloy/alloy_main_delegate.h b/libcef/common/alloy/alloy_main_delegate.h index f12438154..32e6cea04 100644 --- a/libcef/common/alloy/alloy_main_delegate.h +++ b/libcef/common/alloy/alloy_main_delegate.h @@ -36,6 +36,10 @@ class AlloyMainDelegate : public content::ContentMainDelegate, AlloyMainDelegate(CefMainRunnerHandler* runner, CefSettings* settings, CefRefPtr application); + + AlloyMainDelegate(const AlloyMainDelegate&) = delete; + AlloyMainDelegate& operator=(const AlloyMainDelegate&) = delete; + ~AlloyMainDelegate() override; // content::ContentMainDelegate overrides. @@ -88,8 +92,6 @@ class AlloyMainDelegate : public content::ContentMainDelegate, AlloyContentClient content_client_; CefResourceBundleDelegate resource_bundle_delegate_; - - DISALLOW_COPY_AND_ASSIGN(AlloyMainDelegate); }; #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_DELEGATE_H_ diff --git a/libcef/common/alloy/alloy_main_runner_delegate.h b/libcef/common/alloy/alloy_main_runner_delegate.h index d78c289b7..0b774647c 100644 --- a/libcef/common/alloy/alloy_main_runner_delegate.h +++ b/libcef/common/alloy/alloy_main_runner_delegate.h @@ -21,6 +21,10 @@ class AlloyMainRunnerDelegate : public CefMainRunnerDelegate { AlloyMainRunnerDelegate(CefMainRunnerHandler* runner, CefSettings* settings, CefRefPtr application); + + AlloyMainRunnerDelegate(const AlloyMainRunnerDelegate&) = delete; + AlloyMainRunnerDelegate& operator=(const AlloyMainRunnerDelegate&) = delete; + ~AlloyMainRunnerDelegate() override; protected: @@ -39,8 +43,6 @@ class AlloyMainRunnerDelegate : public CefMainRunnerDelegate { CefMainRunnerHandler* const runner_; CefSettings* const settings_; CefRefPtr application_; - - DISALLOW_COPY_AND_ASSIGN(AlloyMainRunnerDelegate); }; #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_MAIN_RUNNER_DELEGATE_ diff --git a/libcef/common/app_manager.h b/libcef/common/app_manager.h index d78c39516..9d3323de0 100644 --- a/libcef/common/app_manager.h +++ b/libcef/common/app_manager.h @@ -12,7 +12,6 @@ #include "include/cef_request_context.h" #include "base/callback.h" -#include "base/macros.h" #include "build/build_config.h" #include "content/public/common/content_client.h" @@ -22,6 +21,9 @@ struct CefSchemeInfo; // Exposes global application state in the main and render processes. class CefAppManager { public: + CefAppManager(const CefAppManager&) = delete; + CefAppManager& operator=(const CefAppManager&) = delete; + // Returns the singleton instance that is scoped to CEF lifespan. static CefAppManager* Get(); @@ -65,8 +67,6 @@ class CefAppManager { // Custom schemes handled by the client. SchemeInfoList scheme_info_list_; bool scheme_info_list_locked_ = false; - - DISALLOW_COPY_AND_ASSIGN(CefAppManager); }; #endif // CEF_LIBCEF_COMMON_APP_MANAGER_H_ diff --git a/libcef/common/cef_crash_report_upload_thread.h b/libcef/common/cef_crash_report_upload_thread.h index 00913c5a5..4ebda8cb0 100644 --- a/libcef/common/cef_crash_report_upload_thread.h +++ b/libcef/common/cef_crash_report_upload_thread.h @@ -5,7 +5,6 @@ #ifndef CEF_LIBCEF_COMMON_CEF_CRASH_REPORT_UPLOAD_THREAD_H_ #define CEF_LIBCEF_COMMON_CEF_CRASH_REPORT_UPLOAD_THREAD_H_ -#include "base/macros.h" #include "third_party/crashpad/crashpad/handler/crash_report_upload_thread.h" class CefCrashReportUploadThread : public crashpad::CrashReportUploadThread { @@ -14,6 +13,11 @@ class CefCrashReportUploadThread : public crashpad::CrashReportUploadThread { const std::string& url, const Options& options, int max_uploads); + + CefCrashReportUploadThread(const CefCrashReportUploadThread&) = delete; + CefCrashReportUploadThread& operator=(const CefCrashReportUploadThread&) = + delete; + ~CefCrashReportUploadThread(); private: @@ -37,8 +41,6 @@ class CefCrashReportUploadThread : public crashpad::CrashReportUploadThread { // Only used when RateLimitEnabled() is true. Value is reset each time // ProcessPendingReports() is called. int recent_upload_ct_ = 0; - - DISALLOW_COPY_AND_ASSIGN(CefCrashReportUploadThread); }; #endif // CEF_LIBCEF_COMMON_CEF_CRASH_REPORT_UPLOAD_THREAD_H_ diff --git a/libcef/common/chrome/chrome_main_delegate_cef.cc b/libcef/common/chrome/chrome_main_delegate_cef.cc index 17a9aba81..8b6c407d4 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.cc +++ b/libcef/common/chrome/chrome_main_delegate_cef.cc @@ -15,6 +15,7 @@ #include "base/command_line.h" #include "base/lazy_instance.h" +#include "base/macros.h" #include "chrome/common/chrome_switches.h" #include "components/embedder_support/switches.h" #include "content/public/common/content_switches.h" diff --git a/libcef/common/chrome/chrome_main_delegate_cef.h b/libcef/common/chrome/chrome_main_delegate_cef.h index b62d81098..ef209de37 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.h +++ b/libcef/common/chrome/chrome_main_delegate_cef.h @@ -14,7 +14,6 @@ #include "libcef/common/main_runner_handler.h" #include "libcef/common/task_runner_manager.h" -#include "base/macros.h" #include "chrome/app/chrome_main_delegate.h" class ChromeContentBrowserClientCef; @@ -30,6 +29,10 @@ class ChromeMainDelegateCef : public ChromeMainDelegate, ChromeMainDelegateCef(CefMainRunnerHandler* runner, CefSettings* settings, CefRefPtr application); + + ChromeMainDelegateCef(const ChromeMainDelegateCef&) = delete; + ChromeMainDelegateCef& operator=(const ChromeMainDelegateCef&) = delete; + ~ChromeMainDelegateCef() override; // ChromeMainDelegate overrides. @@ -77,8 +80,6 @@ class ChromeMainDelegateCef : public ChromeMainDelegate, // We use this instead of ChromeMainDelegate::chrome_content_client_. ChromeContentClientCef chrome_content_client_cef_; - - DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegateCef); }; #endif // CEF_LIBCEF_COMMON_CHROME_CHROME_MAIN_DELEGATE_CEF_ diff --git a/libcef/common/chrome/chrome_main_runner_delegate.h b/libcef/common/chrome/chrome_main_runner_delegate.h index ac062c971..06b09c9d9 100644 --- a/libcef/common/chrome/chrome_main_runner_delegate.h +++ b/libcef/common/chrome/chrome_main_runner_delegate.h @@ -23,6 +23,10 @@ class ChromeMainRunnerDelegate : public CefMainRunnerDelegate { ChromeMainRunnerDelegate(CefMainRunnerHandler* runner, CefSettings* settings, CefRefPtr application); + + ChromeMainRunnerDelegate(const ChromeMainRunnerDelegate&) = delete; + ChromeMainRunnerDelegate& operator=(const ChromeMainRunnerDelegate&) = delete; + ~ChromeMainRunnerDelegate() override; protected: @@ -44,8 +48,6 @@ class ChromeMainRunnerDelegate : public CefMainRunnerDelegate { CefMainRunnerHandler* const runner_; CefSettings* const settings_; CefRefPtr application_; - - DISALLOW_COPY_AND_ASSIGN(ChromeMainRunnerDelegate); }; #endif // CEF_LIBCEF_COMMON_CHROME_CHROME_MAIN_RUNNER_DELEGATE_CEF_ diff --git a/libcef/common/command_line_impl.h b/libcef/common/command_line_impl.h index ed4761a11..77181cd93 100644 --- a/libcef/common/command_line_impl.h +++ b/libcef/common/command_line_impl.h @@ -19,6 +19,9 @@ class CefCommandLineImpl bool will_delete, bool read_only); + CefCommandLineImpl(const CefCommandLineImpl&) = delete; + CefCommandLineImpl& operator=(const CefCommandLineImpl&) = delete; + // CefCommandLine methods. bool IsValid() override; bool IsReadOnly() override; @@ -44,8 +47,6 @@ class CefCommandLineImpl // Must hold the controller lock while using this value. const base::CommandLine& command_line() { return const_value(); } - - DISALLOW_COPY_AND_ASSIGN(CefCommandLineImpl); }; #endif // CEF_LIBCEF_COMMON_COMMAND_LINE_IMPL_H_ diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 8e5e1ce03..d7817f829 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -52,10 +52,10 @@ namespace { #if defined(OS_WIN) -typedef std::wstring PathString; +using PathString = std::wstring; const char kPathSep = '\\'; #else -typedef std::string PathString; +using PathString = std::string; #endif PathString GetCrashConfigPath() { diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index 0d0238887..11121e895 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -13,7 +13,6 @@ #include "include/cef_version.h" -#include "base/macros.h" #include "base/strings/string_piece_forward.h" #include "base/synchronization/lock.h" #include "build/build_config.h" @@ -26,6 +25,10 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { public: CefCrashReporterClient(); + + CefCrashReporterClient(const CefCrashReporterClient&) = delete; + CefCrashReporterClient& operator=(const CefCrashReporterClient&) = delete; + ~CefCrashReporterClient() override; // Reads the crash config file and returns true on success. Failure to read @@ -125,8 +128,6 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { #if defined(OS_MAC) bool enable_browser_crash_forwarding_ = false; #endif - - DISALLOW_COPY_AND_ASSIGN(CefCrashReporterClient); }; #endif // CEF_LIBCEF_COMMON_CRASH_REPORTER_CLIENT_H_ diff --git a/libcef/common/extensions/chrome_generated_schemas.cc b/libcef/common/extensions/chrome_generated_schemas.cc index cf7dc8607..c62dad5cd 100644 --- a/libcef/common/extensions/chrome_generated_schemas.cc +++ b/libcef/common/extensions/chrome_generated_schemas.cc @@ -6,7 +6,6 @@ #include "libcef/browser/extensions/chrome_api_registration.h" -#include "base/macros.h" #include "chrome/common/extensions/api/generated_schemas.h" namespace extensions { diff --git a/libcef/common/extensions/extensions_api_provider.h b/libcef/common/extensions/extensions_api_provider.h index 805e18aa5..106b3cc21 100644 --- a/libcef/common/extensions/extensions_api_provider.h +++ b/libcef/common/extensions/extensions_api_provider.h @@ -5,7 +5,6 @@ #ifndef CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_API_PROVIDER_H_ #define CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_API_PROVIDER_H_ -#include "base/macros.h" #include "extensions/common/extensions_api_provider.h" namespace extensions { @@ -14,6 +13,9 @@ class CefExtensionsAPIProvider : public ExtensionsAPIProvider { public: CefExtensionsAPIProvider(); + CefExtensionsAPIProvider(const CefExtensionsAPIProvider&) = delete; + CefExtensionsAPIProvider& operator=(const CefExtensionsAPIProvider&) = delete; + // ExtensionsAPIProvider: void AddAPIFeatures(FeatureProvider* provider) override; void AddManifestFeatures(FeatureProvider* provider) override; @@ -24,9 +26,6 @@ class CefExtensionsAPIProvider : public ExtensionsAPIProvider { base::StringPiece GetAPISchema(const std::string& name) override; void RegisterPermissions(PermissionsInfo* permissions_info) override; void RegisterManifestHandlers() override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefExtensionsAPIProvider); }; } // namespace extensions diff --git a/libcef/common/extensions/extensions_client.h b/libcef/common/extensions/extensions_client.h index 5ab0b190c..ce297e121 100644 --- a/libcef/common/extensions/extensions_client.h +++ b/libcef/common/extensions/extensions_client.h @@ -7,7 +7,6 @@ #define CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_ #include "base/compiler_specific.h" -#include "base/macros.h" #include "chrome/common/extensions/permissions/chrome_permission_message_provider.h" #include "extensions/common/extensions_client.h" #include "url/gurl.h" @@ -18,6 +17,10 @@ namespace extensions { class CefExtensionsClient : public ExtensionsClient { public: CefExtensionsClient(); + + CefExtensionsClient(const CefExtensionsClient&) = delete; + CefExtensionsClient& operator=(const CefExtensionsClient&) = delete; + ~CefExtensionsClient() override; // ExtensionsClient overrides: @@ -47,8 +50,6 @@ class CefExtensionsClient : public ExtensionsClient { // Mutable to allow caching in a const method. const GURL webstore_base_url_; const GURL webstore_update_url_; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionsClient); }; } // namespace extensions diff --git a/libcef/common/net/http_header_utils.h b/libcef/common/net/http_header_utils.h index 50a12370d..45886bca8 100644 --- a/libcef/common/net/http_header_utils.h +++ b/libcef/common/net/http_header_utils.h @@ -13,7 +13,7 @@ namespace HttpHeaderUtils { -typedef std::multimap HeaderMap; +using HeaderMap = std::multimap; std::string GenerateHeaders(const HeaderMap& map); void ParseHeaders(const std::string& header_str, HeaderMap& map); diff --git a/libcef/common/parser_impl.cc b/libcef/common/parser_impl.cc index 8d6db354e..4d860b27d 100644 --- a/libcef/common/parser_impl.cc +++ b/libcef/common/parser_impl.cc @@ -95,7 +95,7 @@ CefString CefGetMimeType(const CefString& extension) { void CefGetExtensionsForMimeType(const CefString& mime_type, std::vector& extensions) { - typedef std::vector VectorType; + using VectorType = std::vector; VectorType ext; net::GetExtensionsForMimeType(mime_type, &ext); VectorType::const_iterator it = ext.begin(); diff --git a/libcef/common/process_message_impl.h b/libcef/common/process_message_impl.h index fc21e20a6..85e9689cd 100644 --- a/libcef/common/process_message_impl.h +++ b/libcef/common/process_message_impl.h @@ -25,6 +25,9 @@ class CefProcessMessageImpl : public CefProcessMessage { base::ListValue arguments, bool read_only); + CefProcessMessageImpl(const CefProcessMessageImpl&) = delete; + CefProcessMessageImpl& operator=(const CefProcessMessageImpl&) = delete; + ~CefProcessMessageImpl() override; // Transfer ownership of the underlying argument list to the caller, or create @@ -45,7 +48,6 @@ class CefProcessMessageImpl : public CefProcessMessage { CefRefPtr arguments_; IMPLEMENT_REFCOUNTING(CefProcessMessageImpl); - DISALLOW_COPY_AND_ASSIGN(CefProcessMessageImpl); }; #endif // CEF_LIBCEF_COMMON_PROCESS_MESSAGE_IMPL_H_ diff --git a/libcef/common/resource_bundle_impl.h b/libcef/common/resource_bundle_impl.h index 0acf603d4..e759dae5b 100644 --- a/libcef/common/resource_bundle_impl.h +++ b/libcef/common/resource_bundle_impl.h @@ -12,6 +12,9 @@ class CefResourceBundleImpl : public CefResourceBundle { public: CefResourceBundleImpl(); + CefResourceBundleImpl(const CefResourceBundleImpl&) = delete; + CefResourceBundleImpl& operator=(const CefResourceBundleImpl&) = delete; + // CefResourceBundle methods. CefString GetLocalizedString(int string_id) override; CefRefPtr GetDataResource(int resource_id) override; @@ -21,7 +24,6 @@ class CefResourceBundleImpl : public CefResourceBundle { private: IMPLEMENT_REFCOUNTING(CefResourceBundleImpl); - DISALLOW_COPY_AND_ASSIGN(CefResourceBundleImpl); }; #endif // CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_IMPL_H_ diff --git a/libcef/common/scheme_registrar_impl.h b/libcef/common/scheme_registrar_impl.h index ed712666c..375b437d5 100644 --- a/libcef/common/scheme_registrar_impl.h +++ b/libcef/common/scheme_registrar_impl.h @@ -17,6 +17,9 @@ class CefSchemeRegistrarImpl : public CefSchemeRegistrar { public: CefSchemeRegistrarImpl(); + CefSchemeRegistrarImpl(const CefSchemeRegistrarImpl&) = delete; + CefSchemeRegistrarImpl& operator=(const CefSchemeRegistrarImpl&) = delete; + // CefSchemeRegistrar methods. bool AddCustomScheme(const CefString& scheme_name, int options) override; @@ -25,8 +28,6 @@ class CefSchemeRegistrarImpl : public CefSchemeRegistrar { private: content::ContentClient::Schemes schemes_; std::set registered_schemes_; - - DISALLOW_COPY_AND_ASSIGN(CefSchemeRegistrarImpl); }; #endif // CEF_LIBCEF_COMMON_SCHEME_REGISTRAR_IMPL_H_ diff --git a/libcef/common/string_list_impl.cc b/libcef/common/string_list_impl.cc index ce2517fac..280085835 100644 --- a/libcef/common/string_list_impl.cc +++ b/libcef/common/string_list_impl.cc @@ -8,7 +8,9 @@ #include "base/logging.h" -typedef std::vector StringList; +namespace { +using StringList = std::vector; +} // namespace CEF_EXPORT cef_string_list_t cef_string_list_alloc() { return new StringList; diff --git a/libcef/common/string_map_impl.cc b/libcef/common/string_map_impl.cc index 16e682f8f..d3e1c3e0c 100644 --- a/libcef/common/string_map_impl.cc +++ b/libcef/common/string_map_impl.cc @@ -8,7 +8,9 @@ #include "base/logging.h" -typedef std::map StringMap; +namespace { +using StringMap = std::map; +} // namespace CEF_EXPORT cef_string_map_t cef_string_map_alloc() { return new StringMap; diff --git a/libcef/common/string_multimap_impl.cc b/libcef/common/string_multimap_impl.cc index e2fe6e00b..dff72a931 100644 --- a/libcef/common/string_multimap_impl.cc +++ b/libcef/common/string_multimap_impl.cc @@ -8,7 +8,9 @@ #include "base/logging.h" -typedef std::multimap StringMultimap; +namespace { +using StringMultimap = std::multimap; +} // namespace CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc() { return new StringMultimap; diff --git a/libcef/common/task_runner_impl.h b/libcef/common/task_runner_impl.h index c2ae318a9..de3d8307f 100644 --- a/libcef/common/task_runner_impl.h +++ b/libcef/common/task_runner_impl.h @@ -15,6 +15,9 @@ class CefTaskRunnerImpl : public CefTaskRunner { explicit CefTaskRunnerImpl( scoped_refptr task_runner); + CefTaskRunnerImpl(const CefTaskRunnerImpl&) = delete; + CefTaskRunnerImpl& operator=(const CefTaskRunnerImpl&) = delete; + // Returns the task runner associated with |threadId|. static scoped_refptr GetTaskRunner( CefThreadId threadId); @@ -32,7 +35,6 @@ class CefTaskRunnerImpl : public CefTaskRunner { scoped_refptr task_runner_; IMPLEMENT_REFCOUNTING(CefTaskRunnerImpl); - DISALLOW_COPY_AND_ASSIGN(CefTaskRunnerImpl); }; #endif // CEF_LIBCEF_COMMON_TASK_RUNNER_IMPL_H_ diff --git a/libcef/common/test/translator_test_impl.cc b/libcef/common/test/translator_test_impl.cc index 1962b5048..2fa5b8db4 100644 --- a/libcef/common/test/translator_test_impl.cc +++ b/libcef/common/test/translator_test_impl.cc @@ -9,6 +9,11 @@ class CefTranslatorTestRefPtrLibraryImpl public: explicit CefTranslatorTestRefPtrLibraryImpl(int value) : value_(value) {} + CefTranslatorTestRefPtrLibraryImpl( + const CefTranslatorTestRefPtrLibraryImpl&) = delete; + CefTranslatorTestRefPtrLibraryImpl& operator=( + const CefTranslatorTestRefPtrLibraryImpl&) = delete; + int GetValue() override { return value_; } void SetValue(int value) override { value_ = value; } @@ -17,7 +22,6 @@ class CefTranslatorTestRefPtrLibraryImpl int value_; private: - DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestRefPtrLibraryImpl); IMPLEMENT_REFCOUNTING(CefTranslatorTestRefPtrLibraryImpl); }; @@ -33,6 +37,11 @@ class CefTranslatorTestRefPtrLibraryChildImpl CefTranslatorTestRefPtrLibraryChildImpl(int value, int other_value) : value_(value), other_value_(other_value) {} + CefTranslatorTestRefPtrLibraryChildImpl( + const CefTranslatorTestRefPtrLibraryChildImpl&) = delete; + CefTranslatorTestRefPtrLibraryChildImpl& operator=( + const CefTranslatorTestRefPtrLibraryChildImpl&) = delete; + int GetValue() override { return value_; } void SetValue(int value) override { value_ = value; } @@ -46,7 +55,6 @@ class CefTranslatorTestRefPtrLibraryChildImpl int other_value_; private: - DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestRefPtrLibraryChildImpl); IMPLEMENT_REFCOUNTING(CefTranslatorTestRefPtrLibraryChildImpl); }; @@ -66,6 +74,11 @@ class CefTranslatorTestRefPtrLibraryChildChildImpl other_value_(other_value), other_other_value_(other_other_value) {} + CefTranslatorTestRefPtrLibraryChildChildImpl( + const CefTranslatorTestRefPtrLibraryChildChildImpl&) = delete; + CefTranslatorTestRefPtrLibraryChildChildImpl& operator=( + const CefTranslatorTestRefPtrLibraryChildChildImpl&) = delete; + int GetValue() override { return value_; } void SetValue(int value) override { value_ = value; } @@ -84,7 +97,6 @@ class CefTranslatorTestRefPtrLibraryChildChildImpl int other_other_value_; private: - DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestRefPtrLibraryChildChildImpl); IMPLEMENT_REFCOUNTING(CefTranslatorTestRefPtrLibraryChildChildImpl); }; @@ -102,15 +114,17 @@ class CefTranslatorTestScopedLibraryImpl public: explicit CefTranslatorTestScopedLibraryImpl(int value) : value_(value) {} + CefTranslatorTestScopedLibraryImpl( + const CefTranslatorTestScopedLibraryImpl&) = delete; + CefTranslatorTestScopedLibraryImpl& operator=( + const CefTranslatorTestScopedLibraryImpl&) = delete; + int GetValue() override { return value_; } void SetValue(int value) override { value_ = value; } protected: int value_; - - private: - DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestScopedLibraryImpl); }; // static @@ -126,6 +140,11 @@ class CefTranslatorTestScopedLibraryChildImpl CefTranslatorTestScopedLibraryChildImpl(int value, int other_value) : value_(value), other_value_(other_value) {} + CefTranslatorTestScopedLibraryChildImpl( + const CefTranslatorTestScopedLibraryChildImpl&) = delete; + CefTranslatorTestScopedLibraryChildImpl& operator=( + const CefTranslatorTestScopedLibraryChildImpl&) = delete; + int GetValue() override { return value_; } void SetValue(int value) override { value_ = value; } @@ -137,9 +156,6 @@ class CefTranslatorTestScopedLibraryChildImpl protected: int value_; int other_value_; - - private: - DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestScopedLibraryChildImpl); }; // static @@ -159,6 +175,11 @@ class CefTranslatorTestScopedLibraryChildChildImpl other_value_(other_value), other_other_value_(other_other_value) {} + CefTranslatorTestScopedLibraryChildChildImpl( + const CefTranslatorTestScopedLibraryChildChildImpl&) = delete; + CefTranslatorTestScopedLibraryChildChildImpl& operator=( + const CefTranslatorTestScopedLibraryChildChildImpl&) = delete; + int GetValue() override { return value_; } void SetValue(int value) override { value_ = value; } @@ -175,9 +196,6 @@ class CefTranslatorTestScopedLibraryChildChildImpl int value_; int other_value_; int other_other_value_; - - private: - DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestScopedLibraryChildChildImpl); }; // static @@ -192,7 +210,10 @@ CefTranslatorTestScopedLibraryChildChild::Create(int value, class CefTranslatorTestImpl : public CefTranslatorTest { public: - CefTranslatorTestImpl() {} + CefTranslatorTestImpl() = default; + + CefTranslatorTestImpl(const CefTranslatorTestImpl&) = delete; + CefTranslatorTestImpl& operator=(const CefTranslatorTestImpl&) = delete; // PRIMITIVE VALUES @@ -550,7 +571,6 @@ class CefTranslatorTestImpl : public CefTranslatorTest { private: IMPLEMENT_REFCOUNTING(CefTranslatorTestImpl); - DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestImpl); }; // static diff --git a/libcef/common/thread_impl.h b/libcef/common/thread_impl.h index 34bfc9ea9..49e0380e2 100644 --- a/libcef/common/thread_impl.h +++ b/libcef/common/thread_impl.h @@ -13,6 +13,10 @@ class CefThreadImpl : public CefThread { public: CefThreadImpl(); + + CefThreadImpl(const CefThreadImpl&) = delete; + CefThreadImpl& operator=(const CefThreadImpl&) = delete; + ~CefThreadImpl(); bool Create(const CefString& display_name, @@ -36,7 +40,6 @@ class CefThreadImpl : public CefThread { scoped_refptr owner_task_runner_; IMPLEMENT_REFCOUNTING(CefThreadImpl); - DISALLOW_COPY_AND_ASSIGN(CefThreadImpl); }; #endif // CEF_LIBCEF_COMMON_THREAD_IMPL_H_ diff --git a/libcef/common/value_base.h b/libcef/common/value_base.h index bd0197ea3..c9ec56b45 100644 --- a/libcef/common/value_base.h +++ b/libcef/common/value_base.h @@ -39,6 +39,10 @@ class CefValueController if (verified_) impl_->lock(); } + + AutoLock(const AutoLock&) = delete; + AutoLock& operator=(const AutoLock&) = delete; + ~AutoLock() { if (verified_) impl_->unlock(); @@ -49,12 +53,13 @@ class CefValueController private: scoped_refptr impl_; bool verified_; - - DISALLOW_COPY_AND_ASSIGN(AutoLock); }; CefValueController(); + CefValueController(const CefValueController&) = delete; + CefValueController& operator=(const CefValueController&) = delete; + // Returns true if this controller is thread safe. virtual bool thread_safe() = 0; @@ -125,15 +130,13 @@ class CefValueController Object* owner_object_; // Map of reference objects. - typedef std::map ReferenceMap; + using ReferenceMap = std::map; ReferenceMap reference_map_; // Map of dependency objects. - typedef std::set DependencySet; - typedef std::map DependencyMap; + using DependencySet = std::set; + using DependencyMap = std::map; DependencyMap dependency_map_; - - DISALLOW_COPY_AND_ASSIGN(CefValueController); }; // Thread-safe access control implementation. @@ -141,6 +144,10 @@ class CefValueControllerThreadSafe : public CefValueController { public: explicit CefValueControllerThreadSafe() : locked_thread_id_(0) {} + CefValueControllerThreadSafe(const CefValueControllerThreadSafe&) = delete; + CefValueControllerThreadSafe& operator=(const CefValueControllerThreadSafe&) = + delete; + // CefValueController methods. bool thread_safe() override { return true; } bool on_correct_thread() override { return true; } @@ -160,8 +167,6 @@ class CefValueControllerThreadSafe : public CefValueController { private: base::Lock lock_; base::PlatformThreadId locked_thread_id_; - - DISALLOW_COPY_AND_ASSIGN(CefValueControllerThreadSafe); }; // Non-thread-safe access control implementation. @@ -170,6 +175,11 @@ class CefValueControllerNonThreadSafe : public CefValueController { explicit CefValueControllerNonThreadSafe() : thread_id_(base::PlatformThread::CurrentId()) {} + CefValueControllerNonThreadSafe(const CefValueControllerNonThreadSafe&) = + delete; + CefValueControllerNonThreadSafe& operator=( + const CefValueControllerNonThreadSafe&) = delete; + // CefValueController methods. bool thread_safe() override { return false; } bool on_correct_thread() override { @@ -182,8 +192,6 @@ class CefValueControllerNonThreadSafe : public CefValueController { private: base::PlatformThreadId thread_id_; - - DISALLOW_COPY_AND_ASSIGN(CefValueControllerNonThreadSafe); }; // Helper macros for verifying context. @@ -267,6 +275,9 @@ class CefValueBase : public CefType, public CefValueController::Object { } } + CefValueBase(const CefValueBase&) = delete; + CefValueBase& operator=(const CefValueBase&) = delete; + ~CefValueBase() override { if (controller_.get() && value_) Delete(); @@ -398,13 +409,14 @@ class CefValueBase : public CefType, public CefValueController::Object { verified_ = (auto_lock_.verified() && impl->VerifyAccess(modify)); } + AutoLock(const AutoLock&) = delete; + AutoLock& operator=(const AutoLock&) = delete; + inline bool verified() { return verified_; } private: CefValueController::AutoLock auto_lock_; bool verified_; - - DISALLOW_COPY_AND_ASSIGN(AutoLock); }; private: @@ -414,8 +426,6 @@ class CefValueBase : public CefType, public CefValueController::Object { scoped_refptr controller_; IMPLEMENT_REFCOUNTING(CefValueBase); - - DISALLOW_COPY_AND_ASSIGN(CefValueBase); }; #endif // CEF_LIBCEF_COMMON_VALUE_BASE_H_ diff --git a/libcef/common/values_impl.h b/libcef/common/values_impl.h index 1241c05c6..532917029 100644 --- a/libcef/common/values_impl.h +++ b/libcef/common/values_impl.h @@ -35,6 +35,9 @@ class CefValueImpl : public CefValue { explicit CefValueImpl(CefRefPtr value); explicit CefValueImpl(CefRefPtr value); + CefValueImpl(const CefValueImpl&) = delete; + CefValueImpl& operator=(const CefValueImpl&) = delete; + ~CefValueImpl() override; // Take ownership of |value|. Do not pass in a value owned by something else @@ -85,13 +88,16 @@ class CefValueImpl : public CefValue { explicit ScopedLockedValue(CefRefPtr impl) : impl_(impl) { impl_->AcquireLock(); } + + ScopedLockedValue(const ScopedLockedValue&) = delete; + ScopedLockedValue& operator=(const ScopedLockedValue&) = delete; + ~ScopedLockedValue() { impl_->ReleaseLock(); } base::Value* value() const { return impl_->GetValueUnsafe(); } private: CefRefPtr impl_; - DISALLOW_COPY_AND_ASSIGN(ScopedLockedValue); }; private: @@ -116,7 +122,6 @@ class CefValueImpl : public CefValue { CefRefPtr list_value_; IMPLEMENT_REFCOUNTING(CefValueImpl); - DISALLOW_COPY_AND_ASSIGN(CefValueImpl); }; // CefBinaryValue implementation @@ -139,6 +144,9 @@ class CefBinaryValueImpl : public CefValueBase { // The data will always be copied. CefBinaryValueImpl(char* data, size_t data_size); + CefBinaryValueImpl(const CefBinaryValueImpl&) = delete; + CefBinaryValueImpl& operator=(const CefBinaryValueImpl&) = delete; + // Return a copy of the value. base::Value* CopyValue() WARN_UNUSED_RESULT; @@ -170,8 +178,6 @@ class CefBinaryValueImpl : public CefValueBase { void* parent_value, ValueMode value_mode, CefValueController* controller); - - DISALLOW_COPY_AND_ASSIGN(CefBinaryValueImpl); }; // CefDictionaryValue implementation @@ -195,6 +201,9 @@ class CefDictionaryValueImpl bool will_delete, bool read_only); + CefDictionaryValueImpl(const CefDictionaryValueImpl&) = delete; + CefDictionaryValueImpl& operator=(const CefDictionaryValueImpl&) = delete; + // Return a copy of the value. base::DictionaryValue* CopyValue() WARN_UNUSED_RESULT; @@ -253,8 +262,6 @@ class CefDictionaryValueImpl bool RemoveInternal(const CefString& key); base::Value* SetInternal(const CefString& key, base::Value* value); - - DISALLOW_COPY_AND_ASSIGN(CefDictionaryValueImpl); }; // CefListValue implementation @@ -274,6 +281,9 @@ class CefListValueImpl : public CefValueBase { // Detach(nullptr). CefListValueImpl(base::ListValue* value, bool will_delete, bool read_only); + CefListValueImpl(const CefListValueImpl&) = delete; + CefListValueImpl& operator=(const CefListValueImpl&) = delete; + // Return a copy of the value. base::ListValue* CopyValue() WARN_UNUSED_RESULT; @@ -330,8 +340,6 @@ class CefListValueImpl : public CefValueBase { bool RemoveInternal(size_t index); base::Value* SetInternal(size_t index, base::Value* value); - - DISALLOW_COPY_AND_ASSIGN(CefListValueImpl); }; #endif // CEF_LIBCEF_COMMON_VALUES_IMPL_H_ diff --git a/libcef/common/waitable_event_impl.h b/libcef/common/waitable_event_impl.h index 96908c151..ce6495e41 100644 --- a/libcef/common/waitable_event_impl.h +++ b/libcef/common/waitable_event_impl.h @@ -14,6 +14,9 @@ class CefWaitableEventImpl : public CefWaitableEvent { public: CefWaitableEventImpl(bool automatic_reset, bool initially_signaled); + CefWaitableEventImpl(const CefWaitableEventImpl&) = delete; + CefWaitableEventImpl& operator=(const CefWaitableEventImpl&) = delete; + // CefWaitableEvent methods: void Reset() override; void Signal() override; @@ -25,7 +28,6 @@ class CefWaitableEventImpl : public CefWaitableEvent { base::WaitableEvent event_; IMPLEMENT_REFCOUNTING(CefWaitableEventImpl); - DISALLOW_COPY_AND_ASSIGN(CefWaitableEventImpl); }; #endif // CEF_LIBCEF_COMMON_WAITABLE_EVENT_IMPL_H_ diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index 1e9ae6dbb..cd13c3116 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -39,7 +39,6 @@ #include "libcef/renderer/thread_util.h" #include "base/command_line.h" -#include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/metrics/user_metrics_action.h" #include "base/path_service.h" diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index e17783ae4..1a576f8f2 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -53,6 +53,11 @@ class AlloyContentRendererClient public base::CurrentThread::DestructionObserver { public: AlloyContentRendererClient(); + + AlloyContentRendererClient(const AlloyContentRendererClient&) = delete; + AlloyContentRendererClient& operator=(const AlloyContentRendererClient&) = + delete; + ~AlloyContentRendererClient() override; // Returns the singleton AlloyContentRendererClient instance. @@ -149,8 +154,6 @@ class AlloyContentRendererClient // Access must be protected by |single_process_cleanup_lock_|. bool single_process_cleanup_complete_ = false; base::Lock single_process_cleanup_lock_; - - DISALLOW_COPY_AND_ASSIGN(AlloyContentRendererClient); }; #endif // CEF_LIBCEF_RENDERER_ALLOY_ALLOY_CONTENT_RENDERER_CLIENT_H_ diff --git a/libcef/renderer/alloy/alloy_render_thread_observer.h b/libcef/renderer/alloy/alloy_render_thread_observer.h index 98821bf43..feebe95a3 100644 --- a/libcef/renderer/alloy/alloy_render_thread_observer.h +++ b/libcef/renderer/alloy/alloy_render_thread_observer.h @@ -19,6 +19,11 @@ class AlloyRenderThreadObserver : public content::RenderThreadObserver, public chrome::mojom::RendererConfiguration { public: AlloyRenderThreadObserver(); + + AlloyRenderThreadObserver(const AlloyRenderThreadObserver&) = delete; + AlloyRenderThreadObserver& operator=(const AlloyRenderThreadObserver&) = + delete; + ~AlloyRenderThreadObserver() override; static bool is_incognito_process() { return is_incognito_process_; } @@ -52,8 +57,6 @@ class AlloyRenderThreadObserver : public content::RenderThreadObserver, mojo::AssociatedReceiverSet renderer_configuration_receivers_; - - DISALLOW_COPY_AND_ASSIGN(AlloyRenderThreadObserver); }; #endif // CEF_LIBCEF_RENDERER_ALLOY_ALLOY_RENDER_THREAD_OBSERVER_H_ diff --git a/libcef/renderer/blink_glue.h b/libcef/renderer/blink_glue.h index dba2a2f20..9f452e04c 100644 --- a/libcef/renderer/blink_glue.h +++ b/libcef/renderer/blink_glue.h @@ -13,7 +13,6 @@ #include "include/internal/cef_types.h" -#include "base/macros.h" #include "third_party/blink/public/platform/web_common.h" #include "v8/include/v8.h" @@ -78,13 +77,15 @@ BLINK_EXPORT void RegisterURLSchemeAsSupportingFetchAPI( class BLINK_EXPORT CefScriptForbiddenScope final { public: CefScriptForbiddenScope(); + + CefScriptForbiddenScope(const CefScriptForbiddenScope&) = delete; + CefScriptForbiddenScope& operator=(const CefScriptForbiddenScope&) = delete; + ~CefScriptForbiddenScope(); private: struct Impl; std::unique_ptr impl_; - - DISALLOW_COPY_AND_ASSIGN(CefScriptForbiddenScope); }; BLINK_EXPORT bool ResponseWasCached(const blink::WebURLResponse& response); diff --git a/libcef/renderer/browser_impl.h b/libcef/renderer/browser_impl.h index 3f21703b3..e8893bb3b 100644 --- a/libcef/renderer/browser_impl.h +++ b/libcef/renderer/browser_impl.h @@ -70,6 +70,10 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { int browser_id, bool is_popup, bool is_windowless); + + CefBrowserImpl(const CefBrowserImpl&) = delete; + CefBrowserImpl& operator=(const CefBrowserImpl&) = delete; + ~CefBrowserImpl() override; // Returns the matching CefFrameImpl reference or creates a new one. @@ -98,12 +102,12 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { bool is_windowless_; // Map of unique frame ids to CefFrameImpl references. - typedef std::map> FrameMap; + using FrameMap = std::map>; FrameMap frames_; // Map of unique frame ids to CefTrackManager objects that need to be cleaned // up when the frame is deleted. - typedef std::map> FrameObjectMap; + using FrameObjectMap = std::map>; FrameObjectMap frame_objects_; struct LoadingState { @@ -124,7 +128,6 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { std::unique_ptr last_loading_state_; IMPLEMENT_REFCOUNTING(CefBrowserImpl); - DISALLOW_COPY_AND_ASSIGN(CefBrowserImpl); }; #endif // CEF_LIBCEF_RENDERER_BROWSER_IMPL_H_ diff --git a/libcef/renderer/chrome/chrome_content_renderer_client_cef.h b/libcef/renderer/chrome/chrome_content_renderer_client_cef.h index 27c061d7d..8ac7b4d67 100644 --- a/libcef/renderer/chrome/chrome_content_renderer_client_cef.h +++ b/libcef/renderer/chrome/chrome_content_renderer_client_cef.h @@ -8,7 +8,6 @@ #include -#include "base/macros.h" #include "base/memory/scoped_refptr.h" #include "base/task/single_thread_task_runner.h" #include "chrome/renderer/chrome_content_renderer_client.h" @@ -19,6 +18,12 @@ class CefRenderManager; class ChromeContentRendererClientCef : public ChromeContentRendererClient { public: ChromeContentRendererClientCef(); + + ChromeContentRendererClientCef(const ChromeContentRendererClientCef&) = + delete; + ChromeContentRendererClientCef& operator=( + const ChromeContentRendererClientCef&) = delete; + ~ChromeContentRendererClientCef() override; // Render thread task runner. @@ -43,8 +48,6 @@ class ChromeContentRendererClientCef : public ChromeContentRendererClient { std::unique_ptr render_manager_; scoped_refptr render_task_runner_; - - DISALLOW_COPY_AND_ASSIGN(ChromeContentRendererClientCef); }; #endif // CEF_LIBCEF_RENDERER_CHROME_CHROME_CONTENT_RENDERER_CLIENT_CEF_ diff --git a/libcef/renderer/dom_document_impl.h b/libcef/renderer/dom_document_impl.h index 85e50ee1b..87d870169 100644 --- a/libcef/renderer/dom_document_impl.h +++ b/libcef/renderer/dom_document_impl.h @@ -54,7 +54,7 @@ class CefDOMDocumentImpl : public CefDOMDocument { CefBrowserImpl* browser_; blink::WebLocalFrame* frame_; - typedef std::map NodeMap; + using NodeMap = std::map; NodeMap node_map_; IMPLEMENT_REFCOUNTING(CefDOMDocumentImpl); diff --git a/libcef/renderer/extensions/extensions_dispatcher_delegate.h b/libcef/renderer/extensions/extensions_dispatcher_delegate.h index 3730f8fd9..5ccebb6d5 100644 --- a/libcef/renderer/extensions/extensions_dispatcher_delegate.h +++ b/libcef/renderer/extensions/extensions_dispatcher_delegate.h @@ -5,7 +5,6 @@ #ifndef CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_ #define CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_ -#include "base/macros.h" #include "extensions/renderer/dispatcher_delegate.h" namespace extensions { @@ -13,13 +12,16 @@ namespace extensions { class CefExtensionsDispatcherDelegate : public DispatcherDelegate { public: CefExtensionsDispatcherDelegate(); + + CefExtensionsDispatcherDelegate(const CefExtensionsDispatcherDelegate&) = + delete; + CefExtensionsDispatcherDelegate& operator=( + const CefExtensionsDispatcherDelegate&) = delete; + ~CefExtensionsDispatcherDelegate() override; void PopulateSourceMap( extensions::ResourceBundleSourceMap* source_map) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CefExtensionsDispatcherDelegate); }; } // namespace extensions diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index 3ac4a39d9..3566c43ee 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -8,7 +8,6 @@ #include #include -#include "base/macros.h" #include "extensions/renderer/extensions_renderer_client.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "ui/base/page_transition_types.h" @@ -49,6 +48,11 @@ class ResourceRequestPolicy; class CefExtensionsRendererClient : public ExtensionsRendererClient { public: CefExtensionsRendererClient(); + + CefExtensionsRendererClient(const CefExtensionsRendererClient&) = delete; + CefExtensionsRendererClient& operator=(const CefExtensionsRendererClient&) = + delete; + ~CefExtensionsRendererClient() override; // ExtensionsRendererClient implementation. @@ -83,8 +87,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { std::unique_ptr guest_view_container_dispatcher_; std::unique_ptr resource_request_policy_; - - DISALLOW_COPY_AND_ASSIGN(CefExtensionsRendererClient); }; } // namespace extensions diff --git a/libcef/renderer/frame_impl.h b/libcef/renderer/frame_impl.h index b4aeeed2e..a9bfdb3fa 100644 --- a/libcef/renderer/frame_impl.h +++ b/libcef/renderer/frame_impl.h @@ -40,6 +40,10 @@ class CefFrameImpl : public CefFrame, public cef::mojom::RenderFrame { CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame, int64_t frame_id); + + CefFrameImpl(const CefFrameImpl&) = delete; + CefFrameImpl& operator=(const CefFrameImpl&) = delete; + ~CefFrameImpl() override; // CefFrame implementation. @@ -132,7 +136,6 @@ class CefFrameImpl : public CefFrame, public cef::mojom::RenderFrame { base::WeakPtrFactory weak_ptr_factory_{this}; IMPLEMENT_REFCOUNTING(CefFrameImpl); - DISALLOW_COPY_AND_ASSIGN(CefFrameImpl); }; #endif // CEF_LIBCEF_RENDERER_FRAME_IMPL_H_ diff --git a/libcef/renderer/render_frame_observer.h b/libcef/renderer/render_frame_observer.h index 2b61e2834..26b20ff19 100644 --- a/libcef/renderer/render_frame_observer.h +++ b/libcef/renderer/render_frame_observer.h @@ -20,6 +20,10 @@ class CefFrameImpl; class CefRenderFrameObserver : public content::RenderFrameObserver { public: explicit CefRenderFrameObserver(content::RenderFrame* render_frame); + + CefRenderFrameObserver(const CefRenderFrameObserver&) = delete; + CefRenderFrameObserver& operator=(const CefRenderFrameObserver&) = delete; + ~CefRenderFrameObserver() override; // RenderFrameObserver methods: @@ -60,8 +64,6 @@ class CefRenderFrameObserver : public content::RenderFrameObserver { // meaning that messages on the interface retain FIFO with respect to legacy // Chrome IPC messages sent or dispatched on the channel. blink::AssociatedInterfaceRegistry associated_interfaces_; - - DISALLOW_COPY_AND_ASSIGN(CefRenderFrameObserver); }; #endif // LIBCEF_RENDERER_RENDER_FRAME_OBSERVER_H_ diff --git a/libcef/renderer/render_manager.cc b/libcef/renderer/render_manager.cc index c98f8fc35..e3fd3098a 100644 --- a/libcef/renderer/render_manager.cc +++ b/libcef/renderer/render_manager.cc @@ -28,6 +28,7 @@ #include "libcef/renderer/v8_impl.h" #include "base/command_line.h" +#include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "cef/libcef/common/mojom/cef.mojom.h" #include "content/public/common/content_switches.h" diff --git a/libcef/renderer/render_manager.h b/libcef/renderer/render_manager.h index 789efac59..89bc1541c 100644 --- a/libcef/renderer/render_manager.h +++ b/libcef/renderer/render_manager.h @@ -40,6 +40,10 @@ class CefRenderFrameObserver; class CefRenderManager : public cef::mojom::RenderManager { public: CefRenderManager(); + + CefRenderManager(const CefRenderManager&) = delete; + CefRenderManager& operator=(const CefRenderManager&) = delete; + ~CefRenderManager(); // Returns this singleton instance of this class. @@ -106,12 +110,12 @@ class CefRenderManager : public cef::mojom::RenderManager { void OnGuestViewDestroyed(CefGuestView* guest_view); // Map of RenderView pointers to CefBrowserImpl references. - typedef std::map> BrowserMap; + using BrowserMap = std::map>; BrowserMap browsers_; // Map of RenderView poiners to CefGuestView implementations. - typedef std::map> - GuestViewMap; + using GuestViewMap = + std::map>; GuestViewMap guest_views_; // Cross-origin white list entries that need to be registered with WebKit. @@ -124,8 +128,6 @@ class CefRenderManager : public cef::mojom::RenderManager { mojo::ReceiverSet receivers_; mojo::Remote browser_manager_; - - DISALLOW_COPY_AND_ASSIGN(CefRenderManager); }; #endif // CEF_LIBCEF_RENDERER_RENDER_MANAGER_H_ diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 24bd2aeb7..04227acfa 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -174,7 +174,7 @@ class CefV8IsolateManager { v8::Isolate* isolate_; scoped_refptr task_runner_; - typedef std::map> ContextMap; + using ContextMap = std::map>; ContextMap context_map_; // Used for globally tracked objects that are not associated with a particular diff --git a/libcef/renderer/v8_impl.h b/libcef/renderer/v8_impl.h index 22131302a..3dbb4ffc3 100644 --- a/libcef/renderer/v8_impl.h +++ b/libcef/renderer/v8_impl.h @@ -129,14 +129,17 @@ class CefV8HandleBase template class CefV8Handle : public CefV8HandleBase { public: - typedef v8::Local handleType; - typedef v8::Persistent persistentType; + using handleType = v8::Local; + using persistentType = v8::Persistent; CefV8Handle(v8::Isolate* isolate, v8::Local context, handleType v) : CefV8HandleBase(isolate, context), handle_(isolate, v) {} + CefV8Handle(const CefV8Handle&) = delete; + CefV8Handle& operator=(const CefV8Handle&) = delete; + handleType GetNewV8Handle() { DCHECK(IsValid()); return handleType::New(isolate(), handle_); @@ -148,8 +151,6 @@ class CefV8Handle : public CefV8HandleBase { ~CefV8Handle() override { handle_.Reset(); } persistentType handle_; - - DISALLOW_COPY_AND_ASSIGN(CefV8Handle); }; // Specialization for v8::Value with empty implementation to avoid incorrect @@ -160,6 +161,10 @@ class CefV8Handle {}; class CefV8ContextImpl : public CefV8Context { public: CefV8ContextImpl(v8::Isolate* isolate, v8::Local context); + + CefV8ContextImpl(const CefV8ContextImpl&) = delete; + CefV8ContextImpl& operator=(const CefV8ContextImpl&) = delete; + ~CefV8ContextImpl() override; CefRefPtr GetTaskRunner() override; @@ -180,14 +185,13 @@ class CefV8ContextImpl : public CefV8Context { blink::WebLocalFrame* GetWebFrame(); private: - typedef CefV8Handle Handle; + using Handle = CefV8Handle; scoped_refptr handle_; int enter_count_; std::unique_ptr microtasks_scope_; IMPLEMENT_REFCOUNTING(CefV8ContextImpl); - DISALLOW_COPY_AND_ASSIGN(CefV8ContextImpl); }; class CefV8ValueImpl : public CefV8Value { @@ -196,6 +200,10 @@ class CefV8ValueImpl : public CefV8Value { CefV8ValueImpl(v8::Isolate* isolate, v8::Local context, v8::Local value); + + CefV8ValueImpl(const CefV8ValueImpl&) = delete; + CefV8ValueImpl& operator=(const CefV8ValueImpl&) = delete; + ~CefV8ValueImpl() override; // Used for initializing the CefV8ValueImpl. Should be called a single time @@ -280,14 +288,17 @@ class CefV8ValueImpl : public CefV8Value { class Handle : public CefV8HandleBase { public: - typedef v8::Local handleType; - typedef v8::Persistent persistentType; + using handleType = v8::Local; + using persistentType = v8::Persistent; Handle(v8::Isolate* isolate, v8::Local context, handleType v, CefTrackNode* tracker); + Handle(const Handle&) = delete; + Handle& operator=(const Handle&) = delete; + handleType GetNewV8Handle(bool should_persist); persistentType& GetPersistentV8Handle(); @@ -313,8 +324,6 @@ class CefV8ValueImpl : public CefV8Value { // True if the handle has been set as weak. bool is_set_weak_; - - DISALLOW_COPY_AND_ASSIGN(Handle); }; v8::Isolate* isolate_; @@ -348,12 +357,15 @@ class CefV8ValueImpl : public CefV8Value { bool rethrow_exceptions_; IMPLEMENT_REFCOUNTING(CefV8ValueImpl); - DISALLOW_COPY_AND_ASSIGN(CefV8ValueImpl); }; class CefV8StackTraceImpl : public CefV8StackTrace { public: CefV8StackTraceImpl(v8::Isolate* isolate, v8::Local handle); + + CefV8StackTraceImpl(const CefV8StackTraceImpl&) = delete; + CefV8StackTraceImpl& operator=(const CefV8StackTraceImpl&) = delete; + ~CefV8StackTraceImpl() override; bool IsValid() override; @@ -364,12 +376,15 @@ class CefV8StackTraceImpl : public CefV8StackTrace { std::vector> frames_; IMPLEMENT_REFCOUNTING(CefV8StackTraceImpl); - DISALLOW_COPY_AND_ASSIGN(CefV8StackTraceImpl); }; class CefV8StackFrameImpl : public CefV8StackFrame { public: CefV8StackFrameImpl(v8::Isolate* isolate, v8::Local handle); + + CefV8StackFrameImpl(const CefV8StackFrameImpl&) = delete; + CefV8StackFrameImpl& operator=(const CefV8StackFrameImpl&) = delete; + ~CefV8StackFrameImpl() override; bool IsValid() override; @@ -391,7 +406,6 @@ class CefV8StackFrameImpl : public CefV8StackFrame { bool is_constructor_; IMPLEMENT_REFCOUNTING(CefV8StackFrameImpl); - DISALLOW_COPY_AND_ASSIGN(CefV8StackFrameImpl); }; #endif // CEF_LIBCEF_RENDERER_V8_IMPL_H_