Remove DISALLOW_ macro from libcef/ (see issue #3234)

Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
This commit is contained in:
Marshall Greenblatt 2021-12-06 15:40:25 -05:00
parent 83ffc1f00d
commit 9484d6528c
205 changed files with 944 additions and 542 deletions

View File

@ -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<const content::BrowserContext*,
std::unique_ptr<visitedlink::VisitedLinkEventListener>>
ListenerMap;
using ListenerMap =
std::map<const content::BrowserContext*,
std::unique_ptr<visitedlink::VisitedLinkEventListener>>;
ListenerMap listener_map_;
DISALLOW_COPY_AND_ASSIGN(CefVisitedLinkListener);
};
AlloyBrowserContext::AlloyBrowserContext(

View File

@ -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<content::ResourceContext> resource_context_;
scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_;
DISALLOW_COPY_AND_ASSIGN(AlloyBrowserContext);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_

View File

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

View File

@ -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<views::LayoutProvider> layout_provider_;
#endif
#endif // defined(TOOLKIT_VIEWS)
DISALLOW_COPY_AND_ASSIGN(AlloyBrowserMainParts);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_

View File

@ -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<void(content::CertificateRequestResultType)>
CallbackType;
using CallbackType =
base::OnceCallback<void(content::CertificateRequestResultType)>;
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<content::ClientCertificateDelegate> 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<content::ClientCertificateDelegate> 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)

View File

@ -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"

View File

@ -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<CefBrowserPlatformDelegateAlloy> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserPlatformDelegateAlloy);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_BROWSER_PLATFORM_DELEGATE_ALLOY_H_

View File

@ -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<base::FieldTrialList> field_trial_list_;
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessAlloy);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_

View File

@ -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::VariationsClient> variations_client_;
DISALLOW_COPY_AND_ASSIGN(ChromeProfileAlloy);
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_

View File

@ -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_

View File

@ -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(

View File

@ -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_

View File

@ -72,6 +72,10 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
explicit CefBrowserContentsDelegate(
scoped_refptr<CefBrowserInfo> 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_

View File

@ -34,9 +34,13 @@ namespace {
// Manages the global list of Impl instances.
class ImplManager {
public:
typedef std::vector<CefBrowserContext*> Vector;
using Vector = std::vector<CefBrowserContext*>;
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<base::FilePath, CefBrowserContext*> PathMap;
using PathMap = std::map<base::FilePath, CefBrowserContext*>;
PathMap map_;
Vector all_;
DISALLOW_COPY_AND_ASSIGN(ImplManager);
};
#if DCHECK_IS_ON()

View File

@ -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<content::GlobalRenderFrameHostId> RenderIdSet;
using RenderIdSet = std::set<content::GlobalRenderFrameHostId>;
RenderIdSet render_id_set_;
#if DCHECK_IS_ON()
@ -235,8 +238,6 @@ class CefBrowserContext {
Getter getter_;
base::WeakPtrFactory<CefBrowserContext> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserContext);
};
#endif // CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_

View File

@ -22,6 +22,10 @@ class CefBrowserFrame
public:
CefBrowserFrame(content::RenderFrameHost* render_frame_host,
mojo::PendingReceiver<cef::mojom::BrowserFrame> 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<CefFrameHostImpl> GetFrameHost(
bool prefer_speculative = false) const;
DISALLOW_COPY_AND_ASSIGN(CefBrowserFrame);
};
#endif // CEF_LIBCEF_BROWSER_BROWSER_FRAME_H_

View File

@ -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"

View File

@ -134,6 +134,9 @@ class CefBrowserHostBase : public CefBrowserHost,
scoped_refptr<CefBrowserInfo> browser_info,
CefRefPtr<CefRequestContextImpl> 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_

View File

@ -39,6 +39,9 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
bool is_windowless,
CefRefPtr<CefDictionaryValue> 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<CefBrowserInfo> {
// 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<CefRefPtr<CefFrameHostImpl>> FrameHostList;
using FrameHostList = std::set<CefRefPtr<CefFrameHostImpl>>;
FrameHostList GetAllFrames() const;
class NavigationLock final : public base::RefCounted<NavigationLock> {
@ -251,8 +254,6 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// Only accessed on the UI thread.
std::vector<CefDraggableRegion> draggable_regions_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserInfo);
};
#endif // CEF_LIBCEF_BROWSER_BROWSER_INFO_H_

View File

@ -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_

View File

@ -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_

View File

@ -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<CefBrowserPlatformDelegate> 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_

View File

@ -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<base::OnceClosure> init_callbacks_;
base::WeakPtrFactory<ChromeBrowserContext> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserContext);
};
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_CONTEXT_H_

View File

@ -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_

View File

@ -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<CefRequestContextImpl> request_context() const {
@ -47,8 +52,6 @@ class ChromeBrowserMainExtraPartsCef : public ChromeBrowserMainExtraParts {
scoped_refptr<base::SingleThreadTaskRunner> background_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsCef);
};
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_BROWSER_MAIN_EXTRA_PARTS_CEF_H_

View File

@ -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"

View File

@ -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_

View File

@ -23,6 +23,9 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver,
CefRefPtr<CefContextMenuHandler> 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<int, ItemInfo>;
ItemInfoMap iteminfomap_;
DISALLOW_COPY_AND_ASSIGN(CefContextMenuObserver);
};
std::unique_ptr<RenderViewContextMenuObserver> MenuCreatedCallback(

View File

@ -17,6 +17,9 @@ class PopupWindowDelegate : public CefWindowDelegate {
explicit PopupWindowDelegate(CefRefPtr<CefBrowserView> browser_view)
: browser_view_(browser_view) {}
PopupWindowDelegate(const PopupWindowDelegate&) = delete;
PopupWindowDelegate& operator=(const PopupWindowDelegate&) = delete;
void OnWindowCreated(CefRefPtr<CefWindow> window) override {
window->AddChildView(browser_view_);
window->Show();
@ -38,7 +41,6 @@ class PopupWindowDelegate : public CefWindowDelegate {
CefRefPtr<CefBrowserView> browser_view_;
IMPLEMENT_REFCOUNTING(PopupWindowDelegate);
DISALLOW_COPY_AND_ASSIGN(PopupWindowDelegate);
};
} // namespace

View File

@ -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> browser,
CefRefPtr<CefBrowserView> browser_view);
@ -59,8 +62,6 @@ class ChromeBrowserView
bool destroyed_ = false;
CefRefPtr<CefToolbarViewImpl> cef_toolbar_;
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserView);
};
#endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_CHROME_BROWSER_VIEW_H_

View File

@ -17,7 +17,10 @@ class BrowserView;
class CefToolbarViewImpl
: public CefViewImpl<CefToolbarViewView, CefView, CefViewDelegate> {
public:
typedef CefViewImpl<CefToolbarViewView, CefView, CefViewDelegate> ParentClass;
using ParentClass = CefViewImpl<CefToolbarViewView, CefView, CefViewDelegate>;
CefToolbarViewImpl(const CefToolbarViewImpl&) = delete;
CefToolbarViewImpl& operator=(const CefToolbarViewImpl&) = delete;
// Create a new CefToolbarViewImpl instance. |delegate| may be nullptr.
static CefRefPtr<CefToolbarViewImpl> Create(
@ -49,7 +52,6 @@ class CefToolbarViewImpl
absl::optional<ToolbarView::DisplayMode> const display_mode_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl);
DISALLOW_COPY_AND_ASSIGN(CefToolbarViewImpl);
};
#endif // CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_

View File

@ -12,7 +12,7 @@
class CefToolbarViewView : public CefViewView<ToolbarView, CefViewDelegate> {
public:
typedef CefViewView<ToolbarView, CefViewDelegate> ParentClass;
using ParentClass = CefViewView<ToolbarView, CefViewDelegate>;
// |cef_delegate| may be nullptr.
explicit CefToolbarViewView(CefViewDelegate* cef_delegate,
@ -20,8 +20,8 @@ class CefToolbarViewView : public CefViewView<ToolbarView, CefViewDelegate> {
BrowserView* browser_view,
absl::optional<DisplayMode> 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_

View File

@ -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_

View File

@ -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<Observer> observers_;
base::WeakPtrFactory<CefDevToolsController> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsController);
};
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_CONTROLLER_H_

View File

@ -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 <map>
@ -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<void(const std::string&)> SaveCallback;
typedef base::OnceCallback<void()> CancelCallback;
using SaveCallback = base::OnceCallback<void(const std::string&)>;
using CancelCallback = base::OnceCallback<void()>;
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<void(void)> AppendCallback;
using AppendCallback = base::OnceCallback<void(void)>;
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<std::string, base::FilePath> PathsMap;
using PathsMap = std::map<std::string, base::FilePath>;
PathsMap saved_files_;
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
base::WeakPtrFactory<CefDevToolsFileManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFileManager);
};
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FILE_MANAGER_H_

View File

@ -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<network::SimpleURLLoader> loader_;
int request_id_;
scoped_refptr<net::HttpResponseHeaders> response_headers_;
DISALLOW_COPY_AND_ASSIGN(NetworkResourceLoader);
};
// static

View File

@ -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<CefDevToolsFrontend> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend);
};
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_H_

View File

@ -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<CefDevToolsController> controller_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDevToolsRegistrationImpl);
DISALLOW_COPY_AND_ASSIGN(CefDevToolsRegistrationImpl);
};
} // namespace

View File

@ -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<CefDevToolsController> devtools_controller_;
base::WeakPtrFactory<CefDevToolsManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsManager);
};
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_H_

View File

@ -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<net::ServerSocket> 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<content::DevToolsSocketFactory> CreateSocketFactory() {

View File

@ -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_

View File

@ -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_

View File

@ -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

View File

@ -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<download::DownloadItem*, AlloyBrowserHostImpl*>
ItemBrowserMap;
using ItemBrowserMap =
std::map<download::DownloadItem*, AlloyBrowserHostImpl*>;
ItemBrowserMap item_browser_map_;
DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate);
};
#endif // CEF_LIBCEF_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_

View File

@ -23,6 +23,9 @@ class CefExtensionImpl : public CefExtension {
CefRequestContext* loader_context,
CefRefPtr<CefExtensionHandler> 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_

View File

@ -9,7 +9,6 @@
#include <memory>
#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<value_store::ValueStoreFactory> 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

View File

@ -8,7 +8,6 @@
#include <map>
#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<std::string, ui::TemplateReplacements>;
TemplateReplacementMap template_replacements_;
DISALLOW_COPY_AND_ASSIGN(CefComponentExtensionResourceManager);
};
} // namespace extensions

View File

@ -8,7 +8,6 @@
#include <memory>
#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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<CefExtensionSystem> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefExtensionSystem);
};
} // namespace extensions

View File

@ -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

View File

@ -7,7 +7,6 @@
#include <memory>
#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

View File

@ -19,6 +19,11 @@ class CefExtensionWebContentsObserver
: public ExtensionWebContentsObserver,
public content::WebContentsUserData<CefExtensionWebContentsObserver> {
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<ScriptExecutor> script_executor_;
WEB_CONTENTS_USER_DATA_KEY_DECL();
DISALLOW_COPY_AND_ASSIGN(CefExtensionWebContentsObserver);
};
} // namespace extensions

View File

@ -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

View File

@ -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<ComponentExtensionResourceManager> resource_manager_;
std::unique_ptr<KioskDelegate> kiosk_delegate_;
DISALLOW_COPY_AND_ASSIGN(CefExtensionsBrowserClient);
};
} // namespace extensions

View File

@ -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

View File

@ -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

View File

@ -12,7 +12,6 @@
#include <vector>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "components/value_store/value_store.h"
namespace value_store {

View File

@ -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<base::FilePath> select_files_;
DISALLOW_COPY_AND_ASSIGN(UploadFolderHelper);
};
} // namespace

View File

@ -30,6 +30,10 @@ class CefFileDialogManager {
// |runner| may be NULL if the platform doesn't implement dialogs.
CefFileDialogManager(AlloyBrowserHostImpl* browser,
std::unique_ptr<CefFileDialogRunner> 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<CefFileDialogManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefFileDialogManager);
};
#endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_

View File

@ -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<void(int, const std::vector<base::FilePath>&)>
RunFileChooserCallback;
using RunFileChooserCallback =
base::OnceCallback<void(int, const std::vector<base::FilePath>&)>;
// 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>;
CefFileDialogRunner() {}
virtual ~CefFileDialogRunner() {}
private:
DISALLOW_COPY_AND_ASSIGN(CefFileDialogRunner);
CefFileDialogRunner() = default;
virtual ~CefFileDialogRunner() = default;
};
#endif // CEF_LIBCEF_BROWSER_FILE_DIALOG_RUNNER_H_

View File

@ -40,6 +40,9 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
CefFrameHostImpl(scoped_refptr<CefBrowserInfo> 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<cef::mojom::RenderFrame> render_frame_;
IMPLEMENT_REFCOUNTING(CefFrameHostImpl);
DISALLOW_COPY_AND_ASSIGN(CefFrameHostImpl);
};
#endif // CEF_LIBCEF_BROWSER_FRAME_HOST_IMPL_H_

View File

@ -36,7 +36,7 @@ class GPU_GLES2_EXPORT ExternalTextureManager {
void DeleteTexture(void* handle, TextureManager* tex_man);
private:
typedef std::map<void*, scoped_refptr<gl::GLImage>> ExternalSurfaceMap;
using ExternalSurfaceMap = std::map<void*, scoped_refptr<gl::GLImage>>;
ExternalSurfaceMap surfaceMap_;
};

View File

@ -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<bool(const SkBitmap& /*bitmap*/,
std::vector<unsigned char>* /*compressed*/)>
CompressionMethod;
using CompressionMethod =
base::OnceCallback<bool(const SkBitmap& /*bitmap*/,
std::vector<unsigned char>* /*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_

View File

@ -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<CefRequestContextHandler> handler);
@ -57,12 +60,9 @@ class CefIOThreadState : public base::RefCountedThreadSafe<
CefRequestContextHandlerMap handler_map_;
// Map (scheme, domain) to factories.
typedef std::map<std::pair<std::string, std::string>,
CefRefPtr<CefSchemeHandlerFactory>>
SchemeHandlerFactoryMap;
using SchemeHandlerFactoryMap = std::map<std::pair<std::string, std::string>,
CefRefPtr<CefSchemeHandlerFactory>>;
SchemeHandlerFactoryMap scheme_handler_factory_map_;
DISALLOW_COPY_AND_ASSIGN(CefIOThreadState);
};
#endif // CEF_LIBCEF_BROWSER_IOTHREAD_STATE_H_

View File

@ -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<CefJavaScriptDialogRunner> 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<CefJavaScriptDialogManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefJavaScriptDialogManager);
};
#endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_MANAGER_H_

View File

@ -14,9 +14,13 @@ class AlloyBrowserHostImpl;
class CefJavaScriptDialogRunner {
public:
typedef base::OnceCallback<void(bool /* success */,
const std::u16string& /* user_input */)>
DialogClosedCallback;
CefJavaScriptDialogRunner(const CefJavaScriptDialogRunner&) = delete;
CefJavaScriptDialogRunner& operator=(const CefJavaScriptDialogRunner&) =
delete;
using DialogClosedCallback =
base::OnceCallback<void(bool /* success */,
const std::u16string& /* user_input */)>;
// 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>;
CefJavaScriptDialogRunner() {}
virtual ~CefJavaScriptDialogRunner() {}
private:
DISALLOW_COPY_AND_ASSIGN(CefJavaScriptDialogRunner);
CefJavaScriptDialogRunner() = default;
virtual ~CefJavaScriptDialogRunner() = default;
};
#endif // CEF_LIBCEF_BROWSER_JAVASCRIPT_DIALOG_RUNNER_H_

View File

@ -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_

View File

@ -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<CefMediaSource> 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_

View File

@ -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() {

View File

@ -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<base::OnceClosure> init_callbacks_;
IMPLEMENT_REFCOUNTING(CefMediaRouterImpl);
DISALLOW_COPY_AND_ASSIGN(CefMediaRouterImpl);
};
#endif // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_IMPL_H_

View File

@ -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<media_router::MediaRoute>& routes,
const std::vector<media_router::MediaRoute::Id>&
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<blink::mojom::PresentationConnection> connection_remote_;
DISALLOW_COPY_AND_ASSIGN(CefPresentationConnection);
};
CefMediaRouterManager::CefMediaRouterManager(

View File

@ -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<CefMediaRouterManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefMediaRouterManager);
};
#endif // CEF_LIBCEF_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MANAGER_H_

View File

@ -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_

View File

@ -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_

View File

@ -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<cef_event_flags_t>(0);
class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback {
public:
typedef base::OnceCallback<void(int, cef_event_flags_t)> Callback;
using Callback = base::OnceCallback<void(int, cef_event_flags_t)>;
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

View File

@ -27,6 +27,10 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
public:
CefMenuManager(AlloyBrowserHostImpl* browser,
std::unique_ptr<CefMenuRunner> 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<CefMenuManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefMenuManager);
};
#endif // CEF_LIBCEF_BROWSER_MENU_MANAGER_H_

View File

@ -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,

View File

@ -58,6 +58,10 @@ class CefMenuModelImpl : public CefMenuModel {
CefMenuModelImpl(Delegate* delegate,
CefRefPtr<CefMenuModelDelegate> 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<Item> ItemVector;
using ItemVector = std::vector<Item>;
// 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_

View File

@ -8,8 +8,6 @@
#include <memory>
#include <string>
#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>;
CefMenuRunner() {}
virtual ~CefMenuRunner() {}
DISALLOW_COPY_AND_ASSIGN(CefMenuRunner);
CefMenuRunner() = default;
virtual ~CefMenuRunner() = default;
};
#endif // CEF_LIBCEF_BROWSER_MENU_RUNNER_H_

View File

@ -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<MenuWrapper> wrapper_;
DISALLOW_COPY_AND_ASSIGN(Menu2);
};
} // namespace views

View File

@ -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 {

View File

@ -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<std::unique_ptr<ItemData>> ItemDataList;
using ItemDataList = std::vector<std::unique_ptr<ItemData>>;
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

View File

@ -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_

View File

@ -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<CefWindowX11> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefWindowX11);
};
#endif // CEF_LIBCEF_BROWSER_NATIVE_WINDOW_X11_H_

View File

@ -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<CefSSLStatus> GetSSLStatus() override;
private:
DISALLOW_COPY_AND_ASSIGN(CefNavigationEntryImpl);
};
#endif // CEF_LIBCEF_BROWSER_NAVIGATION_ENTRY_IMPL_H_

View File

@ -214,7 +214,7 @@ std::string GetCommandLine() {
base::CommandLine::ForCurrentProcess()->GetCommandLineString());
#elif defined(OS_POSIX)
std::string command_line = "";
typedef std::vector<std::string> ArgvList;
using ArgvList = std::vector<std::string>;
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<std::string, std::string> KeyMap;
using KeyMap = std::map<std::string, std::string>;
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<base::RefCountedString> output_;
DISALLOW_COPY_AND_ASSIGN(CefURLDataSource);
};
class CefWebUIController : public content::WebUIController {
@ -513,16 +514,20 @@ class CefWebUIController : public content::WebUIController {
profile, std::make_unique<CefURLDataSource>(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<CefWebUIControllerFactory>;
@ -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<CefWebUIControllerFactory>::Leaky

View File

@ -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<CefRequest> request,
bool& handle_request,
CefRefPtr<CefCallback> 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<CefRequest> request,
bool& handle_request,
CefRefPtr<CefCallback> 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<InternalHandlerDelegate> delegate)
: delegate_(std::move(delegate)) {}
InternalHandlerFactory(const InternalHandlerFactory&) = delete;
InternalHandlerFactory& operator=(const InternalHandlerFactory&) = delete;
CefRefPtr<CefResourceHandler> Create(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& scheme_name,
@ -190,7 +197,6 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
std::unique_ptr<InternalHandlerDelegate> delegate_;
IMPLEMENT_REFCOUNTING(InternalHandlerFactory);
DISALLOW_COPY_AND_ASSIGN(InternalHandlerFactory);
};
} // namespace

View File

@ -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<int32_t, CefBrowserURLRequest::RequestInfo>;
RequestMap map_;
DISALLOW_COPY_AND_ASSIGN(RequestManager);
};
#if DCHECK_IS_ON()

View File

@ -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<base::OnceClosure> init_callbacks_;
IMPLEMENT_REFCOUNTING(CefCookieManagerImpl);
DISALLOW_COPY_AND_ASSIGN(CefCookieManagerImpl);
};
#endif // CEF_LIBCEF_BROWSER_NET_SERVICE_COOKIE_MANAGER_IMPL_H_

View File

@ -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<base::SequencedTaskRunner> task_runner_;
IMPLEMENT_REFCOUNTING(AuthCallbackImpl);
DISALLOW_COPY_AND_ASSIGN(AuthCallbackImpl);
};
void RunCallbackOnIOThread(

View File

@ -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<ResourceContextData> 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<CorsPreflightRequest> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CorsPreflightRequest);
};
//==============================
@ -198,6 +201,10 @@ class InterceptedRequest : public network::mojom::URLLoader,
mojo::PendingReceiver<network::mojom::URLLoader> loader_receiver,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::URLLoaderFactory> 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<InterceptedRequest> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(InterceptedRequest);
};
class InterceptDelegate : public StreamReaderURLLoader::Delegate {

View File

@ -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<int32_t, std::unique_ptr<InterceptedRequest>> requests_;
base::WeakPtrFactory<ProxyURLLoaderFactory> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ProxyURLLoaderFactory);
};
} // namespace net_service

View File

@ -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<base::SequencedTaskRunner> 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<base::SequencedTaskRunner> 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<HandlerProvider> {
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<ReadCallbackWrapper> 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<HandlerProvider> 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<HandlerProvider> 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<base::SequencedTaskRunner> 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<CefRequestImpl> request_;
scoped_refptr<HandlerProvider> handler_provider_;
DISALLOW_COPY_AND_ASSIGN(ResourceResponseWrapper);
};
} // namespace

View File

@ -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<base::SequencedTaskRunner> 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<InterceptedRequestHandlerWrapper> 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<InitState> 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<InitHelper>(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<InterceptedRequestHandlerWrapper> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(InterceptedRequestHandlerWrapper);
};
} // namespace

View File

@ -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<std::unique_ptr<std::string>> pending_data_;
cef_response_filter_status_t last_status_ = RESPONSE_FILTER_NEED_MORE_DATA;
DISALLOW_COPY_AND_ASSIGN(ResponseFilterWrapper);
};
ResponseFilterWrapper::ResponseFilterWrapper(

View File

@ -35,6 +35,9 @@ using OnInputStreamOpenedCallback =
class OpenInputStreamWrapper
: public base::RefCountedThreadSafe<OpenInputStreamWrapper> {
public:
OpenInputStreamWrapper(const OpenInputStreamWrapper&) = delete;
OpenInputStreamWrapper& operator=(const OpenInputStreamWrapper&) = delete;
static base::OnceClosure Open(
std::unique_ptr<StreamReaderURLLoader::Delegate> delegate,
scoped_refptr<base::SequencedTaskRunner> 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<InputStreamReader> {
std::unique_ptr<InputStream> stream,
scoped_refptr<base::SequencedTaskRunner> 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<InputStreamReader> {
int pending_callback_id_ = -1;
int next_callback_id_ = 0;
DISALLOW_COPY_AND_ASSIGN(InputStreamReader);
};
InputStreamReader::InputStreamReader(

View File

@ -118,6 +118,10 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
mojo::PendingRemote<network::mojom::TrustedHeaderClient> header_client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
std::unique_ptr<Delegate> 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<StreamReaderURLLoader> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(StreamReaderURLLoader);
};
} // namespace net_service

Some files were not shown because too many files have changed in this diff Show More