diff --git a/api/DEPS b/api/DEPS index 0b8a70eabf..ce88d34ef4 100644 --- a/api/DEPS +++ b/api/DEPS @@ -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": [ diff --git a/call/adaptation/video_stream_adapter.cc b/call/adaptation/video_stream_adapter.cc index 3d4c4dde3b..ce1c300a72 100644 --- a/call/adaptation/video_stream_adapter.cc +++ b/call/adaptation/video_stream_adapter.cc @@ -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" diff --git a/common_audio/audio_converter.h b/common_audio/audio_converter.h index e12e601b24..4afbb6d0fd 100644 --- a/common_audio/audio_converter.h +++ b/common_audio/audio_converter.h @@ -15,8 +15,6 @@ #include -#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 diff --git a/common_audio/resampler/push_sinc_resampler.h b/common_audio/resampler/push_sinc_resampler.h index 88792d427a..7946ef8f82 100644 --- a/common_audio/resampler/push_sinc_resampler.h +++ b/common_audio/resampler/push_sinc_resampler.h @@ -17,7 +17,6 @@ #include #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 diff --git a/common_audio/resampler/sinc_resampler.h b/common_audio/resampler/sinc_resampler.h index d071e96f4f..b89bba7ab4 100644 --- a/common_audio/resampler/sinc_resampler.h +++ b/common_audio/resampler/sinc_resampler.h @@ -18,7 +18,6 @@ #include -#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 diff --git a/common_audio/resampler/sinusoidal_linear_chirp_source.h b/common_audio/resampler/sinusoidal_linear_chirp_source.h index 8534119e5c..a57cbfef02 100644 --- a/common_audio/resampler/sinusoidal_linear_chirp_source.h +++ b/common_audio/resampler/sinusoidal_linear_chirp_source.h @@ -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 diff --git a/examples/peerconnection/client/main.cc b/examples/peerconnection/client/main.cc index 04a331d2bd..32bc52bda4 100644 --- a/examples/peerconnection/client/main.cc +++ b/examples/peerconnection/client/main.cc @@ -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 args_; // Pointers, to get layout compatible with char** argv. std::vector argv_; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(WindowsCommandLineArguments); }; WindowsCommandLineArguments::WindowsCommandLineArguments() { diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index 4237b2a713..df59cba79b 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -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" diff --git a/media/base/media_engine.h b/media/base/media_engine.h index 500e1ba5e5..1778104a30 100644 --- a/media/base/media_engine.h +++ b/media/base/media_engine.h @@ -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. diff --git a/media/base/stream_params.h b/media/base/stream_params.h index 1f46469cb5..c9c8a09592 100644 --- a/media/base/stream_params.h +++ b/media/base/stream_params.h @@ -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 { diff --git a/media/base/video_adapter.h b/media/base/video_adapter.h index 1bae10d419..071330f330 100644 --- a/media/base/video_adapter.h +++ b/media/base/video_adapter.h @@ -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 diff --git a/media/sctp/usrsctp_transport.h b/media/sctp/usrsctp_transport.h index 06988fd156..2dd6abf9c5 100644 --- a/media/sctp/usrsctp_transport.h +++ b/media/sctp/usrsctp_transport.h @@ -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; diff --git a/media/sctp/usrsctp_transport_reliability_unittest.cc b/media/sctp/usrsctp_transport_reliability_unittest.cc index a06d8d84dd..987dd04358 100644 --- a/media/sctp/usrsctp_transport_reliability_unittest.cc +++ b/media/sctp/usrsctp_transport_reliability_unittest.cc @@ -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 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 num_bytes_sent_ ATOMIC_VAR_INIT(0); absl::optional 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> 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); }; /** diff --git a/modules/audio_coding/audio_network_adaptor/debug_dump_writer.h b/modules/audio_coding/audio_network_adaptor/debug_dump_writer.h index 367f659542..8fdf2f7728 100644 --- a/modules/audio_coding/audio_network_adaptor/debug_dump_writer.h +++ b/modules/audio_coding/audio_network_adaptor/debug_dump_writer.h @@ -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 diff --git a/modules/audio_coding/codecs/cng/audio_encoder_cng_unittest.cc b/modules/audio_coding/codecs/cng/audio_encoder_cng_unittest.cc index a34c563d33..c688004363 100644 --- a/modules/audio_coding/codecs/cng/audio_encoder_cng_unittest.cc +++ b/modules/audio_coding/codecs/cng/audio_encoder_cng_unittest.cc @@ -14,7 +14,6 @@ #include #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) { diff --git a/modules/audio_device/linux/latebindingsymboltable_linux.h b/modules/audio_device/linux/latebindingsymboltable_linux.h index 6cfb659749..9484b075ef 100644 --- a/modules/audio_device/linux/latebindingsymboltable_linux.h +++ b/modules/audio_device/linux/latebindingsymboltable_linux.h @@ -15,7 +15,6 @@ #include #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. diff --git a/modules/audio_processing/aec3/comfort_noise_generator.h b/modules/audio_processing/aec3/comfort_noise_generator.h index 16eaf3550f..2785b765c5 100644 --- a/modules/audio_processing/aec3/comfort_noise_generator.h +++ b/modules/audio_processing/aec3/comfort_noise_generator.h @@ -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 { diff --git a/modules/audio_processing/aec3/echo_audibility.h b/modules/audio_processing/aec3/echo_audibility.h index 1ffc017b7d..b9d6f87d2a 100644 --- a/modules/audio_processing/aec3/echo_audibility.h +++ b/modules/audio_processing/aec3/echo_audibility.h @@ -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 { diff --git a/modules/audio_processing/aec3/filter_analyzer.h b/modules/audio_processing/aec3/filter_analyzer.h index b0b7070119..e05fb71138 100644 --- a/modules/audio_processing/aec3/filter_analyzer.h +++ b/modules/audio_processing/aec3/filter_analyzer.h @@ -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 { diff --git a/modules/audio_processing/agc2/limiter.h b/modules/audio_processing/agc2/limiter.h index f8894a308d..669e202c20 100644 --- a/modules/audio_processing/agc2/limiter.h +++ b/modules/audio_processing/agc2/limiter.h @@ -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; diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc index 492b53a344..03c193d780 100644 --- a/modules/audio_processing/audio_processing_impl.cc +++ b/modules/audio_processing/audio_processing_impl.cc @@ -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" diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h index 4d567ca110..b7e2841d00 100644 --- a/modules/audio_processing/include/audio_processing.h +++ b/modules/audio_processing/include/audio_processing.h @@ -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" diff --git a/modules/audio_processing/test/conversational_speech/simulator.cc b/modules/audio_processing/test/conversational_speech/simulator.cc index 20c8608c9e..c0fb589852 100644 --- a/modules/audio_processing/test/conversational_speech/simulator.cc +++ b/modules/audio_processing/test/conversational_speech/simulator.cc @@ -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" diff --git a/modules/audio_processing/test/conversational_speech/simulator.h b/modules/audio_processing/test/conversational_speech/simulator.h index a9992eb5d8..2584782c22 100644 --- a/modules/audio_processing/test/conversational_speech/simulator.h +++ b/modules/audio_processing/test/conversational_speech/simulator.h @@ -17,7 +17,6 @@ #include #include "modules/audio_processing/test/conversational_speech/multiend_call.h" -#include "rtc_base/constructor_magic.h" namespace webrtc { namespace test { diff --git a/modules/desktop_capture/desktop_frame_win.h b/modules/desktop_capture/desktop_frame_win.h index 73e864868d..f8faad6777 100644 --- a/modules/desktop_capture/desktop_frame_win.h +++ b/modules/desktop_capture/desktop_frame_win.h @@ -16,7 +16,6 @@ #include #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 Create(DesktopSize size, SharedMemoryFactory* shared_memory_factory, HDC hdc); @@ -40,8 +42,6 @@ class DesktopFrameWin : public DesktopFrame { HBITMAP bitmap_; std::unique_ptr owned_shared_memory_; - - RTC_DISALLOW_COPY_AND_ASSIGN(DesktopFrameWin); }; } // namespace webrtc diff --git a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h index 79bdf031b4..7663cb60ae 100644 --- a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h +++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h @@ -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 screencast_portal_; - - RTC_DISALLOW_COPY_AND_ASSIGN(BaseCapturerPipeWire); }; } // namespace webrtc diff --git a/modules/desktop_capture/linux/x11/screen_capturer_x11.h b/modules/desktop_capture/linux/x11/screen_capturer_x11.h index ebf18a451b..d2a437aaa2 100644 --- a/modules/desktop_capture/linux/x11/screen_capturer_x11.h +++ b/modules/desktop_capture/linux/x11/screen_capturer_x11.h @@ -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 CreateRawScreenCapturer( const DesktopCaptureOptions& options); @@ -138,8 +140,6 @@ class ScreenCapturerX11 : public DesktopCapturer, DesktopRegion last_invalid_region_; std::unique_ptr atom_cache_; - - RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerX11); }; } // namespace webrtc diff --git a/modules/desktop_capture/linux/x11/shared_x_display.h b/modules/desktop_capture/linux/x11/shared_x_display.h index 13e1c8d2d5..6405c36a2d 100644 --- a/modules/desktop_capture/linux/x11/shared_x_display.h +++ b/modules/desktop_capture/linux/x11/shared_x_display.h @@ -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 diff --git a/modules/desktop_capture/linux/x11/window_capturer_x11.h b/modules/desktop_capture/linux/x11/window_capturer_x11.h index f15b1474e0..ac591c272e 100644 --- a/modules/desktop_capture/linux/x11/window_capturer_x11.h +++ b/modules/desktop_capture/linux/x11/window_capturer_x11.h @@ -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 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 diff --git a/modules/desktop_capture/linux/x11/window_list_utils.cc b/modules/desktop_capture/linux/x11/window_list_utils.cc index a366f9e061..ff2d467e29 100644 --- a/modules/desktop_capture/linux/x11/window_list_utils.cc +++ b/modules/desktop_capture/linux/x11/window_list_utils.cc @@ -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 { diff --git a/modules/desktop_capture/linux/x11/x_error_trap.h b/modules/desktop_capture/linux/x11/x_error_trap.h index ceb660ccbd..882d690922 100644 --- a/modules/desktop_capture/linux/x11/x_error_trap.h +++ b/modules/desktop_capture/linux/x11/x_error_trap.h @@ -13,8 +13,6 @@ #include -#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 diff --git a/modules/desktop_capture/linux/x11/x_server_pixel_buffer.h b/modules/desktop_capture/linux/x11/x_server_pixel_buffer.h index 84e1de35e5..38af3a3e76 100644 --- a/modules/desktop_capture/linux/x11/x_server_pixel_buffer.h +++ b/modules/desktop_capture/linux/x11/x_server_pixel_buffer.h @@ -20,7 +20,6 @@ #include #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 icc_profile_; - - RTC_DISALLOW_COPY_AND_ASSIGN(XServerPixelBuffer); }; } // namespace webrtc diff --git a/modules/desktop_capture/linux/x11/x_window_property.h b/modules/desktop_capture/linux/x11/x_window_property.h index 71cbf06eb3..28dfb97311 100644 --- a/modules/desktop_capture/linux/x11/x_window_property.h +++ b/modules/desktop_capture/linux/x11/x_window_property.h @@ -14,8 +14,6 @@ #include #include -#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(data_); } PropertyType* data() { return reinterpret_cast(data_); } - - RTC_DISALLOW_COPY_AND_ASSIGN(XWindowProperty); }; } // namespace webrtc diff --git a/modules/desktop_capture/mac/screen_capturer_mac.mm b/modules/desktop_capture/mac/screen_capturer_mac.mm index f10111a7f0..634849122e 100644 --- a/modules/desktop_capture/mac/screen_capturer_mac.mm +++ b/modules/desktop_capture/mac/screen_capturer_mac.mm @@ -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" diff --git a/modules/desktop_capture/screen_capturer_integration_test.cc b/modules/desktop_capture/screen_capturer_integration_test.cc index 8350ff669b..b33427ad42 100644 --- a/modules/desktop_capture/screen_capturer_integration_test.cc +++ b/modules/desktop_capture/screen_capturer_integration_test.cc @@ -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" diff --git a/modules/desktop_capture/win/desktop.h b/modules/desktop_capture/win/desktop.h index 382df608c8..01bed8592d 100644 --- a/modules/desktop_capture/win/desktop.h +++ b/modules/desktop_capture/win/desktop.h @@ -15,7 +15,6 @@ #include -#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 diff --git a/modules/desktop_capture/win/scoped_gdi_object.h b/modules/desktop_capture/win/scoped_gdi_object.h index d3ac9b9443..2b01941e20 100644 --- a/modules/desktop_capture/win/scoped_gdi_object.h +++ b/modules/desktop_capture/win/scoped_gdi_object.h @@ -13,8 +13,6 @@ #include -#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. diff --git a/modules/desktop_capture/win/scoped_thread_desktop.h b/modules/desktop_capture/win/scoped_thread_desktop.h index 04abaafeeb..98f151a46c 100644 --- a/modules/desktop_capture/win/scoped_thread_desktop.h +++ b/modules/desktop_capture/win/scoped_thread_desktop.h @@ -15,7 +15,6 @@ #include -#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 initial_; - - RTC_DISALLOW_COPY_AND_ASSIGN(ScopedThreadDesktop); }; } // namespace webrtc diff --git a/modules/desktop_capture/win/screen_capturer_win_directx.h b/modules/desktop_capture/win/screen_capturer_win_directx.h index 2d0fce6f90..d64913ed10 100644 --- a/modules/desktop_capture/win/screen_capturer_win_directx.h +++ b/modules/desktop_capture/win/screen_capturer_win_directx.h @@ -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 shared_memory_factory_; Callback* callback_ = nullptr; SourceId current_screen_id_ = kFullDesktopScreenId; - - RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinDirectx); }; } // namespace webrtc diff --git a/modules/desktop_capture/win/screen_capturer_win_gdi.h b/modules/desktop_capture/win/screen_capturer_win_gdi.h index e006c79021..7c3977ed42 100644 --- a/modules/desktop_capture/win/screen_capturer_win_gdi.h +++ b/modules/desktop_capture/win/screen_capturer_win_gdi.h @@ -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 diff --git a/modules/desktop_capture/win/screen_capturer_win_magnifier.h b/modules/desktop_capture/win/screen_capturer_win_magnifier.h index 29966e9535..07c5b1e9e6 100644 --- a/modules/desktop_capture/win/screen_capturer_win_magnifier.h +++ b/modules/desktop_capture/win/screen_capturer_win_magnifier.h @@ -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 diff --git a/modules/desktop_capture/win/window_capture_utils.h b/modules/desktop_capture/win/window_capture_utils.h index 335d873742..caea07958d 100644 --- a/modules/desktop_capture/win/window_capture_utils.h +++ b/modules/desktop_capture/win/window_capture_utils.h @@ -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 virtual_desktop_manager_; - - RTC_DISALLOW_COPY_AND_ASSIGN(WindowCaptureHelperWin); }; } // namespace webrtc diff --git a/modules/desktop_capture/window_capturer_null.cc b/modules/desktop_capture/window_capturer_null.cc index e7c7b0a134..6da2a76691 100644 --- a/modules/desktop_capture/window_capturer_null.cc +++ b/modules/desktop_capture/window_capturer_null.cc @@ -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() {} diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.h b/modules/remote_bitrate_estimator/test/bwe_test_logging.h index e85565596d..49e1e716b2 100644 --- a/modules/remote_bitrate_estimator/test/bwe_test_logging.h +++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.h @@ -128,7 +128,6 @@ #include #include -#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 diff --git a/pc/srtp_filter.h b/pc/srtp_filter.h index f1e164936c..e2848a1090 100644 --- a/pc/srtp_filter.h +++ b/pc/srtp_filter.h @@ -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 diff --git a/rtc_base/openssl_certificate.h b/rtc_base/openssl_certificate.h index c317a72110..b2debbee89 100644 --- a/rtc_base/openssl_certificate.h +++ b/rtc_base/openssl_certificate.h @@ -18,7 +18,6 @@ #include #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 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 diff --git a/rtc_base/openssl_identity.h b/rtc_base/openssl_identity.h index 00d6c74922..63f46b374d 100644 --- a/rtc_base/openssl_identity.h +++ b/rtc_base/openssl_identity.h @@ -17,7 +17,6 @@ #include #include -#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 key_pair_; std::unique_ptr cert_chain_; - - RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity); }; } // namespace rtc diff --git a/rtc_base/sigslottester.h.pump b/rtc_base/sigslottester.h.pump index 0a1f41128d..c3d2d6e99b 100755 --- a/rtc_base/sigslottester.h.pump +++ b/rtc_base/sigslottester.h.pump @@ -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); }; ]] diff --git a/rtc_base/task_queue_win.cc b/rtc_base/task_queue_win.cc index 6382d6b15d..dd14a7d8e0 100644 --- a/rtc_base/task_queue_win.cc +++ b/rtc_base/task_queue_win.cc @@ -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 { diff --git a/rtc_base/win/windows_version.h b/rtc_base/win/windows_version.h index dbb0d8eb58..3636eabf19 100644 --- a/rtc_base/win/windows_version.h +++ b/rtc_base/win/windows_version.h @@ -15,8 +15,6 @@ #include -#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 diff --git a/rtc_tools/network_tester/config_reader.h b/rtc_tools/network_tester/config_reader.h index f44e7a91f4..3735555d51 100644 --- a/rtc_tools/network_tester/config_reader.h +++ b/rtc_tools/network_tester/config_reader.h @@ -15,7 +15,6 @@ #include #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 GetNextConfig(); private: NetworkTesterAllConfigs proto_all_configs_; int proto_config_index_; - RTC_DISALLOW_COPY_AND_ASSIGN(ConfigReader); }; } // namespace webrtc diff --git a/rtc_tools/network_tester/packet_logger.h b/rtc_tools/network_tester/packet_logger.h index 109ee4c14f..c3ac309cf7 100644 --- a/rtc_tools/network_tester/packet_logger.h +++ b/rtc_tools/network_tester/packet_logger.h @@ -14,7 +14,6 @@ #include #include -#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 diff --git a/rtc_tools/network_tester/packet_sender.h b/rtc_tools/network_tester/packet_sender.h index 7ccecdd84c..233ed6a51a 100644 --- a/rtc_tools/network_tester/packet_sender.h +++ b/rtc_tools/network_tester/packet_sender.h @@ -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 task_queue_factory_; rtc::TaskQueue worker_queue_; - - RTC_DISALLOW_COPY_AND_ASSIGN(PacketSender); }; } // namespace webrtc diff --git a/rtc_tools/network_tester/test_controller.h b/rtc_tools/network_tester/test_controller.h index 50055fcf4c..3933b46b5b 100644 --- a/rtc_tools/network_tester/test_controller.h +++ b/rtc_tools/network_tester/test_controller.h @@ -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 udp_socket_; rtc::SocketAddress remote_address_; std::unique_ptr packet_sender_; - - RTC_DISALLOW_COPY_AND_ASSIGN(TestController); }; } // namespace webrtc diff --git a/rtc_tools/rtc_event_log_visualizer/alerts.h b/rtc_tools/rtc_event_log_visualizer/alerts.h index d3e41666aa..72f1241d50 100644 --- a/rtc_tools/rtc_event_log_visualizer/alerts.h +++ b/rtc_tools/rtc_event_log_visualizer/alerts.h @@ -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 diff --git a/rtc_tools/sanitizers_unittest.cc b/rtc_tools/sanitizers_unittest.cc index ee575831af..6404eb296d 100644 --- a/rtc_tools/sanitizers_unittest.cc +++ b/rtc_tools/sanitizers_unittest.cc @@ -15,7 +15,6 @@ #include #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()), 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() { diff --git a/sdk/android/native_api/jni/java_types.h b/sdk/android/native_api/jni/java_types.h index 8a13e3e7ce..1008737d90 100644 --- a/sdk/android/native_api/jni/java_types.h +++ b/sdk/android/native_api/jni/java_types.h @@ -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 iterator_; ScopedJavaLocalRef 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 iterable_; - - RTC_DISALLOW_COPY_AND_ASSIGN(Iterable); }; // Returns true if `obj` == null in Java. diff --git a/sdk/android/native_api/jni/scoped_java_ref.h b/sdk/android/native_api/jni/scoped_java_ref.h index 634d35acc5..a2be447de2 100644 --- a/sdk/android/native_api/jni/scoped_java_ref.h +++ b/sdk/android/native_api/jni/scoped_java_ref.h @@ -15,9 +15,9 @@ #define SDK_ANDROID_NATIVE_API_JNI_SCOPED_JAVA_REF_H_ #include + #include -#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 { 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 { constexpr JavaRef() : obj_(nullptr) {} explicit JavaRef(jobject obj) : obj_(obj) {} jobject obj_; - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(JavaRef); }; template class JavaRef : public JavaRef { public: + JavaRef(const JavaRef&) = delete; + JavaRef& operator=(const JavaRef&) = delete; + T obj() const { return static_cast(obj_); } protected: JavaRef() : JavaRef(nullptr) {} explicit JavaRef(T obj) : JavaRef(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 { explicit JavaParamRef(T obj) : JavaRef(obj) {} JavaParamRef(JNIEnv*, T obj) : JavaRef(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 { AttachCurrentThreadIfNeeded()->DeleteGlobalRef(obj_); } + ScopedJavaGlobalRef(const ScopedJavaGlobalRef&) = delete; + ScopedJavaGlobalRef& operator=(const ScopedJavaGlobalRef&) = delete; + void operator=(const JavaRef& other) { JNIEnv* env = AttachCurrentThreadIfNeeded(); if (obj_ != nullptr) { @@ -209,9 +212,6 @@ class ScopedJavaGlobalRef : public JavaRef { obj_ = nullptr; return obj; } - - private: - RTC_DISALLOW_COPY_AND_ASSIGN(ScopedJavaGlobalRef); }; template diff --git a/test/direct_transport.h b/test/direct_transport.h index d6b70b9ce0..d67f9ead69 100644 --- a/test/direct_transport.h +++ b/test/direct_transport.h @@ -31,10 +31,13 @@ class Demuxer { public: explicit Demuxer(const std::map& 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 payload_type_map_; - RTC_DISALLOW_COPY_AND_ASSIGN(Demuxer); }; // Objects of this class are expected to be allocated and destroyed on the diff --git a/test/mac/video_renderer_mac.h b/test/mac/video_renderer_mac.h index 956f50b541..8e629b0a49 100644 --- a/test/mac/video_renderer_mac.h +++ b/test/mac/video_renderer_mac.h @@ -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 diff --git a/test/network/network_emulation.h b/test/network/network_emulation.h index d10e9a8ebc..61dc468661 100644 --- a/test/network/network_emulation.h +++ b/test/network/network_emulation.h @@ -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 network_behavior); ~EmulatedNetworkNode() override; - RTC_DISALLOW_COPY_AND_ASSIGN(EmulatedNetworkNode); + + EmulatedNetworkNode(const EmulatedNetworkNode&) = delete; + EmulatedNetworkNode& operator=(const EmulatedNetworkNode&) = delete; void OnPacketReceived(EmulatedIpPacket packet) override; diff --git a/test/rtp_file_reader.cc b/test/rtp_file_reader.cc index b3d0742bf8..15a05132f3 100644 --- a/test/rtp_file_reader.cc +++ b/test/rtp_file_reader.cc @@ -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& 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& ssrc_filter) override { return Initialize(file, ssrc_filter) == kResultSuccess; } @@ -619,8 +622,6 @@ class PcapReader : public RtpFileReaderImpl { SsrcMap packets_by_ssrc_; std::vector packets_; PacketIterator next_packet_it_; - - RTC_DISALLOW_COPY_AND_ASSIGN(PcapReader); }; RtpFileReaderImpl* CreateReaderForFormat(RtpFileReader::FileFormat format) { diff --git a/test/rtp_file_writer.cc b/test/rtp_file_writer.cc index cdd9c933a7..c80b6387a7 100644 --- a/test/rtp_file_writer.cc +++ b/test/rtp_file_writer.cc @@ -16,7 +16,6 @@ #include #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(packet->length + kPacketHeaderSize); uint16_t plen = static_cast(packet->original_length); @@ -86,8 +88,6 @@ class RtpDumpWriter : public RtpFileWriter { } FILE* file_; - - RTC_DISALLOW_COPY_AND_ASSIGN(RtpDumpWriter); }; RtpFileWriter* RtpFileWriter::Create(FileFormat format, diff --git a/test/scenario/audio_stream.h b/test/scenario/audio_stream.h index b561cb4c70..2110c1d5cb 100644 --- a/test/scenario/audio_stream.h +++ b/test/scenario/audio_stream.h @@ -13,7 +13,6 @@ #include #include -#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_; } diff --git a/test/scenario/call_client.h b/test/scenario/call_client.h index 08b0131350..489844039b 100644 --- a/test/scenario/call_client.h +++ b/test/scenario/call_client.h @@ -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 Create( NetworkControllerConfig config) override; TimeDelta GetProcessInterval() const override; @@ -99,9 +104,12 @@ class CallClient : public EmulatedNetworkReceiverInterface { CallClient(TimeController* time_controller, std::unique_ptr 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 forward() { return {first(), second()}; } diff --git a/test/scenario/column_printer.h b/test/scenario/column_printer.h index 4ace50d364..529f4597ec 100644 --- a/test/scenario/column_printer.h +++ b/test/scenario/column_printer.h @@ -14,7 +14,6 @@ #include #include -#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 writer, std::vector printers); - RTC_DISALLOW_COPY_AND_ASSIGN(StatesPrinter); + ~StatesPrinter(); + + StatesPrinter(const StatesPrinter&) = delete; + StatesPrinter& operator=(const StatesPrinter&) = delete; + void PrintHeaders(); void PrintRow(); diff --git a/test/scenario/network_node.h b/test/scenario/network_node.h index ea8eb35daf..156cdbb6a8 100644 --- a/test/scenario/network_node.h +++ b/test/scenario/network_node.h @@ -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" diff --git a/test/scenario/scenario.h b/test/scenario/scenario.h index 134cf08118..5d82a60c13 100644 --- a/test/scenario/scenario.h +++ b/test/scenario/scenario.h @@ -15,7 +15,6 @@ #include #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 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); diff --git a/test/scenario/video_stream.h b/test/scenario/video_stream.h index 96b6d49f63..1451f59c81 100644 --- a/test/scenario/video_stream.h +++ b/test/scenario/video_stream.h @@ -13,7 +13,6 @@ #include #include -#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_; } diff --git a/video/adaptation/overuse_frame_detector.h b/video/adaptation/overuse_frame_detector.h index 2b4dd61d21..caefda1867 100644 --- a/video/adaptation/overuse_frame_detector.h +++ b/video/adaptation/overuse_frame_detector.h @@ -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 filter_time_constant_{"tau"}; - - RTC_DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector); }; } // namespace webrtc diff --git a/video/call_stats.h b/video/call_stats.h index 0c8e26741b..d198223a9d 100644 --- a/video/call_stats.h +++ b/video/call_stats.h @@ -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 diff --git a/video/call_stats2.h b/video/call_stats2.h index 74bd3482da..b626e48840 100644 --- a/video/call_stats2.h +++ b/video/call_stats2.h @@ -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 diff --git a/video/rtp_video_stream_receiver.h b/video/rtp_video_stream_receiver.h index 2df76b3846..abd4452d1a 100644 --- a/video/rtp_video_stream_receiver.h +++ b/video/rtp_video_stream_receiver.h @@ -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" diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h index a361b497ed..48aab34a41 100644 --- a/video/rtp_video_stream_receiver2.h +++ b/video/rtp_video_stream_receiver2.h @@ -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" diff --git a/video/stats_counter.h b/video/stats_counter.h index 9c3f6f8156..9e2b8702d6 100644 --- a/video/stats_counter.h +++ b/video/stats_counter.h @@ -14,8 +14,6 @@ #include #include -#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 diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc index 9a313e1992..147e0110bd 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -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" diff --git a/video/video_stream_encoder.h b/video/video_stream_encoder.h index 30c04b2e33..c667f049f8 100644 --- a/video/video_stream_encoder.h +++ b/video/video_stream_encoder.h @@ -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) override; std::vector> 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