refactor: replace deprecated DISALLOW_COPY_AND_ASSIGN (#31633)

This commit is contained in:
Milan Burda 2021-11-03 12:41:45 +01:00 коммит произвёл GitHub
Родитель 2a2a1a834c
Коммит 65a980c673
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
231 изменённых файлов: 918 добавлений и 576 удалений

Просмотреть файл

@ -9,7 +9,6 @@
#include <string>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/cert/nss_cert_database.h"
@ -31,6 +30,10 @@ class CertificateManagerModel {
static void Create(content::BrowserContext* browser_context,
CreationCallback callback);
// disable copy
CertificateManagerModel(const CertificateManagerModel&) = delete;
CertificateManagerModel& operator=(const CertificateManagerModel&) = delete;
~CertificateManagerModel();
bool is_user_db_available() const { return is_user_db_available_; }
@ -108,8 +111,6 @@ class CertificateManagerModel {
// Whether the certificate database has a public slot associated with the
// profile. If not set, importing certificates is not allowed with this model.
bool is_user_db_available_;
DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel);
};
#endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_

Просмотреть файл

@ -17,6 +17,10 @@ class ElectronContentClient : public content::ContentClient {
ElectronContentClient();
~ElectronContentClient() override;
// disable copy
ElectronContentClient(const ElectronContentClient&) = delete;
ElectronContentClient& operator=(const ElectronContentClient&) = delete;
protected:
// content::ContentClient:
std::u16string GetLocalizedString(int message_id) override;
@ -30,9 +34,6 @@ class ElectronContentClient : public content::ContentClient {
void AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms,
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) override;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronContentClient);
};
} // namespace electron

Просмотреть файл

@ -9,7 +9,6 @@
#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/no_destructor.h"
#include "build/build_config.h"
#include "components/crash/core/app/crash_reporter_client.h"
@ -18,6 +17,11 @@ class ElectronCrashReporterClient : public crash_reporter::CrashReporterClient {
public:
static void Create();
// disable copy
ElectronCrashReporterClient(const ElectronCrashReporterClient&) = delete;
ElectronCrashReporterClient& operator=(const ElectronCrashReporterClient&) =
delete;
static ElectronCrashReporterClient* Get();
void SetCollectStatsConsent(bool upload_allowed);
void SetUploadUrl(const std::string& url);
@ -85,8 +89,6 @@ class ElectronCrashReporterClient : public crash_reporter::CrashReporterClient {
ElectronCrashReporterClient();
~ElectronCrashReporterClient() override;
DISALLOW_COPY_AND_ASSIGN(ElectronCrashReporterClient);
};
#endif // SHELL_APP_ELECTRON_CRASH_REPORTER_CLIENT_H_

Просмотреть файл

@ -24,6 +24,7 @@
#include <tchar.h>
#include "base/environment.h"
#include "base/macros.h"
#include "base/process/launch.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/windows_version.h"

Просмотреть файл

@ -26,6 +26,10 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
ElectronMainDelegate();
~ElectronMainDelegate() override;
// disable copy
ElectronMainDelegate(const ElectronMainDelegate&) = delete;
ElectronMainDelegate& operator=(const ElectronMainDelegate&) = delete;
protected:
// content::ContentMainDelegate:
bool BasicStartupComplete(int* exit_code) override;
@ -58,8 +62,6 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
std::unique_ptr<content::ContentRendererClient> renderer_client_;
std::unique_ptr<content::ContentUtilityClient> utility_client_;
std::unique_ptr<tracing::TracingSamplerProfiler> tracing_sampler_profiler_;
DISALLOW_COPY_AND_ASSIGN(ElectronMainDelegate);
};
} // namespace electron

Просмотреть файл

@ -22,6 +22,10 @@ class UvTaskRunner : public base::SingleThreadTaskRunner {
public:
explicit UvTaskRunner(uv_loop_t* loop);
// disable copy
UvTaskRunner(const UvTaskRunner&) = delete;
UvTaskRunner& operator=(const UvTaskRunner&) = delete;
// base::SingleThreadTaskRunner:
bool PostDelayedTask(const base::Location& from_here,
base::OnceClosure task,
@ -39,8 +43,6 @@ class UvTaskRunner : public base::SingleThreadTaskRunner {
uv_loop_t* loop_;
std::map<uv_timer_t*, base::OnceClosure> tasks_;
DISALLOW_COPY_AND_ASSIGN(UvTaskRunner);
};
} // namespace electron

Просмотреть файл

@ -79,6 +79,10 @@ class App : public ElectronBrowserClient::Delegate,
App();
// disable copy
App(const App&) = delete;
App& operator=(const App&) = delete;
private:
~App() override;
@ -261,8 +265,6 @@ class App : public ElectronBrowserClient::Delegate,
bool disable_hw_acceleration_ = false;
bool disable_domain_blocking_for_3DAPIs_ = false;
DISALLOW_COPY_AND_ASSIGN(App);
};
} // namespace api

Просмотреть файл

@ -30,6 +30,10 @@ class AutoUpdater : public gin::Wrappable<AutoUpdater>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
AutoUpdater(const AutoUpdater&) = delete;
AutoUpdater& operator=(const AutoUpdater&) = delete;
protected:
AutoUpdater();
~AutoUpdater() override;
@ -54,8 +58,6 @@ class AutoUpdater : public gin::Wrappable<AutoUpdater>,
std::string GetFeedURL();
void SetFeedURL(gin::Arguments* args);
void QuitAndInstall();
DISALLOW_COPY_AND_ASSIGN(AutoUpdater);
};
} // namespace api

Просмотреть файл

@ -54,6 +54,10 @@ class BrowserView : public gin::Wrappable<BrowserView>,
int32_t ID() const { return id_; }
// disable copy
BrowserView(const BrowserView&) = delete;
BrowserView& operator=(const BrowserView&) = delete;
protected:
BrowserView(gin::Arguments* args, const gin_helper::Dictionary& options);
~BrowserView() override;
@ -78,8 +82,6 @@ class BrowserView : public gin::Wrappable<BrowserView>,
std::unique_ptr<NativeBrowserView> view_;
int32_t id_;
DISALLOW_COPY_AND_ASSIGN(BrowserView);
};
} // namespace api

Просмотреть файл

@ -37,6 +37,10 @@ class BrowserWindow : public BaseWindow,
return weak_factory_.GetWeakPtr();
}
// disable copy
BrowserWindow(const BrowserWindow&) = delete;
BrowserWindow& operator=(const BrowserWindow&) = delete;
protected:
BrowserWindow(gin::Arguments* args, const gin_helper::Dictionary& options);
~BrowserWindow() override;
@ -123,8 +127,6 @@ class BrowserWindow : public BaseWindow,
base::WeakPtr<api::WebContents> api_web_contents_;
base::WeakPtrFactory<BrowserWindow> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(BrowserWindow);
};
} // namespace api

Просмотреть файл

@ -41,6 +41,10 @@ class Cookies : public gin::Wrappable<Cookies>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
Cookies(const Cookies&) = delete;
Cookies& operator=(const Cookies&) = delete;
protected:
Cookies(v8::Isolate* isolate, ElectronBrowserContext* browser_context);
~Cookies() override;
@ -62,8 +66,6 @@ class Cookies : public gin::Wrappable<Cookies>,
// Weak reference; ElectronBrowserContext is guaranteed to outlive us.
ElectronBrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(Cookies);
};
} // namespace api

Просмотреть файл

@ -57,6 +57,10 @@ class DataPipeReader {
~DataPipeReader() = default;
// disable copy
DataPipeReader(const DataPipeReader&) = delete;
DataPipeReader& operator=(const DataPipeReader&) = delete;
private:
// Callback invoked by DataPipeGetter::Read.
void ReadCallback(int32_t status, uint64_t size) {
@ -137,8 +141,6 @@ class DataPipeReader {
uint64_t remaining_size_ = 0;
base::WeakPtrFactory<DataPipeReader> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(DataPipeReader);
};
} // namespace

Просмотреть файл

@ -37,14 +37,16 @@ class DataPipeHolder : public gin::Wrappable<DataPipeHolder> {
// The unique ID that can be used to receive the object.
const std::string& id() const { return id_; }
// disable copy
DataPipeHolder(const DataPipeHolder&) = delete;
DataPipeHolder& operator=(const DataPipeHolder&) = delete;
private:
explicit DataPipeHolder(const network::DataElement& element);
~DataPipeHolder() override;
std::string id_;
mojo::Remote<network::mojom::DataPipeGetter> data_pipe_;
DISALLOW_COPY_AND_ASSIGN(DataPipeHolder);
};
} // namespace api

Просмотреть файл

@ -40,6 +40,10 @@ class Debugger : public gin::Wrappable<Debugger>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
Debugger(const Debugger&) = delete;
Debugger& operator=(const Debugger&) = delete;
protected:
Debugger(v8::Isolate* isolate, content::WebContents* web_contents);
~Debugger() override;
@ -68,8 +72,6 @@ class Debugger : public gin::Wrappable<Debugger>,
PendingRequestMap pending_requests_;
int previous_request_id_ = 0;
DISALLOW_COPY_AND_ASSIGN(Debugger);
};
} // namespace api

Просмотреть файл

@ -45,6 +45,10 @@ class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
DesktopCapturer(const DesktopCapturer&) = delete;
DesktopCapturer& operator=(const DesktopCapturer&) = delete;
protected:
explicit DesktopCapturer(v8::Isolate* isolate);
~DesktopCapturer() override;
@ -71,8 +75,6 @@ class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
#endif // defined(OS_WIN)
base::WeakPtrFactory<DesktopCapturer> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(DesktopCapturer);
};
} // namespace api

Просмотреть файл

@ -43,6 +43,10 @@ class DownloadItem : public gin::Wrappable<DownloadItem>,
base::FilePath GetSavePath() const;
file_dialog::DialogSettings GetSaveDialogOptions() const;
// disable copy
DownloadItem(const DownloadItem&) = delete;
DownloadItem& operator=(const DownloadItem&) = delete;
private:
DownloadItem(v8::Isolate* isolate, download::DownloadItem* item);
~DownloadItem() override;
@ -81,8 +85,6 @@ class DownloadItem : public gin::Wrappable<DownloadItem>,
v8::Isolate* isolate_;
base::WeakPtrFactory<DownloadItem> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(DownloadItem);
};
} // namespace api

Просмотреть файл

@ -29,6 +29,10 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
GlobalShortcut(const GlobalShortcut&) = delete;
GlobalShortcut& operator=(const GlobalShortcut&) = delete;
protected:
explicit GlobalShortcut(v8::Isolate* isolate);
~GlobalShortcut() override;
@ -50,8 +54,6 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
void OnKeyPressed(const ui::Accelerator& accelerator) override;
AcceleratorCallbackMap accelerator_callback_map_;
DISALLOW_COPY_AND_ASSIGN(GlobalShortcut);
};
} // namespace api

Просмотреть файл

@ -32,6 +32,10 @@ class InAppPurchase : public gin::Wrappable<InAppPurchase>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
InAppPurchase(const InAppPurchase&) = delete;
InAppPurchase& operator=(const InAppPurchase&) = delete;
protected:
InAppPurchase();
~InAppPurchase() override;
@ -45,9 +49,6 @@ class InAppPurchase : public gin::Wrappable<InAppPurchase>,
// TransactionObserver:
void OnTransactionsUpdated(
const std::vector<in_app_purchase::Transaction>& transactions) override;
private:
DISALLOW_COPY_AND_ASSIGN(InAppPurchase);
};
} // namespace api

Просмотреть файл

@ -46,6 +46,10 @@ class Menu : public gin::Wrappable<Menu>,
ElectronMenuModel* model() const { return model_.get(); }
// disable copy
Menu(const Menu&) = delete;
Menu& operator=(const Menu&) = delete;
protected:
explicit Menu(gin::Arguments* args);
~Menu() override;
@ -117,8 +121,6 @@ class Menu : public gin::Wrappable<Menu>,
bool IsEnabledAt(int index) const;
bool IsVisibleAt(int index) const;
bool WorksWhenHiddenAt(int index) const;
DISALLOW_COPY_AND_ASSIGN(Menu);
};
} // namespace api

Просмотреть файл

@ -48,8 +48,6 @@ class MenuMac : public Menu {
std::map<int32_t, scoped_nsobject<ElectronMenuController>> popup_controllers_;
base::WeakPtrFactory<MenuMac> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(MenuMac);
};
} // namespace api

Просмотреть файл

@ -37,8 +37,6 @@ class MenuViews : public Menu {
std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_;
base::WeakPtrFactory<MenuViews> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(MenuViews);
};
} // namespace api

Просмотреть файл

@ -27,6 +27,10 @@ class NativeTheme : public gin::Wrappable<NativeTheme>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
NativeTheme(const NativeTheme&) = delete;
NativeTheme& operator=(const NativeTheme&) = delete;
protected:
NativeTheme(v8::Isolate* isolate,
ui::NativeTheme* ui_theme,
@ -50,8 +54,6 @@ class NativeTheme : public gin::Wrappable<NativeTheme>,
private:
ui::NativeTheme* ui_theme_;
ui::NativeTheme* web_theme_;
DISALLOW_COPY_AND_ASSIGN(NativeTheme);
};
} // namespace api

Просмотреть файл

@ -7,7 +7,6 @@
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "gin/handle.h"
@ -45,6 +44,10 @@ class NetLog : public gin::Wrappable<NetLog> {
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
NetLog(const NetLog&) = delete;
NetLog& operator=(const NetLog&) = delete;
protected:
explicit NetLog(v8::Isolate* isolate,
ElectronBrowserContext* browser_context);
@ -68,8 +71,6 @@ class NetLog : public gin::Wrappable<NetLog> {
scoped_refptr<base::TaskRunner> file_task_runner_;
base::WeakPtrFactory<NetLog> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(NetLog);
};
} // namespace api

Просмотреть файл

@ -56,6 +56,10 @@ class Notification : public gin::Wrappable<Notification>,
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
// disable copy
Notification(const Notification&) = delete;
Notification& operator=(const Notification&) = delete;
protected:
explicit Notification(gin::Arguments* args);
~Notification() override;
@ -111,8 +115,6 @@ class Notification : public gin::Wrappable<Notification>,
electron::NotificationPresenter* presenter_;
base::WeakPtr<electron::Notification> notification_;
DISALLOW_COPY_AND_ASSIGN(Notification);
};
} // namespace api

Просмотреть файл

@ -33,6 +33,10 @@ class PowerMonitor : public gin::Wrappable<PowerMonitor>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
PowerMonitor(const PowerMonitor&) = delete;
PowerMonitor& operator=(const PowerMonitor&) = delete;
private:
explicit PowerMonitor(v8::Isolate* isolate);
~PowerMonitor() override;
@ -80,8 +84,6 @@ class PowerMonitor : public gin::Wrappable<PowerMonitor>,
#if defined(OS_LINUX)
PowerObserverLinux power_observer_linux_{this};
#endif
DISALLOW_COPY_AND_ASSIGN(PowerMonitor);
};
} // namespace api

Просмотреть файл

@ -27,6 +27,10 @@ class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> {
static gin::WrapperInfo kWrapperInfo;
// disable copy
PowerSaveBlocker(const PowerSaveBlocker&) = delete;
PowerSaveBlocker& operator=(const PowerSaveBlocker&) = delete;
protected:
explicit PowerSaveBlocker(v8::Isolate* isolate);
~PowerSaveBlocker() override;
@ -50,8 +54,6 @@ class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> {
WakeLockTypeMap wake_lock_types_;
mojo::Remote<device::mojom::WakeLock> wake_lock_;
DISALLOW_COPY_AND_ASSIGN(PowerSaveBlocker);
};
} // namespace api

Просмотреть файл

@ -34,6 +34,10 @@ class Screen : public gin::Wrappable<Screen>,
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
Screen(const Screen&) = delete;
Screen& operator=(const Screen&) = delete;
protected:
Screen(v8::Isolate* isolate, display::Screen* screen);
~Screen() override;
@ -52,8 +56,6 @@ class Screen : public gin::Wrappable<Screen>,
private:
display::Screen* screen_;
DISALLOW_COPY_AND_ASSIGN(Screen);
};
} // namespace api

Просмотреть файл

@ -43,6 +43,10 @@ class ServiceWorkerContext
v8::Isolate* isolate) override;
const char* GetTypeName() override;
// disable copy
ServiceWorkerContext(const ServiceWorkerContext&) = delete;
ServiceWorkerContext& operator=(const ServiceWorkerContext&) = delete;
protected:
explicit ServiceWorkerContext(v8::Isolate* isolate,
ElectronBrowserContext* browser_context);
@ -52,8 +56,6 @@ class ServiceWorkerContext
content::ServiceWorkerContext* service_worker_context_;
base::WeakPtrFactory<ServiceWorkerContext> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContext);
};
} // namespace api

Просмотреть файл

@ -155,6 +155,10 @@ class Session : public gin::Wrappable<Session>,
extensions::UnloadedExtensionReason reason) override;
#endif
// disable copy
Session(const Session&) = delete;
Session& operator=(const Session&) = delete;
protected:
Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context);
~Session() override;
@ -187,8 +191,6 @@ class Session : public gin::Wrappable<Session>,
base::UnguessableToken network_emulation_token_;
ElectronBrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(Session);
};
} // namespace api

Просмотреть файл

@ -121,6 +121,10 @@ class SystemPreferences
bool IsHighContrastColorScheme();
v8::Local<v8::Value> GetAnimationSettings(v8::Isolate* isolate);
// disable copy
SystemPreferences(const SystemPreferences&) = delete;
SystemPreferences& operator=(const SystemPreferences&) = delete;
protected:
SystemPreferences();
~SystemPreferences() override;
@ -162,7 +166,6 @@ class SystemPreferences
std::unique_ptr<gfx::ScopedSysColorChangeListener> color_change_listener_;
#endif
DISALLOW_COPY_AND_ASSIGN(SystemPreferences);
};
} // namespace api

Просмотреть файл

@ -52,6 +52,10 @@ class Tray : public gin::Wrappable<Tray>,
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
// disable copy
Tray(const Tray&) = delete;
Tray& operator=(const Tray&) = delete;
private:
Tray(v8::Isolate* isolate,
v8::Local<v8::Value> image,
@ -105,8 +109,6 @@ class Tray : public gin::Wrappable<Tray>,
v8::Global<v8::Value> menu_;
std::unique_ptr<TrayIcon> tray_icon_;
DISALLOW_COPY_AND_ASSIGN(Tray);
};
} // namespace api

Просмотреть файл

@ -30,6 +30,10 @@ class View : public gin_helper::Wrappable<View> {
views::View* view() const { return view_; }
// disable copy
View(const View&) = delete;
View& operator=(const View&) = delete;
protected:
explicit View(views::View* view);
View();
@ -43,8 +47,6 @@ class View : public gin_helper::Wrappable<View> {
bool delete_view_ = true;
views::View* view_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(View);
};
} // namespace api

Просмотреть файл

@ -15,6 +15,7 @@
#include "base/containers/id_map.h"
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/macros.h"
#include "base/no_destructor.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/current_thread.h"

Просмотреть файл

@ -447,6 +447,10 @@ class WebContents : public ExclusiveAccessContext,
content::PermissionType permissionType,
content::RenderFrameHost* render_frame_host);
// disable copy
WebContents(const WebContents&) = delete;
WebContents& operator=(const WebContents&) = delete;
private:
// Does not manage lifetime of |web_contents|.
WebContents(v8::Isolate* isolate, content::WebContents* web_contents);
@ -820,8 +824,6 @@ class WebContents : public ExclusiveAccessContext,
DevicePermissionMap granted_devices_;
base::WeakPtrFactory<WebContents> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(WebContents);
};
} // namespace api

Просмотреть файл

@ -51,8 +51,6 @@ class WebContentsView : public View, public content::WebContentsObserver {
// Keep a reference to v8 wrapper.
v8::Global<v8::Value> web_contents_;
api::WebContents* api_web_contents_;
DISALLOW_COPY_AND_ASSIGN(WebContentsView);
};
} // namespace api

Просмотреть файл

@ -59,6 +59,10 @@ class WebFrameMain : public gin::Wrappable<WebFrameMain>,
content::RenderFrameHost* render_frame_host() const { return render_frame_; }
// disable copy
WebFrameMain(const WebFrameMain&) = delete;
WebFrameMain& operator=(const WebFrameMain&) = delete;
protected:
explicit WebFrameMain(content::RenderFrameHost* render_frame);
~WebFrameMain() override;
@ -124,8 +128,6 @@ class WebFrameMain : public gin::Wrappable<WebFrameMain>,
bool render_frame_disposed_ = false;
base::WeakPtrFactory<WebFrameMain> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(WebFrameMain);
};
} // namespace api

Просмотреть файл

@ -29,6 +29,10 @@ class Event : public gin::Wrappable<Event> {
// `invoke` calls.
bool SendReply(v8::Isolate* isolate, v8::Local<v8::Value> result);
// disable copy
Event(const Event&) = delete;
Event& operator=(const Event&) = delete;
protected:
Event();
~Event() override;
@ -41,8 +45,6 @@ class Event : public gin::Wrappable<Event> {
private:
// Replyer for the synchronous messages.
InvokeCallback callback_;
DISALLOW_COPY_AND_ASSIGN(Event);
};
} // namespace gin_helper

Просмотреть файл

@ -38,6 +38,10 @@ class FrameSubscriber : public content::WebContentsObserver,
bool only_dirty);
~FrameSubscriber() override;
// disable copy
FrameSubscriber(const FrameSubscriber&) = delete;
FrameSubscriber& operator=(const FrameSubscriber&) = delete;
private:
void AttachToHost(content::RenderWidgetHost* host);
void DetachFromHost();
@ -69,8 +73,6 @@ class FrameSubscriber : public content::WebContentsObserver,
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;
base::WeakPtrFactory<FrameSubscriber> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(FrameSubscriber);
};
} // namespace api

Просмотреть файл

@ -22,6 +22,11 @@ class GPUInfoManager : public content::GpuDataManagerObserver {
GPUInfoManager();
~GPUInfoManager() override;
// disable copy
GPUInfoManager(const GPUInfoManager&) = delete;
GPUInfoManager& operator=(const GPUInfoManager&) = delete;
bool NeedsCompleteGpuInfoCollection() const;
void FetchCompleteInfo(gin_helper::Promise<base::DictionaryValue> promise);
void FetchBasicInfo(gin_helper::Promise<base::DictionaryValue> promise);
@ -40,8 +45,6 @@ class GPUInfoManager : public content::GpuDataManagerObserver {
std::vector<gin_helper::Promise<base::DictionaryValue>>
complete_info_promise_set_;
content::GpuDataManagerImpl* gpu_data_manager_;
DISALLOW_COPY_AND_ASSIGN(GPUInfoManager);
};
} // namespace electron

Просмотреть файл

@ -30,9 +30,6 @@ class ImageView : public View {
views::ImageView* image_view() const {
return static_cast<views::ImageView*>(view());
}
private:
DISALLOW_COPY_AND_ASSIGN(ImageView);
};
} // namespace api

Просмотреть файл

@ -8,7 +8,6 @@
#include <map>
#include <string>
#include "base/macros.h"
#include "build/build_config.h"
namespace base {
@ -53,6 +52,12 @@ class AutoUpdater {
public:
typedef std::map<std::string, std::string> HeaderMap;
AutoUpdater() = delete;
// disable copy
AutoUpdater(const AutoUpdater&) = delete;
AutoUpdater& operator=(const AutoUpdater&) = delete;
// Gets/Sets the delegate.
static Delegate* GetDelegate();
static void SetDelegate(Delegate* delegate);
@ -67,8 +72,6 @@ class AutoUpdater {
private:
static Delegate* delegate_;
DISALLOW_IMPLICIT_CONSTRUCTORS(AutoUpdater);
};
} // namespace auto_updater

Просмотреть файл

@ -8,7 +8,6 @@
#include <memory>
#include <string>
#include "base/macros.h"
#include "components/keyed_service/core/keyed_service.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@ -32,6 +31,10 @@ class BadgeManager : public KeyedService, public blink::mojom::BadgeService {
BadgeManager();
~BadgeManager() override;
// disable copy
BadgeManager(const BadgeManager&) = delete;
BadgeManager& operator=(const BadgeManager&) = delete;
static void BindFrameReceiver(
content::RenderFrameHost* frame,
mojo::PendingReceiver<blink::mojom::BadgeService> receiver);
@ -98,8 +101,6 @@ class BadgeManager : public KeyedService, public blink::mojom::BadgeService {
// Delegate which handles actual setting and clearing of the badge.
// Note: This is currently only set on Windows and MacOS.
// std::unique_ptr<BadgeManagerDelegate> delegate_;
DISALLOW_COPY_AND_ASSIGN(BadgeManager);
};
} // namespace badging

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_BADGING_BADGE_MANAGER_FACTORY_H_
#define SHELL_BROWSER_BADGING_BADGE_MANAGER_FACTORY_H_
#include "base/macros.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
namespace base {
@ -26,6 +25,10 @@ class BadgeManagerFactory : public BrowserContextKeyedServiceFactory {
// Returns the BadgeManagerFactory singleton.
static BadgeManagerFactory* GetInstance();
// disable copy
BadgeManagerFactory(const BadgeManagerFactory&) = delete;
BadgeManagerFactory& operator=(const BadgeManagerFactory&) = delete;
private:
friend struct base::DefaultSingletonTraits<BadgeManagerFactory>;
@ -35,8 +38,6 @@ class BadgeManagerFactory : public BrowserContextKeyedServiceFactory {
// BrowserContextKeyedServiceFactory
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
DISALLOW_COPY_AND_ASSIGN(BadgeManagerFactory);
};
} // namespace badging

Просмотреть файл

@ -10,7 +10,6 @@
#include <vector>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/values.h"
@ -47,6 +46,10 @@ class Browser : public WindowListObserver {
Browser();
~Browser() override;
// disable copy
Browser(const Browser&) = delete;
Browser& operator=(const Browser&) = delete;
static Browser* Get();
// Try to close all windows and quit the application.
@ -371,8 +374,6 @@ class Browser : public WindowListObserver {
// In charge of running taskbar related APIs.
TaskbarHost taskbar_host_;
#endif
DISALLOW_COPY_AND_ASSIGN(Browser);
};
} // namespace electron

Просмотреть файл

@ -14,7 +14,6 @@
#include <string>
#include "base/command_line.h"
#include "base/macros.h"
#include "chrome/browser/browser_process.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/value_map_pref_store.h"
@ -36,6 +35,10 @@ class BrowserProcessImpl : public BrowserProcess {
BrowserProcessImpl();
~BrowserProcessImpl() override;
// disable copy
BrowserProcessImpl(const BrowserProcessImpl&) = delete;
BrowserProcessImpl& operator=(const BrowserProcessImpl&) = delete;
static void ApplyProxyModeFromCommandLine(ValueMapPrefStore* pref_store);
BuildState* GetBuildState() override;
@ -109,8 +112,6 @@ class BrowserProcessImpl : public BrowserProcess {
#endif
std::unique_ptr<PrefService> local_state_;
std::string locale_;
DISALLOW_COPY_AND_ASSIGN(BrowserProcessImpl);
};
#endif // SHELL_BROWSER_BROWSER_PROCESS_IMPL_H_

Просмотреть файл

@ -17,6 +17,10 @@ struct ChildWebContentsTracker
: public content::WebContentsUserData<ChildWebContentsTracker> {
~ChildWebContentsTracker() override;
// disable copy
ChildWebContentsTracker(const ChildWebContentsTracker&) = delete;
ChildWebContentsTracker& operator=(const ChildWebContentsTracker&) = delete;
GURL url;
std::string frame_name;
content::Referrer referrer;
@ -28,8 +32,6 @@ struct ChildWebContentsTracker
friend class content::WebContentsUserData<ChildWebContentsTracker>;
WEB_CONTENTS_USER_DATA_KEY_DECL();
DISALLOW_COPY_AND_ASSIGN(ChildWebContentsTracker);
};
} // namespace electron

Просмотреть файл

@ -6,7 +6,6 @@
#define SHELL_BROWSER_COOKIE_CHANGE_NOTIFIER_H_
#include "base/callback_list.h"
#include "base/macros.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "net/cookies/cookie_change_dispatcher.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
@ -21,6 +20,10 @@ class CookieChangeNotifier : public network::mojom::CookieChangeListener {
explicit CookieChangeNotifier(ElectronBrowserContext* browser_context);
~CookieChangeNotifier() override;
// disable copy
CookieChangeNotifier(const CookieChangeNotifier&) = delete;
CookieChangeNotifier& operator=(const CookieChangeNotifier&) = delete;
// Register callbacks that needs to notified on any cookie store changes.
base::CallbackListSubscription RegisterCookieChangeCallback(
const base::RepeatingCallback<void(const net::CookieChangeInfo& change)>&
@ -38,8 +41,6 @@ class CookieChangeNotifier : public network::mojom::CookieChangeListener {
cookie_change_sub_list_;
mojo::Receiver<network::mojom::CookieChangeListener> receiver_;
DISALLOW_COPY_AND_ASSIGN(CookieChangeNotifier);
};
} // namespace electron

Просмотреть файл

@ -1146,6 +1146,10 @@ class FileURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
return pending_remote;
}
// disable copy
FileURLLoaderFactory(const FileURLLoaderFactory&) = delete;
FileURLLoaderFactory& operator=(const FileURLLoaderFactory&) = delete;
private:
explicit FileURLLoaderFactory(
int child_id,
@ -1177,8 +1181,6 @@ class FileURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
}
int child_id_;
DISALLOW_COPY_AND_ASSIGN(FileURLLoaderFactory);
};
} // namespace

Просмотреть файл

@ -49,6 +49,10 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
ElectronBrowserClient();
~ElectronBrowserClient() override;
// disable copy
ElectronBrowserClient(const ElectronBrowserClient&) = delete;
ElectronBrowserClient& operator=(const ElectronBrowserClient&) = delete;
using Delegate = content::ContentBrowserClient;
void set_delegate(Delegate* delegate) { delegate_ = delegate; }
@ -318,8 +322,6 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
#if defined(OS_MAC)
ElectronBrowserMainParts* browser_main_parts_ = nullptr;
#endif
DISALLOW_COPY_AND_ASSIGN(ElectronBrowserClient);
};
} // namespace electron

Просмотреть файл

@ -48,6 +48,10 @@ class ProtocolRegistry;
class ElectronBrowserContext : public content::BrowserContext {
public:
// disable copy
ElectronBrowserContext(const ElectronBrowserContext&) = delete;
ElectronBrowserContext& operator=(const ElectronBrowserContext&) = delete;
// partition_id => browser_context
struct PartitionKey {
std::string partition;
@ -184,8 +188,6 @@ class ElectronBrowserContext : public content::BrowserContext {
mojo::Remote<network::mojom::SSLConfigClient> ssl_config_client_;
base::WeakPtrFactory<ElectronBrowserContext> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ElectronBrowserContext);
};
} // namespace electron

Просмотреть файл

@ -8,7 +8,6 @@
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/web_contents_observer.h"
#include "electron/shell/common/api/api.mojom.h"
@ -29,6 +28,11 @@ class ElectronBrowserHandlerImpl : public mojom::ElectronBrowser,
static void Create(content::RenderFrameHost* frame_host,
mojo::PendingReceiver<mojom::ElectronBrowser> receiver);
// disable copy
ElectronBrowserHandlerImpl(const ElectronBrowserHandlerImpl&) = delete;
ElectronBrowserHandlerImpl& operator=(const ElectronBrowserHandlerImpl&) =
delete;
// mojom::ElectronBrowser:
void Message(bool internal,
const std::string& channel,
@ -74,8 +78,6 @@ class ElectronBrowserHandlerImpl : public mojom::ElectronBrowser,
mojo::Receiver<mojom::ElectronBrowser> receiver_{this};
base::WeakPtrFactory<ElectronBrowserHandlerImpl> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ElectronBrowserHandlerImpl);
};
} // namespace electron
#endif // SHELL_BROWSER_ELECTRON_BROWSER_HANDLER_IMPL_H_

Просмотреть файл

@ -76,6 +76,10 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
explicit ElectronBrowserMainParts(const content::MainFunctionParams& params);
~ElectronBrowserMainParts() override;
// disable copy
ElectronBrowserMainParts(const ElectronBrowserMainParts&) = delete;
ElectronBrowserMainParts& operator=(const ElectronBrowserMainParts&) = delete;
static ElectronBrowserMainParts* Get();
// Sets the exit code, will fail if the message loop is not ready.
@ -175,8 +179,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
#endif
static ElectronBrowserMainParts* self_;
DISALLOW_COPY_AND_ASSIGN(ElectronBrowserMainParts);
};
} // namespace electron

Просмотреть файл

@ -84,6 +84,10 @@ class ShutdownDetector : public base::PlatformThread::Delegate {
base::OnceCallback<void()> shutdown_callback,
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
// disable copy
ShutdownDetector(const ShutdownDetector&) = delete;
ShutdownDetector& operator=(const ShutdownDetector&) = delete;
// base::PlatformThread::Delegate:
void ThreadMain() override;
@ -91,8 +95,6 @@ class ShutdownDetector : public base::PlatformThread::Delegate {
const int shutdown_fd_;
base::OnceCallback<void()> shutdown_callback_;
const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
DISALLOW_COPY_AND_ASSIGN(ShutdownDetector);
};
ShutdownDetector::ShutdownDetector(

Просмотреть файл

@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "chrome/common/pref_names.h"

Просмотреть файл

@ -25,6 +25,12 @@ class ElectronDownloadManagerDelegate
explicit ElectronDownloadManagerDelegate(content::DownloadManager* manager);
~ElectronDownloadManagerDelegate() override;
// disable copy
ElectronDownloadManagerDelegate(const ElectronDownloadManagerDelegate&) =
delete;
ElectronDownloadManagerDelegate& operator=(
const ElectronDownloadManagerDelegate&) = delete;
// content::DownloadManagerDelegate:
void Shutdown() override;
bool DetermineDownloadTarget(
@ -54,8 +60,6 @@ class ElectronDownloadManagerDelegate
content::DownloadManager* download_manager_;
base::WeakPtrFactory<ElectronDownloadManagerDelegate> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ElectronDownloadManagerDelegate);
};
} // namespace electron

Просмотреть файл

@ -13,11 +13,12 @@ class ElectronGpuClient : public content::ContentGpuClient {
public:
ElectronGpuClient();
// disable copy
ElectronGpuClient(const ElectronGpuClient&) = delete;
ElectronGpuClient& operator=(const ElectronGpuClient&) = delete;
// content::ContentGpuClient:
void PreCreateMessageLoop() override;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronGpuClient);
};
} // namespace electron

Просмотреть файл

@ -14,15 +14,17 @@ class ElectronNavigationThrottle : public content::NavigationThrottle {
explicit ElectronNavigationThrottle(content::NavigationHandle* handle);
~ElectronNavigationThrottle() override;
// disable copy
ElectronNavigationThrottle(const ElectronNavigationThrottle&) = delete;
ElectronNavigationThrottle& operator=(const ElectronNavigationThrottle&) =
delete;
ElectronNavigationThrottle::ThrottleCheckResult WillStartRequest() override;
ElectronNavigationThrottle::ThrottleCheckResult WillRedirectRequest()
override;
const char* GetNameForLogging() override;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronNavigationThrottle);
};
} // namespace electron

Просмотреть файл

@ -29,6 +29,11 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
ElectronPermissionManager();
~ElectronPermissionManager() override;
// disable copy
ElectronPermissionManager(const ElectronPermissionManager&) = delete;
ElectronPermissionManager& operator=(const ElectronPermissionManager&) =
delete;
using StatusCallback =
base::OnceCallback<void(blink::mojom::PermissionStatus)>;
using StatusesCallback = base::OnceCallback<void(
@ -126,8 +131,6 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
DeviceCheckHandler device_permission_handler_;
PendingRequestsMap pending_requests_;
DISALLOW_COPY_AND_ASSIGN(ElectronPermissionManager);
};
} // namespace electron

Просмотреть файл

@ -19,6 +19,12 @@ class ElectronQuotaPermissionContext : public content::QuotaPermissionContext {
ElectronQuotaPermissionContext();
// disable copy
ElectronQuotaPermissionContext(const ElectronQuotaPermissionContext&) =
delete;
ElectronQuotaPermissionContext& operator=(
const ElectronQuotaPermissionContext&) = delete;
// content::QuotaPermissionContext:
void RequestQuotaPermission(const content::StorageQuotaParams& params,
int render_process_id,
@ -26,8 +32,6 @@ class ElectronQuotaPermissionContext : public content::QuotaPermissionContext {
private:
~ElectronQuotaPermissionContext() override;
DISALLOW_COPY_AND_ASSIGN(ElectronQuotaPermissionContext);
};
} // namespace electron

Просмотреть файл

@ -7,7 +7,6 @@
#include <vector>
#include "base/macros.h"
#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/browser/speech_recognition_manager_delegate.h"
@ -20,6 +19,12 @@ class ElectronSpeechRecognitionManagerDelegate
ElectronSpeechRecognitionManagerDelegate();
~ElectronSpeechRecognitionManagerDelegate() override;
// disable copy
ElectronSpeechRecognitionManagerDelegate(
const ElectronSpeechRecognitionManagerDelegate&) = delete;
ElectronSpeechRecognitionManagerDelegate& operator=(
const ElectronSpeechRecognitionManagerDelegate&) = delete;
// content::SpeechRecognitionEventListener:
void OnRecognitionStart(int session_id) override;
void OnAudioStart(int session_id) override;
@ -45,9 +50,6 @@ class ElectronSpeechRecognitionManagerDelegate
override;
content::SpeechRecognitionEventListener* GetEventListener() override;
bool FilterProfanities(int render_process_id) override;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronSpeechRecognitionManagerDelegate);
};
} // namespace electron

Просмотреть файл

@ -7,7 +7,6 @@
#include <memory>
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "content/public/browser/web_ui_controller_factory.h"
@ -24,6 +23,12 @@ class ElectronWebUIControllerFactory : public content::WebUIControllerFactory {
ElectronWebUIControllerFactory();
~ElectronWebUIControllerFactory() override;
// disable copy
ElectronWebUIControllerFactory(const ElectronWebUIControllerFactory&) =
delete;
ElectronWebUIControllerFactory& operator=(
const ElectronWebUIControllerFactory&) = delete;
// content::WebUIControllerFactory:
content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
const GURL& url) override;
@ -35,8 +40,6 @@ class ElectronWebUIControllerFactory : public content::WebUIControllerFactory {
private:
friend struct base::DefaultSingletonTraits<ElectronWebUIControllerFactory>;
DISALLOW_COPY_AND_ASSIGN(ElectronWebUIControllerFactory);
};
} // namespace electron

Просмотреть файл

@ -20,6 +20,10 @@ v8::Local<v8::FunctionTemplate> GetEventEmitterTemplate(v8::Isolate* isolate);
template <typename T>
class EventEmitterMixin {
public:
// disable copy
EventEmitterMixin(const EventEmitterMixin&) = delete;
EventEmitterMixin& operator=(const EventEmitterMixin&) = delete;
// this.emit(name, new Event(), args...);
// Returns true if event.preventDefault() was called during processing.
template <typename... Args>
@ -87,8 +91,6 @@ class EventEmitterMixin {
}
return false;
}
DISALLOW_COPY_AND_ASSIGN(EventEmitterMixin);
};
} // namespace gin_helper

Просмотреть файл

@ -10,7 +10,6 @@
#include <utility>
#include "base/bind.h"
#include "base/macros.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@ -44,11 +43,15 @@ class ManagementSetEnabledFunctionInstallPromptDelegate
}
~ManagementSetEnabledFunctionInstallPromptDelegate() override = default;
// disable copy
ManagementSetEnabledFunctionInstallPromptDelegate(
const ManagementSetEnabledFunctionInstallPromptDelegate&) = delete;
ManagementSetEnabledFunctionInstallPromptDelegate& operator=(
const ManagementSetEnabledFunctionInstallPromptDelegate&) = delete;
private:
base::WeakPtrFactory<ManagementSetEnabledFunctionInstallPromptDelegate>
weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ManagementSetEnabledFunctionInstallPromptDelegate);
};
class ManagementUninstallFunctionUninstallDialogDelegate
@ -63,8 +66,11 @@ class ManagementUninstallFunctionUninstallDialogDelegate
~ManagementUninstallFunctionUninstallDialogDelegate() override = default;
private:
DISALLOW_COPY_AND_ASSIGN(ManagementUninstallFunctionUninstallDialogDelegate);
// disable copy
ManagementUninstallFunctionUninstallDialogDelegate(
const ManagementUninstallFunctionUninstallDialogDelegate&) = delete;
ManagementUninstallFunctionUninstallDialogDelegate& operator=(
const ManagementUninstallFunctionUninstallDialogDelegate&) = delete;
};
} // namespace

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_EXTENSIONS_API_RESOURCES_PRIVATE_RESOURCES_PRIVATE_API_H_
#define SHELL_BROWSER_EXTENSIONS_API_RESOURCES_PRIVATE_RESOURCES_PRIVATE_API_H_
#include "base/macros.h"
#include "extensions/browser/extension_function.h"
namespace extensions {
@ -16,14 +15,17 @@ class ResourcesPrivateGetStringsFunction : public ExtensionFunction {
RESOURCESPRIVATE_GETSTRINGS)
ResourcesPrivateGetStringsFunction();
// disable copy
ResourcesPrivateGetStringsFunction(
const ResourcesPrivateGetStringsFunction&) = delete;
ResourcesPrivateGetStringsFunction& operator=(
const ResourcesPrivateGetStringsFunction&) = delete;
protected:
~ResourcesPrivateGetStringsFunction() override;
// Override from ExtensionFunction:
ExtensionFunction::ResponseAction Run() override;
private:
DISALLOW_COPY_AND_ASSIGN(ResourcesPrivateGetStringsFunction);
};
} // namespace extensions

Просмотреть файл

@ -7,7 +7,6 @@
#include <string>
#include "base/macros.h"
#include "extensions/browser/api/runtime/runtime_api_delegate.h"
namespace content {
@ -21,6 +20,11 @@ class ElectronRuntimeAPIDelegate : public RuntimeAPIDelegate {
explicit ElectronRuntimeAPIDelegate(content::BrowserContext* browser_context);
~ElectronRuntimeAPIDelegate() override;
// disable copy
ElectronRuntimeAPIDelegate(const ElectronRuntimeAPIDelegate&) = delete;
ElectronRuntimeAPIDelegate& operator=(const ElectronRuntimeAPIDelegate&) =
delete;
// RuntimeAPIDelegate implementation.
void AddUpdateObserver(UpdateObserver* observer) override;
void RemoveUpdateObserver(UpdateObserver* observer) override;
@ -33,8 +37,6 @@ class ElectronRuntimeAPIDelegate : public RuntimeAPIDelegate {
private:
content::BrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(ElectronRuntimeAPIDelegate);
};
} // namespace extensions

Просмотреть файл

@ -7,7 +7,6 @@
#include <string>
#include "base/macros.h"
#include "third_party/blink/public/mojom/loader/transferrable_url_loader.mojom.h"
namespace extensions {

Просмотреть файл

@ -11,7 +11,6 @@
#include <string>
#include "base/files/file_path.h"
#include "base/macros.h"
#include "extensions/browser/component_extension_resource_manager.h"
#include "ui/base/webui/resource_path.h"
@ -25,6 +24,12 @@ class ElectronComponentExtensionResourceManager
ElectronComponentExtensionResourceManager();
~ElectronComponentExtensionResourceManager() override;
// disable copy
ElectronComponentExtensionResourceManager(
const ElectronComponentExtensionResourceManager&) = delete;
ElectronComponentExtensionResourceManager& operator=(
const ElectronComponentExtensionResourceManager&) = delete;
// Overridden from ComponentExtensionResourceManager:
bool IsComponentExtensionResource(const base::FilePath& extension_path,
const base::FilePath& resource_path,
@ -43,8 +48,6 @@ class ElectronComponentExtensionResourceManager
// A map from an extension ID to its i18n template replacements.
std::map<std::string, ui::TemplateReplacements>
extension_template_replacements_;
DISALLOW_COPY_AND_ASSIGN(ElectronComponentExtensionResourceManager);
};
} // namespace extensions

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_EXTENSIONS_ELECTRON_DISPLAY_INFO_PROVIDER_H_
#define SHELL_BROWSER_EXTENSIONS_ELECTRON_DISPLAY_INFO_PROVIDER_H_
#include "base/macros.h"
#include "extensions/browser/api/system_display/display_info_provider.h"
namespace extensions {
@ -14,8 +13,10 @@ class ElectronDisplayInfoProvider : public DisplayInfoProvider {
public:
ElectronDisplayInfoProvider();
private:
DISALLOW_COPY_AND_ASSIGN(ElectronDisplayInfoProvider);
// disable copy
ElectronDisplayInfoProvider(const ElectronDisplayInfoProvider&) = delete;
ElectronDisplayInfoProvider& operator=(const ElectronDisplayInfoProvider&) =
delete;
};
} // namespace extensions

Просмотреть файл

@ -8,7 +8,6 @@
#include <memory>
#include <string>
#include "base/macros.h"
#include "extensions/browser/extension_host_delegate.h"
namespace extensions {
@ -19,6 +18,11 @@ class ElectronExtensionHostDelegate : public ExtensionHostDelegate {
ElectronExtensionHostDelegate();
~ElectronExtensionHostDelegate() override;
// disable copy
ElectronExtensionHostDelegate(const ElectronExtensionHostDelegate&) = delete;
ElectronExtensionHostDelegate& operator=(
const ElectronExtensionHostDelegate&) = delete;
// ExtensionHostDelegate implementation.
void OnExtensionHostCreated(content::WebContents* web_contents) override;
void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override;
@ -41,9 +45,6 @@ class ElectronExtensionHostDelegate : public ExtensionHostDelegate {
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
void ExitPictureInPicture() override;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionHostDelegate);
};
} // namespace extensions

Просмотреть файл

@ -9,7 +9,6 @@
#include <utility>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "extensions/browser/extension_registrar.h"
@ -33,6 +32,10 @@ class ElectronExtensionLoader : public ExtensionRegistrar::Delegate {
explicit ElectronExtensionLoader(content::BrowserContext* browser_context);
~ElectronExtensionLoader() override;
// disable copy
ElectronExtensionLoader(const ElectronExtensionLoader&) = delete;
ElectronExtensionLoader& operator=(const ElectronExtensionLoader&) = delete;
// Loads an unpacked extension from a directory synchronously. Returns the
// extension on success, or nullptr otherwise.
void LoadExtension(const base::FilePath& extension_dir,
@ -91,8 +94,6 @@ class ElectronExtensionLoader : public ExtensionRegistrar::Delegate {
bool did_schedule_reload_ = false;
base::WeakPtrFactory<ElectronExtensionLoader> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionLoader);
};
} // namespace extensions

Просмотреть файл

@ -8,7 +8,6 @@
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/sequenced_task_runner_helpers.h"
#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/browser_thread.h"
@ -31,6 +30,12 @@ class ElectronExtensionMessageFilter : public content::BrowserMessageFilter {
ElectronExtensionMessageFilter(int render_process_id,
content::BrowserContext* browser_context);
// disable copy
ElectronExtensionMessageFilter(const ElectronExtensionMessageFilter&) =
delete;
ElectronExtensionMessageFilter& operator=(
const ElectronExtensionMessageFilter&) = delete;
// content::BrowserMessageFilter methods:
bool OnMessageReceived(const IPC::Message& message) override;
void OverrideThreadForMessage(const IPC::Message& message,
@ -59,8 +64,6 @@ class ElectronExtensionMessageFilter : public content::BrowserMessageFilter {
// may outlive |browser_context_|, so make sure to NULL check if in doubt;
// async calls and the like.
content::BrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionMessageFilter);
};
} // namespace electron

Просмотреть файл

@ -9,7 +9,6 @@
#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/one_shot_event.h"
@ -38,6 +37,10 @@ class ElectronExtensionSystem : public ExtensionSystem {
explicit ElectronExtensionSystem(content::BrowserContext* browser_context);
~ElectronExtensionSystem() override;
// disable copy
ElectronExtensionSystem(const ElectronExtensionSystem&) = delete;
ElectronExtensionSystem& operator=(const ElectronExtensionSystem&) = delete;
// Loads an unpacked extension from a directory. Returns the extension on
// success, or nullptr otherwise.
void LoadExtension(
@ -115,8 +118,6 @@ class ElectronExtensionSystem : public ExtensionSystem {
base::OneShotEvent ready_;
base::WeakPtrFactory<ElectronExtensionSystem> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionSystem);
};
} // namespace extensions

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
#define SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_SYSTEM_FACTORY_H_
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "extensions/browser/extension_system_provider.h"
@ -20,6 +19,12 @@ class ElectronExtensionSystemFactory : public ExtensionSystemProvider {
static ElectronExtensionSystemFactory* GetInstance();
// disable copy
ElectronExtensionSystemFactory(const ElectronExtensionSystemFactory&) =
delete;
ElectronExtensionSystemFactory& operator=(
const ElectronExtensionSystemFactory&) = delete;
private:
friend struct base::DefaultSingletonTraits<ElectronExtensionSystemFactory>;
@ -32,8 +37,6 @@ class ElectronExtensionSystemFactory : public ExtensionSystemProvider {
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
bool ServiceIsCreatedWithBrowserContext() const override;
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionSystemFactory);
};
} // namespace extensions

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_WEB_CONTENTS_OBSERVER_H_
#define SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSION_WEB_CONTENTS_OBSERVER_H_
#include "base/macros.h"
#include "content/public/browser/web_contents_user_data.h"
#include "extensions/browser/extension_web_contents_observer.h"
@ -19,6 +18,12 @@ class ElectronExtensionWebContentsObserver
public:
~ElectronExtensionWebContentsObserver() override;
// disable copy
ElectronExtensionWebContentsObserver(
const ElectronExtensionWebContentsObserver&) = delete;
ElectronExtensionWebContentsObserver& operator=(
const ElectronExtensionWebContentsObserver&) = delete;
// Creates and initializes an instance of this class for the given
// |web_contents|, if it doesn't already exist.
static void CreateForWebContents(content::WebContents* web_contents);
@ -31,8 +36,6 @@ class ElectronExtensionWebContentsObserver
content::WebContents* web_contents);
WEB_CONTENTS_USER_DATA_KEY_DECL();
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionWebContentsObserver);
};
} // namespace extensions

Просмотреть файл

@ -37,15 +37,18 @@ class ElectronGuestViewManagerDelegate
: ExtensionsGuestViewManagerDelegate(context) {}
~ElectronGuestViewManagerDelegate() override = default;
// disable copy
ElectronGuestViewManagerDelegate(const ElectronGuestViewManagerDelegate&) =
delete;
ElectronGuestViewManagerDelegate& operator=(
const ElectronGuestViewManagerDelegate&) = delete;
// GuestViewManagerDelegate:
void OnGuestAdded(content::WebContents* guest_web_contents) const override {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope scope(isolate);
electron::api::WebContents::FromOrCreate(isolate, guest_web_contents);
}
private:
DISALLOW_COPY_AND_ASSIGN(ElectronGuestViewManagerDelegate);
};
class ElectronMimeHandlerViewGuestDelegate
@ -54,6 +57,12 @@ class ElectronMimeHandlerViewGuestDelegate
ElectronMimeHandlerViewGuestDelegate() = default;
~ElectronMimeHandlerViewGuestDelegate() override = default;
// disable copy
ElectronMimeHandlerViewGuestDelegate(
const ElectronMimeHandlerViewGuestDelegate&) = delete;
ElectronMimeHandlerViewGuestDelegate& operator=(
const ElectronMimeHandlerViewGuestDelegate&) = delete;
// MimeHandlerViewGuestDelegate.
bool HandleContextMenu(content::WebContents* web_contents,
const content::ContextMenuParams& params) override {
@ -63,9 +72,6 @@ class ElectronMimeHandlerViewGuestDelegate
}
void RecordLoadMetric(bool in_main_frame,
const std::string& mime_type) override {}
private:
DISALLOW_COPY_AND_ASSIGN(ElectronMimeHandlerViewGuestDelegate);
};
ElectronExtensionsAPIClient::ElectronExtensionsAPIClient() = default;

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSIONS_BROWSER_API_PROVIDER_H_
#define SHELL_BROWSER_EXTENSIONS_ELECTRON_EXTENSIONS_BROWSER_API_PROVIDER_H_
#include "base/macros.h"
#include "extensions/browser/extensions_browser_api_provider.h"
namespace extensions {
@ -16,10 +15,13 @@ class ElectronExtensionsBrowserAPIProvider
ElectronExtensionsBrowserAPIProvider();
~ElectronExtensionsBrowserAPIProvider() override;
void RegisterExtensionFunctions(ExtensionFunctionRegistry* registry) override;
// disable copy
ElectronExtensionsBrowserAPIProvider(
const ElectronExtensionsBrowserAPIProvider&) = delete;
ElectronExtensionsBrowserAPIProvider& operator=(
const ElectronExtensionsBrowserAPIProvider&) = delete;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionsBrowserAPIProvider);
void RegisterExtensionFunctions(ExtensionFunctionRegistry* registry) override;
};
} // namespace extensions

Просмотреть файл

@ -10,7 +10,6 @@
#include <vector>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/kiosk/kiosk_delegate.h"
@ -39,6 +38,12 @@ class ElectronExtensionsBrowserClient
ElectronExtensionsBrowserClient();
~ElectronExtensionsBrowserClient() override;
// disable copy
ElectronExtensionsBrowserClient(const ElectronExtensionsBrowserClient&) =
delete;
ElectronExtensionsBrowserClient& operator=(
const ElectronExtensionsBrowserClient&) = delete;
// ExtensionsBrowserClient overrides:
bool IsShuttingDown() override;
bool AreExtensionsDisabled(const base::CommandLine& command_line,
@ -138,8 +143,6 @@ class ElectronExtensionsBrowserClient
std::unique_ptr<extensions::ElectronComponentExtensionResourceManager>
resource_manager_;
DISALLOW_COPY_AND_ASSIGN(ElectronExtensionsBrowserClient);
};
} // namespace electron

Просмотреть файл

@ -18,6 +18,11 @@ class ElectronMessagingDelegate : public MessagingDelegate {
ElectronMessagingDelegate();
~ElectronMessagingDelegate() override;
// disable copy
ElectronMessagingDelegate(const ElectronMessagingDelegate&) = delete;
ElectronMessagingDelegate& operator=(const ElectronMessagingDelegate&) =
delete;
// MessagingDelegate:
PolicyPermission IsNativeMessagingHostAllowed(
content::BrowserContext* browser_context,
@ -48,9 +53,6 @@ class ElectronMessagingDelegate : public MessagingDelegate {
content::WebContents* source_contents,
const GURL& url,
base::OnceCallback<void(bool)> callback) override;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronMessagingDelegate);
};
} // namespace extensions

Просмотреть файл

@ -7,7 +7,6 @@
#include <memory>
#include "base/macros.h"
#include "content/public/browser/navigation_ui_data.h"
#include "extensions/browser/extension_navigation_ui_data.h"
@ -25,6 +24,10 @@ class ElectronNavigationUIData : public content::NavigationUIData {
content::NavigationHandle* navigation_handle);
~ElectronNavigationUIData() override;
// disable copy
ElectronNavigationUIData(const ElectronNavigationUIData&) = delete;
ElectronNavigationUIData& operator=(const ElectronNavigationUIData&) = delete;
// Creates a new ChromeNavigationUIData that is a deep copy of the original.
// Any changes to the original after the clone is created will not be
// reflected in the clone. |extension_data_| is deep copied.
@ -40,8 +43,6 @@ class ElectronNavigationUIData : public content::NavigationUIData {
private:
// Manages the lifetime of optional ExtensionNavigationUIData information.
std::unique_ptr<ExtensionNavigationUIData> extension_data_;
DISALLOW_COPY_AND_ASSIGN(ElectronNavigationUIData);
};
} // namespace extensions

Просмотреть файл

@ -6,7 +6,6 @@
#define SHELL_BROWSER_EXTENSIONS_ELECTRON_PROCESS_MANAGER_DELEGATE_H_
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/process_manager_delegate.h"
@ -23,6 +22,12 @@ class ElectronProcessManagerDelegate : public ProcessManagerDelegate {
ElectronProcessManagerDelegate();
~ElectronProcessManagerDelegate() override;
// disable copy
ElectronProcessManagerDelegate(const ElectronProcessManagerDelegate&) =
delete;
ElectronProcessManagerDelegate& operator=(
const ElectronProcessManagerDelegate&) = delete;
// ProcessManagerDelegate implementation:
bool AreBackgroundPagesAllowedForContext(
content::BrowserContext* context) const override;
@ -31,9 +36,6 @@ class ElectronProcessManagerDelegate : public ProcessManagerDelegate {
const Extension& extension) const override;
bool DeferCreatingStartupBackgroundHosts(
content::BrowserContext* context) const override;
private:
DISALLOW_COPY_AND_ASSIGN(ElectronProcessManagerDelegate);
};
} // namespace extensions

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
#define SHELL_BROWSER_FAKE_LOCATION_PROVIDER_H_
#include "base/macros.h"
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/device/public/mojom/geoposition.mojom.h"
@ -16,6 +15,10 @@ class FakeLocationProvider : public device::LocationProvider {
FakeLocationProvider();
~FakeLocationProvider() override;
// disable copy
FakeLocationProvider(const FakeLocationProvider&) = delete;
FakeLocationProvider& operator=(const FakeLocationProvider&) = delete;
// LocationProvider Implementation:
void SetUpdateCallback(
const LocationProviderUpdateCallback& callback) override;
@ -27,8 +30,6 @@ class FakeLocationProvider : public device::LocationProvider {
private:
device::mojom::Geoposition position_;
LocationProviderUpdateCallback callback_;
DISALLOW_COPY_AND_ASSIGN(FakeLocationProvider);
};
} // namespace electron

Просмотреть файл

@ -11,7 +11,6 @@
#include <vector>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/scoped_observation.h"
#include "build/build_config.h"
#include "content/public/browser/browser_thread.h"
@ -46,6 +45,10 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
public content::RenderWidgetHostObserver,
private net::DirectoryLister::DirectoryListerDelegate {
public:
// disable copy
FileSelectHelper(const FileSelectHelper&) = delete;
FileSelectHelper& operator=(const FileSelectHelper&) = delete;
// Show the file chooser dialog.
static void RunFileChooser(
content::RenderFrameHost* render_frame_host,
@ -224,8 +227,6 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
// Temporary files only used on OSX. This class is responsible for deleting
// these files when they are no longer needed.
std::vector<base::FilePath> temporary_files_;
DISALLOW_COPY_AND_ASSIGN(FileSelectHelper);
};
#endif // SHELL_BROWSER_FILE_SELECT_HELPER_H_

Просмотреть файл

@ -17,12 +17,15 @@ class ElectronFontAccessDelegate : public content::FontAccessDelegate {
ElectronFontAccessDelegate();
~ElectronFontAccessDelegate() override;
// disable copy
ElectronFontAccessDelegate(const ElectronFontAccessDelegate&) = delete;
ElectronFontAccessDelegate& operator=(const ElectronFontAccessDelegate&) =
delete;
std::unique_ptr<content::FontAccessChooser> RunChooser(
content::RenderFrameHost* frame,
const std::vector<std::string>& selection,
content::FontAccessChooser::Callback callback) override;
DISALLOW_COPY_AND_ASSIGN(ElectronFontAccessDelegate);
};
#endif // SHELL_BROWSER_FONT_ELECTRON_FONT_ACCESS_DELEGATE_H_

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_HID_HID_CHOOSER_CONTEXT_FACTORY_H_
#define SHELL_BROWSER_HID_HID_CHOOSER_CONTEXT_FACTORY_H_
#include "base/macros.h"
#include "base/no_destructor.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
@ -21,6 +20,10 @@ class HidChooserContextFactory : public BrowserContextKeyedServiceFactory {
content::BrowserContext* context);
static HidChooserContextFactory* GetInstance();
// disable copy
HidChooserContextFactory(const HidChooserContextFactory&) = delete;
HidChooserContextFactory& operator=(const HidChooserContextFactory&) = delete;
private:
friend base::NoDestructor<HidChooserContextFactory>;
@ -33,8 +36,6 @@ class HidChooserContextFactory : public BrowserContextKeyedServiceFactory {
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
void BrowserContextShutdown(content::BrowserContext* context) override;
DISALLOW_COPY_AND_ASSIGN(HidChooserContextFactory);
};
} // namespace electron

Просмотреть файл

@ -9,7 +9,6 @@
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/hid_chooser.h"

Просмотреть файл

@ -35,14 +35,19 @@ class ConvertableToTraceFormatWrapper final
std::unique_ptr<v8::ConvertableToTraceFormat> inner)
: inner_(std::move(inner)) {}
~ConvertableToTraceFormatWrapper() override = default;
// disable copy
ConvertableToTraceFormatWrapper(const ConvertableToTraceFormatWrapper&) =
delete;
ConvertableToTraceFormatWrapper& operator=(
const ConvertableToTraceFormatWrapper&) = delete;
void AppendAsTraceFormat(std::string* out) const final {
inner_->AppendAsTraceFormat(out);
}
private:
std::unique_ptr<v8::ConvertableToTraceFormat> inner_;
DISALLOW_COPY_AND_ASSIGN(ConvertableToTraceFormatWrapper);
};
} // namespace gin
@ -183,6 +188,10 @@ class EnabledStateObserverImpl final
this);
}
// disable copy
EnabledStateObserverImpl(const EnabledStateObserverImpl&) = delete;
EnabledStateObserverImpl& operator=(const EnabledStateObserverImpl&) = delete;
void OnTraceLogEnabled() final {
base::AutoLock lock(mutex_);
for (auto* o : observers_) {
@ -218,8 +227,6 @@ class EnabledStateObserverImpl final
private:
base::Lock mutex_;
std::unordered_set<v8::TracingController::TraceStateObserver*> observers_;
DISALLOW_COPY_AND_ASSIGN(EnabledStateObserverImpl);
};
base::LazyInstance<EnabledStateObserverImpl>::Leaky g_trace_state_dispatcher =
@ -230,6 +237,10 @@ class TracingControllerImpl : public node::tracing::TracingController {
TracingControllerImpl() = default;
~TracingControllerImpl() override = default;
// disable copy
TracingControllerImpl(const TracingControllerImpl&) = delete;
TracingControllerImpl& operator=(const TracingControllerImpl&) = delete;
// TracingController implementation.
const uint8_t* GetCategoryGroupEnabled(const char* name) override {
return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(name);
@ -306,9 +317,6 @@ class TracingControllerImpl : public node::tracing::TracingController {
void RemoveTraceStateObserver(TraceStateObserver* observer) override {
g_trace_state_dispatcher.Get().RemoveObserver(observer);
}
private:
DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl);
};
v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) {

Просмотреть файл

@ -7,7 +7,6 @@
#include <memory>
#include "base/macros.h"
#include "gin/public/isolate_holder.h"
#include "uv.h" // NOLINT(build/include_directory)
#include "v8/include/v8-locker.h"
@ -26,6 +25,10 @@ class JavascriptEnvironment {
explicit JavascriptEnvironment(uv_loop_t* event_loop);
~JavascriptEnvironment();
// disable copy
JavascriptEnvironment(const JavascriptEnvironment&) = delete;
JavascriptEnvironment& operator=(const JavascriptEnvironment&) = delete;
void OnMessageLoopCreated();
void OnMessageLoopDestroying();
@ -48,8 +51,6 @@ class JavascriptEnvironment {
v8::Global<v8::Context> context_;
std::unique_ptr<MicrotasksRunner> microtasks_runner_;
DISALLOW_COPY_AND_ASSIGN(JavascriptEnvironment);
};
// Manage the Node Environment automatically.
@ -58,12 +59,14 @@ class NodeEnvironment {
explicit NodeEnvironment(node::Environment* env);
~NodeEnvironment();
// disable copy
NodeEnvironment(const NodeEnvironment&) = delete;
NodeEnvironment& operator=(const NodeEnvironment&) = delete;
node::Environment* env() { return env_; }
private:
node::Environment* env_;
DISALLOW_COPY_AND_ASSIGN(NodeEnvironment);
};
} // namespace electron

Просмотреть файл

@ -25,6 +25,10 @@ class BluetoothChooser : public content::BluetoothChooser {
const EventHandler& handler);
~BluetoothChooser() override;
// disable copy
BluetoothChooser(const BluetoothChooser&) = delete;
BluetoothChooser& operator=(const BluetoothChooser&) = delete;
// content::BluetoothChooser:
void SetAdapterPresence(AdapterPresence presence) override;
void ShowDiscoveryState(DiscoveryState state) override;
@ -43,8 +47,6 @@ class BluetoothChooser : public content::BluetoothChooser {
int num_retries_ = 0;
bool refreshing_ = false;
bool rescan_ = false;
DISALLOW_COPY_AND_ASSIGN(BluetoothChooser);
};
} // namespace electron

Просмотреть файл

@ -8,7 +8,6 @@
#include <string>
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/power_monitor/power_observer.h"
#include "dbus/bus.h"
@ -22,6 +21,10 @@ class PowerObserverLinux {
explicit PowerObserverLinux(base::PowerSuspendObserver* suspend_observer);
~PowerObserverLinux();
// disable copy
PowerObserverLinux(const PowerObserverLinux&) = delete;
PowerObserverLinux& operator=(const PowerObserverLinux&) = delete;
void SetShutdownHandler(base::RepeatingCallback<bool()> should_shutdown);
private:
@ -46,8 +49,6 @@ class PowerObserverLinux {
base::ScopedFD sleep_lock_;
base::ScopedFD shutdown_lock_;
base::WeakPtrFactory<PowerObserverLinux> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(PowerObserverLinux);
};
} // namespace electron

Просмотреть файл

@ -33,6 +33,10 @@ class LoginHandler : public content::LoginDelegate,
LoginAuthRequiredCallback auth_required_callback);
~LoginHandler() override;
// disable copy
LoginHandler(const LoginHandler&) = delete;
LoginHandler& operator=(const LoginHandler&) = delete;
private:
void EmitEvent(net::AuthChallengeInfo auth_info,
bool is_main_frame,
@ -44,8 +48,6 @@ class LoginHandler : public content::LoginDelegate,
LoginAuthRequiredCallback auth_required_callback_;
base::WeakPtrFactory<LoginHandler> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(LoginHandler);
};
} // namespace electron

Просмотреть файл

@ -47,6 +47,10 @@ class TransactionObserver {
TransactionObserver();
virtual ~TransactionObserver();
// disable copy
TransactionObserver(const TransactionObserver&) = delete;
TransactionObserver& operator=(const TransactionObserver&) = delete;
virtual void OnTransactionsUpdated(
const std::vector<Transaction>& transactions) = 0;
@ -54,8 +58,6 @@ class TransactionObserver {
InAppTransactionObserver* observer_;
base::WeakPtrFactory<TransactionObserver> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(TransactionObserver);
};
} // namespace in_app_purchase

Просмотреть файл

@ -67,6 +67,11 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver {
blink::mojom::MediaStreamType stream_type,
bool is_secure) override;
// disable copy
MediaCaptureDevicesDispatcher(const MediaCaptureDevicesDispatcher&) = delete;
MediaCaptureDevicesDispatcher& operator=(
const MediaCaptureDevicesDispatcher&) = delete;
private:
friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
@ -81,8 +86,6 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver {
// Flag used by unittests to disable device enumeration.
bool is_device_enumeration_disabled_ = false;
DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher);
};
} // namespace electron

Просмотреть файл

@ -7,7 +7,6 @@
#include <string>
#include "base/macros.h"
#include "components/prefs/pref_member.h"
class PrefRegistrySimple;
@ -23,6 +22,10 @@ class MediaDeviceIDSalt {
explicit MediaDeviceIDSalt(PrefService* pref_service);
~MediaDeviceIDSalt();
// disable copy
MediaDeviceIDSalt(const MediaDeviceIDSalt&) = delete;
MediaDeviceIDSalt& operator=(const MediaDeviceIDSalt&) = delete;
std::string GetSalt();
static void RegisterPrefs(PrefRegistrySimple* pref_registry);
@ -30,8 +33,6 @@ class MediaDeviceIDSalt {
private:
StringPrefMember media_device_id_salt_;
DISALLOW_COPY_AND_ASSIGN(MediaDeviceIDSalt);
};
} // namespace electron

Просмотреть файл

@ -17,6 +17,11 @@ class MediaStreamDevicesController {
virtual ~MediaStreamDevicesController();
// disable copy
MediaStreamDevicesController(const MediaStreamDevicesController&) = delete;
MediaStreamDevicesController& operator=(const MediaStreamDevicesController&) =
delete;
// Accept or deny the request based on the default policy.
bool TakeAction();
@ -37,8 +42,6 @@ class MediaStreamDevicesController {
bool microphone_requested_;
bool webcam_requested_;
DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController);
};
} // namespace electron

Просмотреть файл

@ -7,7 +7,6 @@
#include <vector>
#include "base/macros.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "shell/common/api/api.mojom.h"
@ -33,6 +32,10 @@ class NativeBrowserView : public content::WebContentsObserver {
public:
~NativeBrowserView() override;
// disable copy
NativeBrowserView(const NativeBrowserView&) = delete;
NativeBrowserView& operator=(const NativeBrowserView&) = delete;
static NativeBrowserView* Create(
InspectableWebContents* inspectable_web_contents);
@ -65,9 +68,6 @@ class NativeBrowserView : public content::WebContentsObserver {
InspectableWebContents* inspectable_web_contents_;
std::vector<mojom::DraggableRegionPtr> draggable_regions_;
private:
DISALLOW_COPY_AND_ASSIGN(NativeBrowserView);
};
} // namespace electron

Просмотреть файл

@ -29,8 +29,6 @@ class NativeBrowserViewMac : public NativeBrowserView {
void UpdateDraggableRegions(
const std::vector<gfx::Rect>& drag_exclude_rects) override;
DISALLOW_COPY_AND_ASSIGN(NativeBrowserViewMac);
};
} // namespace electron

Просмотреть файл

@ -52,8 +52,6 @@ class NativeBrowserViewViews : public NativeBrowserView {
float auto_vertical_proportion_top_ = 0.;
std::unique_ptr<SkRegion> draggable_region_;
DISALLOW_COPY_AND_ASSIGN(NativeBrowserViewViews);
};
} // namespace electron

Просмотреть файл

@ -57,6 +57,10 @@ class NativeWindow : public base::SupportsUserData,
public:
~NativeWindow() override;
// disable copy
NativeWindow(const NativeWindow&) = delete;
NativeWindow& operator=(const NativeWindow&) = delete;
// Create window with existing WebContents, the caller is responsible for
// managing the window's live.
static NativeWindow* Create(const gin_helper::Dictionary& options,
@ -412,8 +416,6 @@ class NativeWindow : public base::SupportsUserData,
gfx::Rect overlay_rect_;
base::WeakPtrFactory<NativeWindow> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(NativeWindow);
};
// This class provides a hook to get a NativeWindow from a WebContents.

Просмотреть файл

@ -282,8 +282,6 @@ class NativeWindowMac : public NativeWindow,
// The presentation options before entering simple fullscreen mode.
NSApplicationPresentationOptions simple_fullscreen_options_;
DISALLOW_COPY_AND_ASSIGN(NativeWindowMac);
};
} // namespace electron

Просмотреть файл

@ -136,6 +136,10 @@ class NativeWindowClientView : public views::ClientView {
: views::ClientView(widget, root_view), window_(window) {}
~NativeWindowClientView() override = default;
// disable copy
NativeWindowClientView(const NativeWindowClientView&) = delete;
NativeWindowClientView& operator=(const NativeWindowClientView&) = delete;
views::CloseRequestResult OnWindowCloseRequested() override {
window_->NotifyWindowCloseButtonClicked();
return views::CloseRequestResult::kCannotClose;
@ -143,8 +147,6 @@ class NativeWindowClientView : public views::ClientView {
private:
NativeWindowViews* window_;
DISALLOW_COPY_AND_ASSIGN(NativeWindowClientView);
};
} // namespace

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше