Reland "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"

This reverts commit 3f87250a4f.

Reason for revert: Downstream is fixed

Original change's description:
> Revert "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
>
> This reverts commit 5f0eb93d2a.
>
> Reason for revert: Breaks downstream project. I'm going to fix that one and create a reland of this CL after.
>
> Original change's description:
> > Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
> >
> > Bug: webrtc:13555, webrtc:13082
> > Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Artem Titov <titovartem@webrtc.org>
> > Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
> > Cr-Commit-Position: refs/heads/main@{#35805}
>
> TBR=hta@webrtc.org,titovartem@webrtc.org,daniel.l@hpcnt.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I33d497f1132adfe6d151023195a388d9b7d548f9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:13555, webrtc:13082
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249364
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35807}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:13555, webrtc:13082
Change-Id: I7ef1ef3b6e3c41b1a96014aa75f003c0fcf33949
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249365
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35814}
This commit is contained in:
Artem Titov 2022-01-26 15:01:10 +00:00 committed by WebRTC LUCI CQ
parent f3a381adcd
commit 6cae2d5513
77 changed files with 257 additions and 232 deletions

View file

@ -112,14 +112,6 @@ specific_include_rules = {
"+rtc_base/ref_count.h",
],
"jsep_ice_candidate\.h": [
"+rtc_base/constructor_magic.h",
],
"jsep_session_description\.h": [
"+rtc_base/constructor_magic.h",
],
"media_stream_interface\.h": [
"+modules/audio_processing/include/audio_processing_statistics.h",
"+rtc_base/ref_count.h",
@ -156,7 +148,6 @@ specific_include_rules = {
],
"ref_counted_base\.h": [
"+rtc_base/constructor_magic.h",
"+rtc_base/ref_count.h",
"+rtc_base/ref_counter.h",
],
@ -195,7 +186,6 @@ specific_include_rules = {
],
"stats_types\.h": [
"+rtc_base/constructor_magic.h",
"+rtc_base/ref_count.h",
"+rtc_base/thread_checker.h",
],
@ -204,17 +194,12 @@ specific_include_rules = {
"+rtc_base/ref_count.h",
],
"audio_frame\.h": [
"+rtc_base/constructor_magic.h",
],
"audio_mixer\.h": [
"+rtc_base/ref_count.h",
],
"audio_decoder\.h": [
"+rtc_base/buffer.h",
"+rtc_base/constructor_magic.h",
],
"audio_decoder_factory\.h": [

View file

@ -23,7 +23,6 @@
#include "call/adaptation/video_source_restrictions.h"
#include "call/adaptation/video_stream_input_state.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"

View file

@ -15,8 +15,6 @@
#include <memory>
#include "rtc_base/constructor_magic.h"
namespace webrtc {
// Format conversion (remixing and resampling) for audio. Only simple remixing
@ -35,6 +33,9 @@ class AudioConverter {
size_t dst_frames);
virtual ~AudioConverter() {}
AudioConverter(const AudioConverter&) = delete;
AudioConverter& operator=(const AudioConverter&) = delete;
// Convert `src`, containing `src_size` samples, to `dst`, having a sample
// capacity of `dst_capacity`. Both point to a series of buffers containing
// the samples for each channel. The sizes must correspond to the format
@ -64,8 +65,6 @@ class AudioConverter {
const size_t src_frames_;
const size_t dst_channels_;
const size_t dst_frames_;
RTC_DISALLOW_COPY_AND_ASSIGN(AudioConverter);
};
} // namespace webrtc

View file

@ -17,7 +17,6 @@
#include <memory>
#include "common_audio/resampler/sinc_resampler.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -33,6 +32,9 @@ class PushSincResampler : public SincResamplerCallback {
PushSincResampler(size_t source_frames, size_t destination_frames);
~PushSincResampler() override;
PushSincResampler(const PushSincResampler&) = delete;
PushSincResampler& operator=(const PushSincResampler&) = delete;
// Perform the resampling. `source_frames` must always equal the
// `source_frames` provided at construction. `destination_capacity` must be
// at least as large as `destination_frames`. Returns the number of samples
@ -72,8 +74,6 @@ class PushSincResampler : public SincResamplerCallback {
// Used to assert we are only requested for as much data as is available.
size_t source_available_;
RTC_DISALLOW_COPY_AND_ASSIGN(PushSincResampler);
};
} // namespace webrtc

View file

@ -18,7 +18,6 @@
#include <memory>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/gtest_prod_util.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/system/arch.h"
@ -64,6 +63,9 @@ class SincResampler {
SincResamplerCallback* read_cb);
virtual ~SincResampler();
SincResampler(const SincResampler&) = delete;
SincResampler& operator=(const SincResampler&) = delete;
// Resample `frames` of data from `read_cb_` into `destination`.
void Resample(size_t frames, float* destination);
@ -172,8 +174,6 @@ class SincResampler {
float* const r2_;
float* r3_;
float* r4_;
RTC_DISALLOW_COPY_AND_ASSIGN(SincResampler);
};
} // namespace webrtc

View file

@ -15,7 +15,6 @@
#define COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_
#include "common_audio/resampler/sinc_resampler.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -33,6 +32,10 @@ class SinusoidalLinearChirpSource : public SincResamplerCallback {
~SinusoidalLinearChirpSource() override {}
SinusoidalLinearChirpSource(const SinusoidalLinearChirpSource&) = delete;
SinusoidalLinearChirpSource& operator=(const SinusoidalLinearChirpSource&) =
delete;
void Run(size_t frames, float* destination) override;
double Frequency(size_t position);
@ -46,8 +49,6 @@ class SinusoidalLinearChirpSource : public SincResamplerCallback {
double k_;
size_t current_index_;
double delay_samples_;
RTC_DISALLOW_COPY_AND_ASSIGN(SinusoidalLinearChirpSource);
};
} // namespace webrtc

View file

@ -23,7 +23,6 @@
#include "examples/peerconnection/client/main_wnd.h"
#include "examples/peerconnection/client/peer_connection_client.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ssl_adapter.h"
#include "rtc_base/string_utils.h" // For ToUtf8
#include "rtc_base/win32_socket_init.h"
@ -40,6 +39,9 @@ class WindowsCommandLineArguments {
public:
WindowsCommandLineArguments();
WindowsCommandLineArguments(const WindowsCommandLineArguments&) = delete;
WindowsCommandLineArguments& operator=(WindowsCommandLineArguments&) = delete;
int argc() { return argv_.size(); }
char** argv() { return argv_.data(); }
@ -48,9 +50,6 @@ class WindowsCommandLineArguments {
std::vector<std::string> args_;
// Pointers, to get layout compatible with char** argv.
std::vector<char*> argv_;
private:
RTC_DISALLOW_COPY_AND_ASSIGN(WindowsCommandLineArguments);
};
WindowsCommandLineArguments::WindowsCommandLineArguments() {

View file

@ -22,7 +22,6 @@
#include "logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.h"
#include "logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/event.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"

View file

@ -64,7 +64,9 @@ class VoiceEngineInterface : public RtpHeaderExtensionQueryInterface {
public:
VoiceEngineInterface() = default;
virtual ~VoiceEngineInterface() = default;
RTC_DISALLOW_COPY_AND_ASSIGN(VoiceEngineInterface);
VoiceEngineInterface(const VoiceEngineInterface&) = delete;
VoiceEngineInterface& operator=(const VoiceEngineInterface&) = delete;
// Initialization
// Starts the engine.
@ -98,7 +100,9 @@ class VideoEngineInterface : public RtpHeaderExtensionQueryInterface {
public:
VideoEngineInterface() = default;
virtual ~VideoEngineInterface() = default;
RTC_DISALLOW_COPY_AND_ASSIGN(VideoEngineInterface);
VideoEngineInterface(const VideoEngineInterface&) = delete;
VideoEngineInterface& operator=(const VideoEngineInterface&) = delete;
// Creates a video media channel, paired with the specified voice channel.
// Returns NULL on failure.

View file

@ -54,7 +54,6 @@
#include "absl/algorithm/container.h"
#include "media/base/rid_description.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/unique_id_generator.h"
namespace cricket {

View file

@ -19,7 +19,6 @@
#include "api/video/video_source_interface.h"
#include "common_video/framerate_controller.h"
#include "media/base/video_common.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread_annotations.h"
@ -38,6 +37,9 @@ class RTC_EXPORT VideoAdapter {
explicit VideoAdapter(int source_resolution_alignment);
virtual ~VideoAdapter();
VideoAdapter(const VideoAdapter&) = delete;
VideoAdapter& operator=(const VideoAdapter&) = delete;
// Return the adapted resolution and cropping parameters given the
// input resolution. The input frame should first be cropped, then
// scaled to the final output resolution. Returns true if the frame
@ -146,8 +148,6 @@ class RTC_EXPORT VideoAdapter {
// The critical section to protect the above variables.
mutable webrtc::Mutex mutex_;
RTC_DISALLOW_COPY_AND_ASSIGN(VideoAdapter);
};
} // namespace cricket

View file

@ -22,7 +22,6 @@
#include "absl/types/optional.h"
#include "rtc_base/buffer.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/task_utils/pending_task_safety_flag.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
@ -76,6 +75,9 @@ class UsrsctpTransport : public SctpTransportInternal,
rtc::PacketTransportInternal* transport);
~UsrsctpTransport() override;
UsrsctpTransport(const UsrsctpTransport&) = delete;
UsrsctpTransport& operator=(const UsrsctpTransport&) = delete;
// SctpTransportInternal overrides (see sctptransportinternal.h for comments).
void SetDtlsTransport(rtc::PacketTransportInternal* transport) override;
bool Start(int local_port, int remote_port, int max_message_size) override;
@ -285,8 +287,6 @@ class UsrsctpTransport : public SctpTransportInternal,
uintptr_t id_ = 0;
friend class UsrsctpTransportMap;
RTC_DISALLOW_COPY_AND_ASSIGN(UsrsctpTransport);
};
class UsrsctpTransportMap;

View file

@ -58,6 +58,9 @@ class SimulatedPacketTransport final : public rtc::PacketTransportInternal {
SignalWritableState(this);
}
SimulatedPacketTransport(const SimulatedPacketTransport&) = delete;
SimulatedPacketTransport& operator=(const SimulatedPacketTransport&) = delete;
const std::string& transport_name() const override { return transport_name_; }
bool writable() const override { return destination_ != nullptr; }
@ -129,7 +132,6 @@ class SimulatedPacketTransport final : public rtc::PacketTransportInternal {
std::atomic<SimulatedPacketTransport*> destination_ ATOMIC_VAR_INIT(nullptr);
webrtc::Random random_;
webrtc::ScopedTaskSafety task_safety_;
RTC_DISALLOW_COPY_AND_ASSIGN(SimulatedPacketTransport);
};
/**
@ -156,6 +158,9 @@ class SctpDataSender final {
RTC_DCHECK(transport_);
}
SctpDataSender(const SctpDataSender&) = delete;
SctpDataSender& operator=(const SctpDataSender&) = delete;
void Start() {
thread_->PostTask(ToQueuedTask(task_safety_.flag(), [this] {
if (started_) {
@ -236,7 +241,6 @@ class SctpDataSender final {
std::atomic<uint64_t> num_bytes_sent_ ATOMIC_VAR_INIT(0);
absl::optional<std::string> last_error_;
webrtc::ScopedTaskSafetyDetached task_safety_;
RTC_DISALLOW_COPY_AND_ASSIGN(SctpDataSender);
};
/**
@ -251,6 +255,9 @@ class SctpDataReceiver final : public sigslot::has_slots<> {
: receiver_id_(receiver_id),
target_messages_count_(target_messages_count) {}
SctpDataReceiver(const SctpDataReceiver&) = delete;
SctpDataReceiver& operator=(const SctpDataReceiver&) = delete;
void OnDataReceived(const cricket::ReceiveDataParams& params,
const rtc::CopyOnWriteBuffer& data) {
num_bytes_received_ += data.size();
@ -278,7 +285,6 @@ class SctpDataReceiver final : public sigslot::has_slots<> {
rtc::Event received_target_messages_count_{true, false};
const uint32_t receiver_id_;
const uint64_t target_messages_count_;
RTC_DISALLOW_COPY_AND_ASSIGN(SctpDataReceiver);
};
/**
@ -297,6 +303,9 @@ class ThreadPool final {
}
}
ThreadPool(const ThreadPool&) = delete;
ThreadPool& operator=(const ThreadPool&) = delete;
rtc::Thread* GetRandomThread() {
return threads_[random_.Rand(0U, threads_.size() - 1)].get();
}
@ -304,7 +313,6 @@ class ThreadPool final {
private:
webrtc::Random random_;
std::vector<std::unique_ptr<rtc::Thread>> threads_;
RTC_DISALLOW_COPY_AND_ASSIGN(ThreadPool);
};
/**
@ -360,6 +368,9 @@ class SctpPingPong final {
});
}
SctpPingPong(const SctpPingPong&) = delete;
SctpPingPong& operator=(const SctpPingPong&) = delete;
bool Start() {
CreateTwoConnectedSctpTransportsWithAllStreams();
@ -577,7 +588,6 @@ class SctpPingPong final {
const uint8_t packet_loss_percents_;
const uint16_t avg_send_delay_millis_;
const webrtc::SendDataParams send_params_;
RTC_DISALLOW_COPY_AND_ASSIGN(SctpPingPong);
};
/**

View file

@ -15,7 +15,6 @@
#include "modules/audio_coding/audio_network_adaptor/controller.h"
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ignore_wundef.h"
#include "rtc_base/system/file_wrapper.h"
#if WEBRTC_ENABLE_PROTOBUF

View file

@ -14,7 +14,6 @@
#include <vector>
#include "common_audio/vad/mock/mock_vad.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "test/gtest.h"
#include "test/mock_audio_encoder.h"
@ -50,6 +49,9 @@ class AudioEncoderCngTest : public ::testing::Test {
EXPECT_CALL(*mock_encoder_, NumChannels()).WillRepeatedly(Return(1));
}
AudioEncoderCngTest(const AudioEncoderCngTest&) = delete;
AudioEncoderCngTest& operator=(const AudioEncoderCngTest&) = delete;
void TearDown() override {
EXPECT_CALL(*mock_vad_, Die()).Times(1);
cng_.reset();
@ -208,8 +210,6 @@ class AudioEncoderCngTest : public ::testing::Test {
rtc::Buffer encoded_;
AudioEncoder::EncodedInfo encoded_info_;
int sample_rate_hz_;
RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderCngTest);
};
TEST_F(AudioEncoderCngTest, CreateAndDestroy) {

View file

@ -15,7 +15,6 @@
#include <string.h>
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
// This file provides macros for creating "symbol table" classes to simplify the
// dynamic loading of symbols from DLLs. Currently the implementation only
@ -55,6 +54,9 @@ class LateBindingSymbolTable {
~LateBindingSymbolTable() { Unload(); }
LateBindingSymbolTable(const LateBindingSymbolTable&) = delete;
LateBindingSymbolTable& operator=(LateBindingSymbolTable&) = delete;
static int NumSymbols() { return SYMBOL_TABLE_SIZE; }
// We do not use this, but we offer it for theoretical convenience.
@ -109,8 +111,6 @@ class LateBindingSymbolTable {
DllHandle handle_;
bool undefined_symbols_;
void* symbols_[SYMBOL_TABLE_SIZE];
RTC_DISALLOW_COPY_AND_ASSIGN(LateBindingSymbolTable);
};
// This macro must be invoked in a header to declare a symbol table class.

View file

@ -19,7 +19,6 @@
#include "modules/audio_processing/aec3/aec3_common.h"
#include "modules/audio_processing/aec3/aec_state.h"
#include "modules/audio_processing/aec3/fft_data.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/arch.h"
namespace webrtc {

View file

@ -19,7 +19,6 @@
#include "modules/audio_processing/aec3/render_buffer.h"
#include "modules/audio_processing/aec3/spectrum_buffer.h"
#include "modules/audio_processing/aec3/stationarity_estimator.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {

View file

@ -20,7 +20,6 @@
#include "api/array_view.h"
#include "api/audio/echo_canceller3_config.h"
#include "modules/audio_processing/aec3/aec3_common.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {

View file

@ -17,7 +17,6 @@
#include "modules/audio_processing/agc2/fixed_digital_level_estimator.h"
#include "modules/audio_processing/agc2/interpolated_gain_curve.h"
#include "modules/audio_processing/include/audio_frame_view.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
class ApmDataDumper;

View file

@ -30,7 +30,6 @@
#include "modules/audio_processing/optionally_built_submodule_creators.h"
#include "rtc_base/atomic_ops.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h"
#include "rtc_base/ref_counted_object.h"
#include "rtc_base/time_utils.h"

View file

@ -30,7 +30,6 @@
#include "api/scoped_refptr.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
#include "rtc_base/arraysize.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/system/file_wrapper.h"
#include "rtc_base/system/rtc_export.h"

View file

@ -22,7 +22,6 @@
#include "common_audio/include/audio_util.h"
#include "common_audio/wav_file.h"
#include "modules/audio_processing/test/conversational_speech/wavreader_interface.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "test/testsupport/file_utils.h"

View file

@ -17,7 +17,6 @@
#include <utility>
#include "modules/audio_processing/test/conversational_speech/multiend_call.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
namespace test {

View file

@ -16,7 +16,6 @@
#include <memory>
#include "modules/desktop_capture/desktop_frame.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -26,6 +25,9 @@ class DesktopFrameWin : public DesktopFrame {
public:
~DesktopFrameWin() override;
DesktopFrameWin(const DesktopFrameWin&) = delete;
DesktopFrameWin& operator=(const DesktopFrameWin&) = delete;
static std::unique_ptr<DesktopFrameWin>
Create(DesktopSize size, SharedMemoryFactory* shared_memory_factory, HDC hdc);
@ -40,8 +42,6 @@ class DesktopFrameWin : public DesktopFrame {
HBITMAP bitmap_;
std::unique_ptr<SharedMemory> owned_shared_memory_;
RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrameWin);
};
} // namespace webrtc

View file

@ -15,7 +15,6 @@
#include "modules/desktop_capture/desktop_capturer.h"
#include "modules/desktop_capture/linux/wayland/screencast_portal.h"
#include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -25,6 +24,9 @@ class BaseCapturerPipeWire : public DesktopCapturer,
BaseCapturerPipeWire(const DesktopCaptureOptions& options);
~BaseCapturerPipeWire() override;
BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete;
BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete;
// DesktopCapturer interface.
void Start(Callback* delegate) override;
void CaptureFrame() override;
@ -42,8 +44,6 @@ class BaseCapturerPipeWire : public DesktopCapturer,
Callback* callback_ = nullptr;
bool capturer_failed_ = false;
std::unique_ptr<ScreenCastPortal> screencast_portal_;
RTC_DISALLOW_COPY_AND_ASSIGN(BaseCapturerPipeWire);
};
} // namespace webrtc

View file

@ -29,7 +29,6 @@
#include "modules/desktop_capture/screen_capture_frame_queue.h"
#include "modules/desktop_capture/screen_capturer_helper.h"
#include "modules/desktop_capture/shared_desktop_frame.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -46,6 +45,9 @@ class ScreenCapturerX11 : public DesktopCapturer,
ScreenCapturerX11();
~ScreenCapturerX11() override;
ScreenCapturerX11(const ScreenCapturerX11&) = delete;
ScreenCapturerX11& operator=(const ScreenCapturerX11&) = delete;
static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer(
const DesktopCaptureOptions& options);
@ -138,8 +140,6 @@ class ScreenCapturerX11 : public DesktopCapturer,
DesktopRegion last_invalid_region_;
std::unique_ptr<XAtomCache> atom_cache_;
RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerX11);
};
} // namespace webrtc

View file

@ -17,7 +17,6 @@
#include "api/ref_counted_base.h"
#include "api/scoped_refptr.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
// Including Xlib.h will involve evil defines (Bool, Status, True, False), which
@ -65,6 +64,9 @@ class RTC_EXPORT SharedXDisplay
~SharedXDisplay();
SharedXDisplay(const SharedXDisplay&) = delete;
SharedXDisplay& operator=(const SharedXDisplay&) = delete;
protected:
// Takes ownership of `display`.
explicit SharedXDisplay(Display* display);
@ -75,8 +77,6 @@ class RTC_EXPORT SharedXDisplay
Display* display_;
EventHandlersMap event_handlers_;
RTC_DISALLOW_COPY_AND_ASSIGN(SharedXDisplay);
};
} // namespace webrtc

View file

@ -25,7 +25,6 @@
#include "modules/desktop_capture/linux/x11/window_finder_x11.h"
#include "modules/desktop_capture/linux/x11/x_atom_cache.h"
#include "modules/desktop_capture/linux/x11/x_server_pixel_buffer.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -35,6 +34,9 @@ class WindowCapturerX11 : public DesktopCapturer,
explicit WindowCapturerX11(const DesktopCaptureOptions& options);
~WindowCapturerX11() override;
WindowCapturerX11(const WindowCapturerX11&) = delete;
WindowCapturerX11& operator=(const WindowCapturerX11&) = delete;
static std::unique_ptr<DesktopCapturer> CreateRawWindowCapturer(
const DesktopCaptureOptions& options);
@ -65,8 +67,6 @@ class WindowCapturerX11 : public DesktopCapturer,
XServerPixelBuffer x_server_pixel_buffer_;
XAtomCache atom_cache_;
WindowFinderX11 window_finder_;
RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerX11);
};
} // namespace webrtc

View file

@ -19,7 +19,6 @@
#include "modules/desktop_capture/linux/x11/x_error_trap.h"
#include "modules/desktop_capture/linux/x11/x_window_property.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h"
namespace webrtc {

View file

@ -13,8 +13,6 @@
#include <X11/Xlib.h>
#include "rtc_base/constructor_magic.h"
namespace webrtc {
// Helper class that registers X Window error handler. Caller can use
@ -24,14 +22,15 @@ class XErrorTrap {
explicit XErrorTrap(Display* display);
~XErrorTrap();
XErrorTrap(const XErrorTrap&) = delete;
XErrorTrap& operator=(const XErrorTrap&) = delete;
// Returns last error and removes unregisters the error handler.
int GetLastErrorAndDisable();
private:
XErrorHandler original_error_handler_;
bool enabled_;
RTC_DISALLOW_COPY_AND_ASSIGN(XErrorTrap);
};
} // namespace webrtc

View file

@ -20,7 +20,6 @@
#include <vector>
#include "modules/desktop_capture/desktop_geometry.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -34,6 +33,9 @@ class XServerPixelBuffer {
XServerPixelBuffer();
~XServerPixelBuffer();
XServerPixelBuffer(const XServerPixelBuffer&) = delete;
XServerPixelBuffer& operator=(const XServerPixelBuffer&) = delete;
void Release();
// Allocate (or reallocate) the pixel buffer for `window`. Returns false in
@ -80,8 +82,6 @@ class XServerPixelBuffer {
GC shm_gc_ = nullptr;
bool xshm_get_image_succeeded_ = false;
std::vector<uint8_t> icc_profile_;
RTC_DISALLOW_COPY_AND_ASSIGN(XServerPixelBuffer);
};
} // namespace webrtc

View file

@ -14,8 +14,6 @@
#include <X11/X.h>
#include <X11/Xlib.h>
#include "rtc_base/constructor_magic.h"
namespace webrtc {
class XWindowPropertyBase {
@ -26,6 +24,9 @@ class XWindowPropertyBase {
int expected_size);
virtual ~XWindowPropertyBase();
XWindowPropertyBase(const XWindowPropertyBase&) = delete;
XWindowPropertyBase& operator=(const XWindowPropertyBase&) = delete;
// True if we got properly value successfully.
bool is_valid() const { return is_valid_; }
@ -38,8 +39,6 @@ class XWindowPropertyBase {
private:
bool is_valid_ = false;
unsigned long size_ = 0; // NOLINT: type required by XGetWindowProperty
RTC_DISALLOW_COPY_AND_ASSIGN(XWindowPropertyBase);
};
// Convenience wrapper for XGetWindowProperty() results.
@ -50,12 +49,13 @@ class XWindowProperty : public XWindowPropertyBase {
: XWindowPropertyBase(display, window, property, sizeof(PropertyType)) {}
~XWindowProperty() override = default;
XWindowProperty(const XWindowProperty&) = delete;
XWindowProperty& operator=(const XWindowProperty&) = delete;
const PropertyType* data() const {
return reinterpret_cast<PropertyType*>(data_);
}
PropertyType* data() { return reinterpret_cast<PropertyType*>(data_); }
RTC_DISALLOW_COPY_AND_ASSIGN(XWindowProperty);
};
} // namespace webrtc

View file

@ -15,7 +15,6 @@
#include "modules/desktop_capture/mac/desktop_frame_provider.h"
#include "modules/desktop_capture/mac/window_list_utils.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h"
#include "rtc_base/time_utils.h"
#include "rtc_base/trace_event.h"

View file

@ -25,7 +25,6 @@
#include "modules/desktop_capture/rgba_color.h"
#include "modules/desktop_capture/screen_drawer.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h"
#include "rtc_base/third_party/base64/base64.h"
#include "test/gmock.h"

View file

@ -15,7 +15,6 @@
#include <string>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -24,6 +23,9 @@ class RTC_EXPORT Desktop {
public:
~Desktop();
Desktop(const Desktop&) = delete;
Desktop& operator=(const Desktop&) = delete;
// Returns the name of the desktop represented by the object. Return false if
// quering the name failed for any reason.
bool GetName(std::wstring* desktop_name_out) const;
@ -56,8 +58,6 @@ class RTC_EXPORT Desktop {
// True if `desktop_` must be closed on teardown.
bool own_;
RTC_DISALLOW_COPY_AND_ASSIGN(Desktop);
};
} // namespace webrtc

View file

@ -13,8 +13,6 @@
#include <windows.h>
#include "rtc_base/constructor_magic.h"
namespace webrtc {
namespace win {
@ -27,6 +25,9 @@ class ScopedGDIObject {
~ScopedGDIObject() { Traits::Close(handle_); }
ScopedGDIObject(const ScopedGDIObject&) = delete;
ScopedGDIObject& operator=(const ScopedGDIObject&) = delete;
T Get() { return handle_; }
void Set(T object) {
@ -50,8 +51,6 @@ class ScopedGDIObject {
private:
T handle_;
RTC_DISALLOW_COPY_AND_ASSIGN(ScopedGDIObject);
};
// The traits class that uses DeleteObject() to close a handle.

View file

@ -15,7 +15,6 @@
#include <memory>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -27,6 +26,9 @@ class RTC_EXPORT ScopedThreadDesktop {
ScopedThreadDesktop();
~ScopedThreadDesktop();
ScopedThreadDesktop(const ScopedThreadDesktop&) = delete;
ScopedThreadDesktop& operator=(const ScopedThreadDesktop&) = delete;
// Returns true if `desktop` has the same desktop name as the currently
// assigned desktop (if assigned) or as the initial desktop (if not assigned).
// Returns false in any other case including failing Win32 APIs and
@ -46,8 +48,6 @@ class RTC_EXPORT ScopedThreadDesktop {
// The desktop handle assigned to the calling thread at creation.
std::unique_ptr<Desktop> initial_;
RTC_DISALLOW_COPY_AND_ASSIGN(ScopedThreadDesktop);
};
} // namespace webrtc

View file

@ -23,7 +23,6 @@
#include "modules/desktop_capture/screen_capture_frame_queue.h"
#include "modules/desktop_capture/win/dxgi_duplicator_controller.h"
#include "modules/desktop_capture/win/dxgi_frame.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -74,6 +73,9 @@ class RTC_EXPORT ScreenCapturerWinDirectx : public DesktopCapturer {
~ScreenCapturerWinDirectx() override;
ScreenCapturerWinDirectx(const ScreenCapturerWinDirectx&) = delete;
ScreenCapturerWinDirectx& operator=(const ScreenCapturerWinDirectx&) = delete;
// DesktopCapturer implementation.
void Start(Callback* callback) override;
void SetSharedMemoryFactory(
@ -88,8 +90,6 @@ class RTC_EXPORT ScreenCapturerWinDirectx : public DesktopCapturer {
std::unique_ptr<SharedMemoryFactory> shared_memory_factory_;
Callback* callback_ = nullptr;
SourceId current_screen_id_ = kFullDesktopScreenId;
RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinDirectx);
};
} // namespace webrtc

View file

@ -20,7 +20,6 @@
#include "modules/desktop_capture/shared_desktop_frame.h"
#include "modules/desktop_capture/win/display_configuration_monitor.h"
#include "modules/desktop_capture/win/scoped_thread_desktop.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -35,6 +34,9 @@ class ScreenCapturerWinGdi : public DesktopCapturer {
explicit ScreenCapturerWinGdi(const DesktopCaptureOptions& options);
~ScreenCapturerWinGdi() override;
ScreenCapturerWinGdi(const ScreenCapturerWinGdi&) = delete;
ScreenCapturerWinGdi& operator=(const ScreenCapturerWinGdi&) = delete;
// Overridden from ScreenCapturer:
void Start(Callback* callback) override;
void SetSharedMemoryFactory(
@ -74,8 +76,6 @@ class ScreenCapturerWinGdi : public DesktopCapturer {
HMODULE dwmapi_library_ = NULL;
DwmEnableCompositionFunc composition_func_ = nullptr;
RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi);
};
} // namespace webrtc

View file

@ -22,7 +22,6 @@
#include "modules/desktop_capture/screen_capturer_helper.h"
#include "modules/desktop_capture/shared_desktop_frame.h"
#include "modules/desktop_capture/win/scoped_thread_desktop.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -42,6 +41,10 @@ class ScreenCapturerWinMagnifier : public DesktopCapturer {
ScreenCapturerWinMagnifier();
~ScreenCapturerWinMagnifier() override;
ScreenCapturerWinMagnifier(const ScreenCapturerWinMagnifier&) = delete;
ScreenCapturerWinMagnifier& operator=(const ScreenCapturerWinMagnifier&) =
delete;
// Overridden from ScreenCapturer:
void Start(Callback* callback) override;
void SetSharedMemoryFactory(
@ -130,8 +133,6 @@ class ScreenCapturerWinMagnifier : public DesktopCapturer {
// True if the last OnMagImageScalingCallback was called and handled
// successfully. Reset at the beginning of each CaptureImage call.
bool magnifier_capture_succeeded_ = true;
RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinMagnifier);
};
} // namespace webrtc

View file

@ -17,7 +17,6 @@
#include "modules/desktop_capture/desktop_capturer.h"
#include "modules/desktop_capture/desktop_geometry.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -104,6 +103,9 @@ class WindowCaptureHelperWin {
WindowCaptureHelperWin();
~WindowCaptureHelperWin();
WindowCaptureHelperWin(const WindowCaptureHelperWin&) = delete;
WindowCaptureHelperWin& operator=(const WindowCaptureHelperWin&) = delete;
bool IsAeroEnabled();
bool IsWindowChromeNotification(HWND hwnd);
bool AreWindowsOverlapping(HWND hwnd,
@ -127,8 +129,6 @@ class WindowCaptureHelperWin {
// Only used on Win10+.
Microsoft::WRL::ComPtr<IVirtualDesktopManager> virtual_desktop_manager_;
RTC_DISALLOW_COPY_AND_ASSIGN(WindowCaptureHelperWin);
};
} // namespace webrtc

View file

@ -11,7 +11,6 @@
#include "modules/desktop_capture/desktop_capturer.h"
#include "modules/desktop_capture/desktop_frame.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
@ -22,6 +21,9 @@ class WindowCapturerNull : public DesktopCapturer {
WindowCapturerNull();
~WindowCapturerNull() override;
WindowCapturerNull(const WindowCapturerNull&) = delete;
WindowCapturerNull& operator=(const WindowCapturerNull&) = delete;
// DesktopCapturer interface.
void Start(Callback* callback) override;
void CaptureFrame() override;
@ -30,8 +32,6 @@ class WindowCapturerNull : public DesktopCapturer {
private:
Callback* callback_ = nullptr;
RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerNull);
};
WindowCapturerNull::WindowCapturerNull() {}

View file

@ -128,7 +128,6 @@
#include <stack>
#include <string>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#define BWE_TEST_LOGGING_GLOBAL_CONTEXT(name) \
@ -341,6 +340,10 @@ class Logging {
Logging();
~Logging();
Logging(const Logging&) = delete;
Logging& operator=(const Logging&) = delete;
void PushState(const std::string& append_to_tag,
int64_t timestamp_ms,
bool enabled);
@ -348,8 +351,6 @@ class Logging {
Mutex mutex_;
ThreadMap thread_map_;
RTC_DISALLOW_COPY_AND_ASSIGN(Logging);
};
} // namespace bwe
} // namespace testing

View file

@ -27,7 +27,6 @@
#include "api/sequence_checker.h"
#include "pc/session_description.h"
#include "rtc_base/buffer.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ssl_stream_adapter.h"
// Forward declaration to avoid pulling in libsrtp headers here

View file

@ -18,7 +18,6 @@
#include <string>
#include "rtc_base/buffer.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ssl_certificate.h"
#include "rtc_base/ssl_identity.h"
@ -42,6 +41,9 @@ class OpenSSLCertificate final : public SSLCertificate {
~OpenSSLCertificate() override;
OpenSSLCertificate(const OpenSSLCertificate&) = delete;
OpenSSLCertificate& operator=(const OpenSSLCertificate&) = delete;
std::unique_ptr<SSLCertificate> Clone() const override;
X509* x509() const { return x509_; }
@ -70,7 +72,6 @@ class OpenSSLCertificate final : public SSLCertificate {
private:
X509* x509_; // NOT OWNED
RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate);
};
} // namespace rtc

View file

@ -17,7 +17,6 @@
#include <memory>
#include <string>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/openssl_certificate.h"
#include "rtc_base/openssl_key_pair.h"
#include "rtc_base/ssl_certificate.h"
@ -43,6 +42,9 @@ class OpenSSLIdentity final : public SSLIdentity {
const std::string& certificate_chain);
~OpenSSLIdentity() override;
OpenSSLIdentity(const OpenSSLIdentity&) = delete;
OpenSSLIdentity& operator=(const OpenSSLIdentity&) = delete;
const OpenSSLCertificate& certificate() const override;
const SSLCertChain& cert_chain() const override;
@ -66,8 +68,6 @@ class OpenSSLIdentity final : public SSLIdentity {
std::unique_ptr<OpenSSLKeyPair> key_pair_;
std::unique_ptr<SSLCertChain> cert_chain_;
RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity);
};
} // namespace rtc

View file

@ -35,7 +35,6 @@
// EXPECT_EQ("hello", capture);
// /* See unit-tests for more examples */
#include "rtc_base/constructor_magic.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
namespace rtc {
@ -47,13 +46,14 @@ class SigslotTester0 : public sigslot::has_slots<> {
signal->connect(this, &SigslotTester0::OnSignalCallback);
}
SigslotTester0(const SigslotTester0&) = delete;
SigslotTester0& operator=(const SigslotTester0&) = delete;
int callback_count() const { return callback_count_; }
private:
void OnSignalCallback() { callback_count_++; }
int callback_count_;
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester0);
};
// Versions below are for testing signals that pass arguments. For all the
@ -78,6 +78,9 @@ class SigslotTester$i : public sigslot::has_slots<> {
signal->connect(this, &SigslotTester$i::OnSignalCallback);
}
SigslotTester$i(const SigslotTester$i&) = delete;
SigslotTester$i& operator=(const SigslotTester$i&) = delete;
int callback_count() const { return callback_count_; }
private:
@ -91,9 +94,6 @@ class SigslotTester$i : public sigslot::has_slots<> {
int callback_count_;$for j [[
C$j* capture$j[[]]_;]]
RTC_DISALLOW_COPY_AND_ASSIGN(SigslotTester$i);
};
]]

View file

@ -34,7 +34,6 @@
#include "api/task_queue/task_queue_base.h"
#include "rtc_base/arraysize.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/event.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
@ -122,6 +121,9 @@ class MultimediaTimer {
::CloseHandle(event_);
}
MultimediaTimer(const MultimediaTimer&) = delete;
MultimediaTimer& operator=(const MultimediaTimer&) = delete;
bool StartOneShotTimer(UINT delay_ms) {
RTC_DCHECK_EQ(0, timer_id_);
RTC_DCHECK(event_ != nullptr);
@ -148,8 +150,6 @@ class MultimediaTimer {
private:
HANDLE event_ = nullptr;
MMRESULT timer_id_ = 0;
RTC_DISALLOW_COPY_AND_ASSIGN(MultimediaTimer);
};
class TaskQueueWin : public TaskQueueBase {

View file

@ -15,8 +15,6 @@
#include <string>
#include "rtc_base/constructor_magic.h"
typedef void* HANDLE;
namespace rtc {
@ -105,6 +103,9 @@ class OSInfo {
WOW64_UNKNOWN,
};
OSInfo(const OSInfo&) = delete;
OSInfo& operator=(const OSInfo&) = delete;
static OSInfo* GetInstance();
Version version() const { return version_; }
@ -140,8 +141,6 @@ class OSInfo {
size_t allocation_granularity_;
WOW64Status wow64_status_;
std::string processor_model_name_;
RTC_DISALLOW_COPY_AND_ASSIGN(OSInfo);
};
// Because this is by far the most commonly-requested value from the above

View file

@ -15,7 +15,6 @@
#include <string>
#include "absl/types/optional.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ignore_wundef.h"
#ifdef WEBRTC_NETWORK_TESTER_PROTO
@ -39,12 +38,14 @@ class ConfigReader {
explicit ConfigReader(const std::string& config_file_path);
~ConfigReader();
ConfigReader(const ConfigReader&) = delete;
ConfigReader& operator=(const ConfigReader&) = delete;
absl::optional<Config> GetNextConfig();
private:
NetworkTesterAllConfigs proto_all_configs_;
int proto_config_index_;
RTC_DISALLOW_COPY_AND_ASSIGN(ConfigReader);
};
} // namespace webrtc

View file

@ -14,7 +14,6 @@
#include <fstream>
#include <string>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ignore_wundef.h"
#ifdef WEBRTC_NETWORK_TESTER_PROTO
@ -33,12 +32,13 @@ class PacketLogger {
explicit PacketLogger(const std::string& log_file_path);
~PacketLogger();
PacketLogger(const PacketLogger&) = delete;
PacketLogger& operator=(const PacketLogger&) = delete;
void LogPacket(const NetworkTesterPacket& packet);
private:
std::ofstream packet_logger_stream_;
RTC_DISALLOW_COPY_AND_ASSIGN(PacketLogger);
};
} // namespace webrtc

View file

@ -16,7 +16,6 @@
#include "api/sequence_checker.h"
#include "api/task_queue/task_queue_factory.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ignore_wundef.h"
#include "rtc_base/system/no_unique_address.h"
#include "rtc_base/task_queue.h"
@ -40,6 +39,9 @@ class PacketSender {
const std::string& config_file_path);
~PacketSender();
PacketSender(const PacketSender&) = delete;
PacketSender& operator=(const PacketSender&) = delete;
void StartSending();
void StopSending();
bool IsSending() const;
@ -59,8 +61,6 @@ class PacketSender {
TestController* const test_controller_;
std::unique_ptr<TaskQueueFactory> task_queue_factory_;
rtc::TaskQueue worker_queue_;
RTC_DISALLOW_COPY_AND_ASSIGN(PacketSender);
};
} // namespace webrtc

View file

@ -22,7 +22,6 @@
#include "api/sequence_checker.h"
#include "p2p/base/basic_packet_socket_factory.h"
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ignore_wundef.h"
#include "rtc_base/socket_address.h"
#include "rtc_base/synchronization/mutex.h"
@ -51,6 +50,9 @@ class TestController : public sigslot::has_slots<> {
const std::string& config_file_path,
const std::string& log_file_path);
TestController(const TestController&) = delete;
TestController& operator=(const TestController&) = delete;
void Run();
void SendConnectTo(const std::string& hostname, int port);
@ -80,8 +82,6 @@ class TestController : public sigslot::has_slots<> {
std::unique_ptr<rtc::AsyncPacketSocket> udp_socket_;
rtc::SocketAddress remote_address_;
std::unique_ptr<PacketSender> packet_sender_;
RTC_DISALLOW_COPY_AND_ASSIGN(TestController);
};
} // namespace webrtc

View file

@ -19,7 +19,6 @@
#include "absl/strings/string_view.h"
#include "logging/rtc_event_log/rtc_event_log_parser.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_tools/rtc_event_log_visualizer/analyzer_common.h"
namespace webrtc {
@ -49,6 +48,9 @@ class TriageHelper {
public:
explicit TriageHelper(const AnalyzerConfig& config) : config_(config) {}
TriageHelper(const TriageHelper&) = delete;
TriageHelper& operator=(const TriageHelper&) = delete;
void AnalyzeLog(const ParsedRtcEventLog& parsed_log);
void AnalyzeStreamGaps(const ParsedRtcEventLog& parsed_log,
@ -80,7 +82,6 @@ class TriageHelper {
it->second.count += 1;
}
}
RTC_DISALLOW_COPY_AND_ASSIGN(TriageHelper);
};
} // namespace webrtc

View file

@ -15,7 +15,6 @@
#include <random>
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/null_socket_server.h"
#include "rtc_base/thread.h"
#include "test/gtest.h"
@ -88,6 +87,9 @@ class IncrementThread : public Thread {
explicit IncrementThread(int* value)
: Thread(std::make_unique<NullSocketServer>()), value_(value) {}
IncrementThread(const IncrementThread&) = delete;
IncrementThread& operator=(const IncrementThread&) = delete;
void Run() override {
++*value_;
Thread::Current()->SleepMs(100);
@ -98,8 +100,6 @@ class IncrementThread : public Thread {
private:
int* value_;
RTC_DISALLOW_COPY_AND_ASSIGN(IncrementThread);
};
void DataRace() {

View file

@ -57,6 +57,9 @@ class Iterable {
~Iterable();
Iterable(const Iterable&) = delete;
Iterable& operator=(const Iterable&) = delete;
class Iterator {
public:
// Creates an iterator representing the end of any collection.
@ -71,6 +74,9 @@ class Iterable {
~Iterator();
Iterator(const Iterator&) = delete;
Iterator& operator=(const Iterator&) = delete;
// Move assignment should not be used.
Iterator& operator=(Iterator&&) = delete;
@ -96,8 +102,6 @@ class Iterable {
ScopedJavaLocalRef<jobject> iterator_;
ScopedJavaLocalRef<jobject> value_;
SequenceChecker thread_checker_;
RTC_DISALLOW_COPY_AND_ASSIGN(Iterator);
};
Iterable::Iterator begin() { return Iterable::Iterator(jni_, iterable_); }
@ -106,8 +110,6 @@ class Iterable {
private:
JNIEnv* jni_;
ScopedJavaLocalRef<jobject> iterable_;
RTC_DISALLOW_COPY_AND_ASSIGN(Iterable);
};
// Returns true if `obj` == null in Java.

View file

@ -15,9 +15,9 @@
#define SDK_ANDROID_NATIVE_API_JNI_SCOPED_JAVA_REF_H_
#include <jni.h>
#include <utility>
#include "rtc_base/constructor_magic.h"
#include "sdk/android/native_api/jni/jvm.h"
namespace webrtc {
@ -34,6 +34,9 @@ class JavaRef;
template <>
class JavaRef<jobject> {
public:
JavaRef(const JavaRef&) = delete;
JavaRef& operator=(const JavaRef&) = delete;
jobject obj() const { return obj_; }
bool is_null() const {
// This is not valid for weak references. For weak references you need to
@ -49,22 +52,19 @@ class JavaRef<jobject> {
constexpr JavaRef() : obj_(nullptr) {}
explicit JavaRef(jobject obj) : obj_(obj) {}
jobject obj_;
private:
RTC_DISALLOW_COPY_AND_ASSIGN(JavaRef);
};
template <typename T>
class JavaRef : public JavaRef<jobject> {
public:
JavaRef(const JavaRef&) = delete;
JavaRef& operator=(const JavaRef&) = delete;
T obj() const { return static_cast<T>(obj_); }
protected:
JavaRef() : JavaRef<jobject>(nullptr) {}
explicit JavaRef(T obj) : JavaRef<jobject>(obj) {}
private:
RTC_DISALLOW_COPY_AND_ASSIGN(JavaRef);
};
// Holds a local reference to a JNI method parameter.
@ -79,8 +79,8 @@ class JavaParamRef : public JavaRef<T> {
explicit JavaParamRef(T obj) : JavaRef<T>(obj) {}
JavaParamRef(JNIEnv*, T obj) : JavaRef<T>(obj) {}
private:
RTC_DISALLOW_COPY_AND_ASSIGN(JavaParamRef);
JavaParamRef(const JavaParamRef&) = delete;
JavaParamRef& operator=(const JavaParamRef&) = delete;
};
// Holds a local reference to a Java object. The local reference is scoped
@ -186,6 +186,9 @@ class ScopedJavaGlobalRef : public JavaRef<T> {
AttachCurrentThreadIfNeeded()->DeleteGlobalRef(obj_);
}
ScopedJavaGlobalRef(const ScopedJavaGlobalRef&) = delete;
ScopedJavaGlobalRef& operator=(const ScopedJavaGlobalRef&) = delete;
void operator=(const JavaRef<T>& other) {
JNIEnv* env = AttachCurrentThreadIfNeeded();
if (obj_ != nullptr) {
@ -209,9 +212,6 @@ class ScopedJavaGlobalRef : public JavaRef<T> {
obj_ = nullptr;
return obj;
}
private:
RTC_DISALLOW_COPY_AND_ASSIGN(ScopedJavaGlobalRef);
};
template <typename T>

View file

@ -31,10 +31,13 @@ class Demuxer {
public:
explicit Demuxer(const std::map<uint8_t, MediaType>& payload_type_map);
~Demuxer() = default;
Demuxer(const Demuxer&) = delete;
Demuxer& operator=(const Demuxer&) = delete;
MediaType GetMediaType(const uint8_t* packet_data,
size_t packet_length) const;
const std::map<uint8_t, MediaType> payload_type_map_;
RTC_DISALLOW_COPY_AND_ASSIGN(Demuxer);
};
// Objects of this class are expected to be allocated and destroyed on the

View file

@ -11,7 +11,6 @@
#ifndef TEST_MAC_VIDEO_RENDERER_MAC_H_
#define TEST_MAC_VIDEO_RENDERER_MAC_H_
#include "rtc_base/constructor_magic.h"
#include "test/gl/gl_renderer.h"
@class CocoaWindow;
@ -24,6 +23,9 @@ class MacRenderer : public GlRenderer {
MacRenderer();
virtual ~MacRenderer();
MacRenderer(const MacRenderer&) = delete;
MacRenderer& operator=(const MacRenderer&) = delete;
bool Init(const char* window_title, int width, int height);
// Implements GlRenderer.
@ -31,8 +33,6 @@ class MacRenderer : public GlRenderer {
private:
CocoaWindow* window_;
RTC_DISALLOW_COPY_AND_ASSIGN(MacRenderer);
};
} // namespace test
} // namespace webrtc

View file

@ -26,7 +26,6 @@
#include "api/test/network_emulation_manager.h"
#include "api/test/simulated_network.h"
#include "api/units/timestamp.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/network.h"
#include "rtc_base/network_constants.h"
@ -467,7 +466,9 @@ class EmulatedNetworkNode : public EmulatedNetworkReceiverInterface {
rtc::TaskQueue* task_queue,
std::unique_ptr<NetworkBehaviorInterface> network_behavior);
~EmulatedNetworkNode() override;
RTC_DISALLOW_COPY_AND_ASSIGN(EmulatedNetworkNode);
EmulatedNetworkNode(const EmulatedNetworkNode&) = delete;
EmulatedNetworkNode& operator=(const EmulatedNetworkNode&) = delete;
void OnPacketReceived(EmulatedIpPacket packet) override;

View file

@ -18,7 +18,6 @@
#include "modules/rtp_rtcp/source/rtp_util.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/format_macros.h"
#include "rtc_base/logging.h"
#include "rtc_base/system/arch.h"
@ -118,6 +117,9 @@ class RtpDumpReader : public RtpFileReaderImpl {
}
}
RtpDumpReader(const RtpDumpReader&) = delete;
RtpDumpReader& operator=(const RtpDumpReader&) = delete;
bool Init(FILE* file, const std::set<uint32_t>& ssrc_filter) override {
file_ = file;
@ -187,8 +189,6 @@ class RtpDumpReader : public RtpFileReaderImpl {
private:
FILE* file_;
RTC_DISALLOW_COPY_AND_ASSIGN(RtpDumpReader);
};
enum {
@ -253,6 +253,9 @@ class PcapReader : public RtpFileReaderImpl {
}
}
PcapReader(const PcapReader&) = delete;
PcapReader& operator=(const PcapReader&) = delete;
bool Init(FILE* file, const std::set<uint32_t>& ssrc_filter) override {
return Initialize(file, ssrc_filter) == kResultSuccess;
}
@ -619,8 +622,6 @@ class PcapReader : public RtpFileReaderImpl {
SsrcMap packets_by_ssrc_;
std::vector<RtpPacketMarker> packets_;
PacketIterator next_packet_it_;
RTC_DISALLOW_COPY_AND_ASSIGN(PcapReader);
};
RtpFileReaderImpl* CreateReaderForFormat(RtpFileReader::FileFormat format) {

View file

@ -16,7 +16,6 @@
#include <string>
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
namespace webrtc {
namespace test {
@ -39,6 +38,9 @@ class RtpDumpWriter : public RtpFileWriter {
}
}
RtpDumpWriter(const RtpDumpWriter&) = delete;
RtpDumpWriter& operator=(const RtpDumpWriter&) = delete;
bool WritePacket(const RtpPacket* packet) override {
uint16_t len = static_cast<uint16_t>(packet->length + kPacketHeaderSize);
uint16_t plen = static_cast<uint16_t>(packet->original_length);
@ -86,8 +88,6 @@ class RtpDumpWriter : public RtpFileWriter {
}
FILE* file_;
RTC_DISALLOW_COPY_AND_ASSIGN(RtpDumpWriter);
};
RtpFileWriter* RtpFileWriter::Create(FileFormat format,

View file

@ -13,7 +13,6 @@
#include <string>
#include <vector>
#include "rtc_base/constructor_magic.h"
#include "test/scenario/call_client.h"
#include "test/scenario/column_printer.h"
#include "test/scenario/network_node.h"
@ -26,8 +25,11 @@ namespace test {
// stream if neccessary.
class SendAudioStream {
public:
RTC_DISALLOW_COPY_AND_ASSIGN(SendAudioStream);
~SendAudioStream();
SendAudioStream(const SendAudioStream&) = delete;
SendAudioStream& operator=(const SendAudioStream&) = delete;
void Start();
void Stop();
void SetMuted(bool mute);
@ -50,8 +52,11 @@ class SendAudioStream {
// ReceiveAudioStream represents an audio receiver. It can't be used directly.
class ReceiveAudioStream {
public:
RTC_DISALLOW_COPY_AND_ASSIGN(ReceiveAudioStream);
~ReceiveAudioStream();
ReceiveAudioStream(const ReceiveAudioStream&) = delete;
ReceiveAudioStream& operator=(const ReceiveAudioStream&) = delete;
void Start();
void Stop();
AudioReceiveStream::Stats GetStats() const;
@ -74,8 +79,11 @@ class ReceiveAudioStream {
// the Scenario class.
class AudioStreamPair {
public:
RTC_DISALLOW_COPY_AND_ASSIGN(AudioStreamPair);
~AudioStreamPair();
AudioStreamPair(const AudioStreamPair&) = delete;
AudioStreamPair& operator=(const AudioStreamPair&) = delete;
SendAudioStream* send() { return &send_stream_; }
ReceiveAudioStream* receive() { return &receive_stream_; }

View file

@ -22,7 +22,6 @@
#include "call/call.h"
#include "modules/audio_device/include/test_audio_device.h"
#include "modules/congestion_controller/goog_cc/test/goog_cc_printer.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/task_queue_for_test.h"
#include "test/logging/log_writer.h"
#include "test/network/network_emulation.h"
@ -68,8 +67,14 @@ class LoggingNetworkControllerFactory
public:
LoggingNetworkControllerFactory(LogWriterFactoryInterface* log_writer_factory,
TransportControllerConfig config);
RTC_DISALLOW_COPY_AND_ASSIGN(LoggingNetworkControllerFactory);
~LoggingNetworkControllerFactory();
LoggingNetworkControllerFactory(const LoggingNetworkControllerFactory&) =
delete;
LoggingNetworkControllerFactory& operator=(
const LoggingNetworkControllerFactory&) = delete;
std::unique_ptr<NetworkControllerInterface> Create(
NetworkControllerConfig config) override;
TimeDelta GetProcessInterval() const override;
@ -99,9 +104,12 @@ class CallClient : public EmulatedNetworkReceiverInterface {
CallClient(TimeController* time_controller,
std::unique_ptr<LogWriterFactoryInterface> log_writer_factory,
CallClientConfig config);
RTC_DISALLOW_COPY_AND_ASSIGN(CallClient);
~CallClient();
CallClient(const CallClient&) = delete;
CallClient& operator=(const CallClient&) = delete;
ColumnPrinter StatsPrinter();
Call::Stats GetStats();
DataRate send_bandwidth() {
@ -165,8 +173,11 @@ class CallClient : public EmulatedNetworkReceiverInterface {
class CallClientPair {
public:
RTC_DISALLOW_COPY_AND_ASSIGN(CallClientPair);
~CallClientPair();
CallClientPair(const CallClientPair&) = delete;
CallClientPair& operator=(const CallClientPair&) = delete;
CallClient* first() { return first_; }
CallClient* second() { return second_; }
std::pair<CallClient*, CallClient*> forward() { return {first(), second()}; }

View file

@ -14,7 +14,6 @@
#include <string>
#include <vector>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/strings/string_builder.h"
#include "test/logging/log_writer.h"
@ -46,8 +45,12 @@ class StatesPrinter {
public:
StatesPrinter(std::unique_ptr<RtcEventLogOutput> writer,
std::vector<ColumnPrinter> printers);
RTC_DISALLOW_COPY_AND_ASSIGN(StatesPrinter);
~StatesPrinter();
StatesPrinter(const StatesPrinter&) = delete;
StatesPrinter& operator=(const StatesPrinter&) = delete;
void PrintHeaders();
void PrintRow();

View file

@ -20,7 +20,6 @@
#include "api/units/timestamp.h"
#include "call/call.h"
#include "call/simulated_network.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/task_queue.h"

View file

@ -15,7 +15,6 @@
#include <vector>
#include "api/test/time_controller.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/fake_clock.h"
#include "rtc_base/task_queue.h"
#include "rtc_base/task_utils/repeating_task.h"
@ -47,8 +46,12 @@ class Scenario {
Scenario(std::string file_name, bool real_time);
Scenario(std::unique_ptr<LogWriterFactoryInterface> log_writer_manager,
bool real_time);
RTC_DISALLOW_COPY_AND_ASSIGN(Scenario);
~Scenario();
Scenario(const Scenario&) = delete;
Scenario& operator=(const Scenario&) = delete;
NetworkEmulationManagerImpl* net() { return &network_manager_; }
EmulatedNetworkNode* CreateSimulationNode(NetworkSimulationConfig config);

View file

@ -13,7 +13,6 @@
#include <string>
#include <vector>
#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#include "test/fake_encoder.h"
#include "test/fake_videorenderer.h"
@ -32,8 +31,11 @@ namespace test {
// states at run time.
class SendVideoStream {
public:
RTC_DISALLOW_COPY_AND_ASSIGN(SendVideoStream);
~SendVideoStream();
SendVideoStream(const SendVideoStream&) = delete;
SendVideoStream& operator=(const SendVideoStream&) = delete;
void SetCaptureFramerate(int framerate);
VideoSendStream::Stats GetStats() const;
ColumnPrinter StatsPrinter();
@ -72,8 +74,11 @@ class SendVideoStream {
// ReceiveVideoStream represents a video receiver. It can't be used directly.
class ReceiveVideoStream {
public:
RTC_DISALLOW_COPY_AND_ASSIGN(ReceiveVideoStream);
~ReceiveVideoStream();
ReceiveVideoStream(const ReceiveVideoStream&) = delete;
ReceiveVideoStream& operator=(const ReceiveVideoStream&) = delete;
void Start();
void Stop();
VideoReceiveStream::Stats GetStats() const;
@ -103,8 +108,11 @@ class ReceiveVideoStream {
// the Scenario class.
class VideoStreamPair {
public:
RTC_DISALLOW_COPY_AND_ASSIGN(VideoStreamPair);
~VideoStreamPair();
VideoStreamPair(const VideoStreamPair&) = delete;
VideoStreamPair& operator=(const VideoStreamPair&) = delete;
SendVideoStream* send() { return &send_stream_; }
ReceiveVideoStream* receive() { return &receive_stream_; }
VideoFrameMatcher* matcher() { return &matcher_; }

View file

@ -18,7 +18,6 @@
#include "api/sequence_checker.h"
#include "api/task_queue/task_queue_base.h"
#include "api/video/video_stream_encoder_observer.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/numerics/exp_filter.h"
#include "rtc_base/system/no_unique_address.h"
@ -68,6 +67,9 @@ class OveruseFrameDetector {
explicit OveruseFrameDetector(CpuOveruseMetricsObserver* metrics_observer);
virtual ~OveruseFrameDetector();
OveruseFrameDetector(const OveruseFrameDetector&) = delete;
OveruseFrameDetector& operator=(const OveruseFrameDetector&) = delete;
// Start to periodically check for overuse.
void StartCheckForOveruse(
TaskQueueBase* task_queue_base,
@ -161,8 +163,6 @@ class OveruseFrameDetector {
// If set by field trial, overrides CpuOveruseOptions::filter_time_ms.
FieldTrialOptional<TimeDelta> filter_time_constant_{"tau"};
RTC_DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector);
};
} // namespace webrtc

View file

@ -18,7 +18,6 @@
#include "modules/include/module.h"
#include "modules/include/module_common_types.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#include "system_wrappers/include/clock.h"
@ -35,6 +34,9 @@ class CallStats : public Module, public RtcpRttStats {
CallStats(Clock* clock, ProcessThread* process_thread);
~CallStats() override;
CallStats(const CallStats&) = delete;
CallStats& operator=(const CallStats&) = delete;
// Registers/deregisters a new observer to receive statistics updates.
// Must be called from the construction thread.
void RegisterStatsObserver(CallStatsObserver* observer);
@ -114,8 +116,6 @@ class CallStats : public Module, public RtcpRttStats {
SequenceChecker process_thread_checker_;
ProcessThread* const process_thread_;
bool process_thread_running_ RTC_GUARDED_BY(construction_thread_checker_);
RTC_DISALLOW_COPY_AND_ASSIGN(CallStats);
};
} // namespace webrtc

View file

@ -17,7 +17,6 @@
#include "api/units/timestamp.h"
#include "modules/include/module_common_types.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/task_queue.h"
#include "rtc_base/task_utils/pending_task_safety_flag.h"
#include "rtc_base/task_utils/repeating_task.h"
@ -35,6 +34,9 @@ class CallStats {
CallStats(Clock* clock, TaskQueueBase* task_queue);
~CallStats();
CallStats(const CallStats&) = delete;
CallStats& operator=(const CallStats&) = delete;
// Ensure that necessary repeating tasks are started.
void EnsureStarted();
@ -125,8 +127,6 @@ class CallStats {
// Used to signal destruction to potentially pending tasks.
ScopedTaskSafety task_safety_;
RTC_DISALLOW_COPY_AND_ASSIGN(CallStats);
};
} // namespace internal

View file

@ -46,7 +46,6 @@
#include "modules/video_coding/packet_buffer.h"
#include "modules/video_coding/rtp_frame_reference_finder.h"
#include "modules/video_coding/unique_timestamp_counter.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/numerics/sequence_number_util.h"
#include "rtc_base/synchronization/mutex.h"

View file

@ -43,7 +43,6 @@
#include "modules/video_coding/packet_buffer.h"
#include "modules/video_coding/rtp_frame_reference_finder.h"
#include "modules/video_coding/unique_timestamp_counter.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/numerics/sequence_number_util.h"
#include "rtc_base/system/no_unique_address.h"

View file

@ -14,8 +14,6 @@
#include <memory>
#include <string>
#include "rtc_base/constructor_magic.h"
namespace webrtc {
class AggregatedCounter;
@ -156,6 +154,9 @@ class AvgCounter : public StatsCounter {
bool include_empty_intervals);
~AvgCounter() override {}
AvgCounter(const AvgCounter&) = delete;
AvgCounter& operator=(const AvgCounter&) = delete;
void Add(int sample);
private:
@ -163,8 +164,6 @@ class AvgCounter : public StatsCounter {
// Returns the last computed metric (i.e. from GetMetric).
int GetValueForEmptyInterval() const override;
RTC_DISALLOW_COPY_AND_ASSIGN(AvgCounter);
};
// MaxCounter: maximum of samples
@ -180,13 +179,14 @@ class MaxCounter : public StatsCounter {
int64_t process_intervals_ms);
~MaxCounter() override {}
MaxCounter(const MaxCounter&) = delete;
MaxCounter& operator=(const MaxCounter&) = delete;
void Add(int sample);
private:
bool GetMetric(int* metric) const override;
int GetValueForEmptyInterval() const override;
RTC_DISALLOW_COPY_AND_ASSIGN(MaxCounter);
};
// PercentCounter: percentage of samples
@ -200,13 +200,14 @@ class PercentCounter : public StatsCounter {
PercentCounter(Clock* clock, StatsCounterObserver* observer);
~PercentCounter() override {}
PercentCounter(const PercentCounter&) = delete;
PercentCounter& operator=(const PercentCounter&) = delete;
void Add(bool sample);
private:
bool GetMetric(int* metric) const override;
int GetValueForEmptyInterval() const override;
RTC_DISALLOW_COPY_AND_ASSIGN(PercentCounter);
};
// PermilleCounter: permille of samples
@ -220,13 +221,14 @@ class PermilleCounter : public StatsCounter {
PermilleCounter(Clock* clock, StatsCounterObserver* observer);
~PermilleCounter() override {}
PermilleCounter(const PermilleCounter&) = delete;
PermilleCounter& operator=(const PermilleCounter&) = delete;
void Add(bool sample);
private:
bool GetMetric(int* metric) const override;
int GetValueForEmptyInterval() const override;
RTC_DISALLOW_COPY_AND_ASSIGN(PermilleCounter);
};
// RateCounter: units per second
@ -247,13 +249,14 @@ class RateCounter : public StatsCounter {
bool include_empty_intervals);
~RateCounter() override {}
RateCounter(const RateCounter&) = delete;
RateCounter& operator=(const RateCounter&) = delete;
void Add(int sample);
private:
bool GetMetric(int* metric) const override;
int GetValueForEmptyInterval() const override; // Returns zero.
RTC_DISALLOW_COPY_AND_ASSIGN(RateCounter);
};
// RateAccCounter: units per second (used for counters)
@ -274,6 +277,9 @@ class RateAccCounter : public StatsCounter {
bool include_empty_intervals);
~RateAccCounter() override {}
RateAccCounter(const RateAccCounter&) = delete;
RateAccCounter& operator=(const RateAccCounter&) = delete;
void Set(int64_t sample, uint32_t stream_id);
// Sets the value for previous interval.
@ -283,8 +289,6 @@ class RateAccCounter : public StatsCounter {
private:
bool GetMetric(int* metric) const override;
int GetValueForEmptyInterval() const override; // Returns zero.
RTC_DISALLOW_COPY_AND_ASSIGN(RateAccCounter);
};
} // namespace webrtc

View file

@ -36,7 +36,6 @@
#include "modules/video_coding/svc/svc_rate_allocator.h"
#include "rtc_base/arraysize.h"
#include "rtc_base/checks.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/event.h"
#include "rtc_base/experiments/alr_experiment.h"
#include "rtc_base/experiments/encoder_info_settings.h"

View file

@ -82,6 +82,9 @@ class VideoStreamEncoder : public VideoStreamEncoderInterface,
BitrateAllocationCallbackType allocation_cb_type);
~VideoStreamEncoder() override;
VideoStreamEncoder(const VideoStreamEncoder&) = delete;
VideoStreamEncoder& operator=(const VideoStreamEncoder&) = delete;
void AddAdaptationResource(rtc::scoped_refptr<Resource> resource) override;
std::vector<rtc::scoped_refptr<Resource>> GetAdaptationResources() override;
@ -440,8 +443,6 @@ class VideoStreamEncoder : public VideoStreamEncoderInterface,
// Used to cancel any potentially pending tasks to the worker thread.
ScopedTaskSafety task_safety_;
RTC_DISALLOW_COPY_AND_ASSIGN(VideoStreamEncoder);
};
} // namespace webrtc