refactor: replace deprecated DISALLOW_COPY_AND_ASSIGN (#31633)

This commit is contained in:
Milan Burda 2021-11-03 12:41:45 +01:00 committed by GitHub
parent 2a2a1a834c
commit 65a980c673
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
231 changed files with 918 additions and 576 deletions

View file

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

View file

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

View file

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

View file

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

View file

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