Remove RTC_DISALLOW_COPY_AND_ASSIGN more.
Bug: webrtc:13555, webrtc:13082
Change-Id: I9c07708108da0a26f5e228384fd56cef4d1540b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@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@{#35749}
diff --git a/api/audio/audio_frame.h b/api/audio/audio_frame.h
index 628a1ec..d5dcb5f 100644
--- a/api/audio/audio_frame.h
+++ b/api/audio/audio_frame.h
@@ -16,7 +16,6 @@
#include "api/audio/channel_layout.h"
#include "api/rtp_packet_infos.h"
-#include "rtc_base/constructor_magic.h"
namespace webrtc {
@@ -58,6 +57,9 @@
AudioFrame();
+ AudioFrame(const AudioFrame&) = delete;
+ AudioFrame& operator=(const AudioFrame&) = delete;
+
// Resets all members to their default state.
void Reset();
// Same as Reset(), but leaves mute state unchanged. Muting a frame requires
@@ -164,8 +166,6 @@
// capture timestamp of a received frame is found in `packet_infos_`.
// This timestamp MUST be based on the same clock as rtc::TimeMillis().
absl::optional<int64_t> absolute_capture_timestamp_ms_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(AudioFrame);
};
} // namespace webrtc
diff --git a/api/audio_codecs/audio_decoder.h b/api/audio_codecs/audio_decoder.h
index 336e384..4113874 100644
--- a/api/audio_codecs/audio_decoder.h
+++ b/api/audio_codecs/audio_decoder.h
@@ -20,7 +20,6 @@
#include "absl/types/optional.h"
#include "api/array_view.h"
#include "rtc_base/buffer.h"
-#include "rtc_base/constructor_magic.h"
namespace webrtc {
@@ -37,6 +36,9 @@
AudioDecoder() = default;
virtual ~AudioDecoder() = default;
+ AudioDecoder(const AudioDecoder&) = delete;
+ AudioDecoder& operator=(const AudioDecoder&) = delete;
+
class EncodedAudioFrame {
public:
struct DecodeResult {
@@ -187,9 +189,6 @@
int sample_rate_hz,
int16_t* decoded,
SpeechType* speech_type);
-
- private:
- RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoder);
};
} // namespace webrtc
diff --git a/api/jsep_ice_candidate.h b/api/jsep_ice_candidate.h
index 40e2783..8f47a10 100644
--- a/api/jsep_ice_candidate.h
+++ b/api/jsep_ice_candidate.h
@@ -22,7 +22,6 @@
#include "api/candidate.h"
#include "api/jsep.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@@ -64,6 +63,10 @@
// Move constructor is defined so that a vector of JsepCandidateCollections
// can be resized.
JsepCandidateCollection(JsepCandidateCollection&& o);
+
+ JsepCandidateCollection(const JsepCandidateCollection&) = delete;
+ JsepCandidateCollection& operator=(const JsepCandidateCollection&) = delete;
+
// Returns a copy of the candidate collection.
JsepCandidateCollection Clone() const;
size_t count() const override;
@@ -80,8 +83,6 @@
private:
std::vector<std::unique_ptr<JsepIceCandidate>> candidates_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(JsepCandidateCollection);
};
} // namespace webrtc
diff --git a/api/jsep_session_description.h b/api/jsep_session_description.h
index a4300eb..0b65734 100644
--- a/api/jsep_session_description.h
+++ b/api/jsep_session_description.h
@@ -22,7 +22,6 @@
#include "api/candidate.h"
#include "api/jsep.h"
#include "api/jsep_ice_candidate.h"
-#include "rtc_base/constructor_magic.h"
namespace cricket {
class SessionDescription;
@@ -43,6 +42,9 @@
absl::string_view session_version);
virtual ~JsepSessionDescription();
+ JsepSessionDescription(const JsepSessionDescription&) = delete;
+ JsepSessionDescription& operator=(const JsepSessionDescription&) = delete;
+
// Takes ownership of `description`.
bool Initialize(std::unique_ptr<cricket::SessionDescription> description,
const std::string& session_id,
@@ -82,8 +84,6 @@
bool GetMediasectionIndex(const IceCandidateInterface* candidate,
size_t* index);
int GetMediasectionIndex(const cricket::Candidate& candidate);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(JsepSessionDescription);
};
} // namespace webrtc
diff --git a/api/ref_counted_base.h b/api/ref_counted_base.h
index 931cb20..f20228b 100644
--- a/api/ref_counted_base.h
+++ b/api/ref_counted_base.h
@@ -12,7 +12,6 @@
#include <type_traits>
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/ref_counter.h"
namespace rtc {
@@ -21,6 +20,9 @@
public:
RefCountedBase() = default;
+ RefCountedBase(const RefCountedBase&) = delete;
+ RefCountedBase& operator=(const RefCountedBase&) = delete;
+
void AddRef() const { ref_count_.IncRef(); }
RefCountReleaseStatus Release() const {
const auto status = ref_count_.DecRef();
@@ -39,8 +41,6 @@
private:
mutable webrtc::webrtc_impl::RefCounter ref_count_{0};
-
- RTC_DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
};
// Template based version of `RefCountedBase` for simple implementations that do
@@ -61,6 +61,9 @@
public:
RefCountedNonVirtual() = default;
+ RefCountedNonVirtual(const RefCountedNonVirtual&) = delete;
+ RefCountedNonVirtual& operator=(const RefCountedNonVirtual&) = delete;
+
void AddRef() const { ref_count_.IncRef(); }
RefCountReleaseStatus Release() const {
// If you run into this assert, T has virtual methods. There are two
@@ -88,8 +91,6 @@
private:
mutable webrtc::webrtc_impl::RefCounter ref_count_{0};
-
- RTC_DISALLOW_COPY_AND_ASSIGN(RefCountedNonVirtual);
};
} // namespace rtc
diff --git a/api/stats_types.h b/api/stats_types.h
index b7cb8ef..c3e4451 100644
--- a/api/stats_types.h
+++ b/api/stats_types.h
@@ -22,7 +22,6 @@
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
@@ -288,6 +287,9 @@
~Value();
+ Value(const Value&) = delete;
+ Value& operator=(const Value&) = delete;
+
// Support ref counting. Note that for performance reasons, we
// don't use thread safe operations. Therefore, all operations
// affecting the ref count (in practice, creation and copying of
@@ -358,8 +360,6 @@
const char* static_string_;
Id* id_;
} value_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(Value);
};
typedef rtc::scoped_refptr<Value> ValuePtr;
@@ -369,6 +369,9 @@
explicit StatsReport(const Id& id);
~StatsReport();
+ StatsReport(const StatsReport&) = delete;
+ StatsReport& operator=(const StatsReport&) = delete;
+
// Factory functions for various types of stats IDs.
static Id NewBandwidthEstimationId();
static Id NewTypedId(StatsType type, const std::string& id);
@@ -408,8 +411,6 @@
const Id id_;
double timestamp_; // Time since 1970-01-01T00:00:00Z in milliseconds.
Values values_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(StatsReport);
};
// Typedef for an array of const StatsReport pointers.
diff --git a/call/call.cc b/call/call.cc
index d83d5fb..d34b9d3 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -51,7 +51,6 @@
#include "modules/utility/include/process_thread.h"
#include "modules/video_coding/fec_controller_default.h"
#include "rtc_base/checks.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/location.h"
#include "rtc_base/logging.h"
#include "rtc_base/strings/string_builder.h"
@@ -209,6 +208,9 @@
TaskQueueFactory* task_queue_factory);
~Call() override;
+ Call(const Call&) = delete;
+ Call& operator=(const Call&) = delete;
+
// Implements webrtc::Call.
PacketReceiver* Receiver() override;
@@ -469,8 +471,6 @@
RTC_NO_UNIQUE_ADDRESS SequenceChecker sent_packet_sequence_checker_;
absl::optional<rtc::SentPacket> last_sent_packet_
RTC_GUARDED_BY(sent_packet_sequence_checker_);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(Call);
};
} // namespace internal
diff --git a/call/fake_network_pipe.h b/call/fake_network_pipe.h
index fadae33..be72e91 100644
--- a/call/fake_network_pipe.h
+++ b/call/fake_network_pipe.h
@@ -23,7 +23,6 @@
#include "api/test/simulated_network.h"
#include "call/call.h"
#include "call/simulated_packet_receiver.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/thread_annotations.h"
@@ -109,6 +108,9 @@
~FakeNetworkPipe() override;
+ FakeNetworkPipe(const FakeNetworkPipe&) = delete;
+ FakeNetworkPipe& operator=(const FakeNetworkPipe&) = delete;
+
void SetClockOffset(int64_t offset_ms);
// Must not be called in parallel with DeliverPacket or Process.
@@ -228,8 +230,6 @@
int64_t last_log_time_us_;
std::map<Transport*, size_t> active_transports_ RTC_GUARDED_BY(config_lock_);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(FakeNetworkPipe);
};
} // namespace webrtc
diff --git a/call/rtp_bitrate_configurator.h b/call/rtp_bitrate_configurator.h
index 7ad83f8..5cb779a 100644
--- a/call/rtp_bitrate_configurator.h
+++ b/call/rtp_bitrate_configurator.h
@@ -14,7 +14,6 @@
#include "absl/types/optional.h"
#include "api/transport/bitrate_settings.h"
#include "api/units/data_rate.h"
-#include "rtc_base/constructor_magic.h"
namespace webrtc {
@@ -24,6 +23,10 @@
public:
explicit RtpBitrateConfigurator(const BitrateConstraints& bitrate_config);
~RtpBitrateConfigurator();
+
+ RtpBitrateConfigurator(const RtpBitrateConfigurator&) = delete;
+ RtpBitrateConfigurator& operator=(const RtpBitrateConfigurator&) = delete;
+
BitrateConstraints GetConfig() const;
// The greater min and smaller max set by this and SetClientBitratePreferences
@@ -68,8 +71,6 @@
// Bandwidth cap applied for relayed calls.
DataRate max_bitrate_over_relay_ = DataRate::PlusInfinity();
-
- RTC_DISALLOW_COPY_AND_ASSIGN(RtpBitrateConfigurator);
};
} // namespace webrtc
diff --git a/call/rtp_transport_controller_send.h b/call/rtp_transport_controller_send.h
index 62af78c..e5ff162 100644
--- a/call/rtp_transport_controller_send.h
+++ b/call/rtp_transport_controller_send.h
@@ -32,7 +32,6 @@
#include "modules/pacing/rtp_packet_pacer.h"
#include "modules/pacing/task_queue_paced_sender.h"
#include "modules/utility/include/process_thread.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/network_route.h"
#include "rtc_base/race_checker.h"
#include "rtc_base/task_queue.h"
@@ -63,6 +62,10 @@
const WebRtcKeyValueConfig* trials);
~RtpTransportControllerSend() override;
+ RtpTransportControllerSend(const RtpTransportControllerSend&) = delete;
+ RtpTransportControllerSend& operator=(const RtpTransportControllerSend&) =
+ delete;
+
// TODO(tommi): Change to std::unique_ptr<>.
RtpVideoSenderInterface* CreateRtpVideoSender(
const std::map<uint32_t, RtpState>& suspended_ssrcs,
@@ -215,7 +218,6 @@
// `task_queue_` is defined last to ensure all pending tasks are cancelled
// and deleted before any other members.
rtc::TaskQueue task_queue_;
- RTC_DISALLOW_COPY_AND_ASSIGN(RtpTransportControllerSend);
};
} // namespace webrtc
diff --git a/call/rtp_video_sender.h b/call/rtp_video_sender.h
index 25ef20f..9832246 100644
--- a/call/rtp_video_sender.h
+++ b/call/rtp_video_sender.h
@@ -35,7 +35,6 @@
#include "modules/rtp_rtcp/source/rtp_sender_video.h"
#include "modules/rtp_rtcp/source/rtp_sequence_number_map.h"
#include "modules/rtp_rtcp/source/rtp_video_header.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/rate_limiter.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/thread_annotations.h"
@@ -89,6 +88,9 @@
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer);
~RtpVideoSender() override;
+ RtpVideoSender(const RtpVideoSender&) = delete;
+ RtpVideoSender& operator=(const RtpVideoSender&) = delete;
+
// RtpVideoSender will only route packets if being active, all packets will be
// dropped otherwise.
void SetActive(bool active) RTC_LOCKS_EXCLUDED(mutex_) override;
@@ -209,8 +211,6 @@
// This map is set at construction time and never changed, but it's
// non-trivial to make it properly const.
std::map<uint32_t, RtpRtcpInterface*> ssrc_to_rtp_module_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(RtpVideoSender);
};
} // namespace webrtc
diff --git a/logging/rtc_event_log/encoder/bit_writer.h b/logging/rtc_event_log/encoder/bit_writer.h
index 85340c3..421e7c4 100644
--- a/logging/rtc_event_log/encoder/bit_writer.h
+++ b/logging/rtc_event_log/encoder/bit_writer.h
@@ -20,7 +20,6 @@
#include "absl/strings/string_view.h"
#include "rtc_base/bit_buffer.h"
#include "rtc_base/checks.h"
-#include "rtc_base/constructor_magic.h"
namespace webrtc {
@@ -36,6 +35,9 @@
RTC_DCHECK_GT(byte_count, 0);
}
+ BitWriter(const BitWriter&) = delete;
+ BitWriter& operator=(const BitWriter&) = delete;
+
void WriteBits(uint64_t val, size_t bit_count);
void WriteBits(absl::string_view input);
@@ -52,8 +54,6 @@
// to go anywhere near the limit, though, so this is good enough.
size_t written_bits_;
bool valid_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(BitWriter);
};
} // namespace webrtc
diff --git a/logging/rtc_event_log/encoder/delta_encoding.cc b/logging/rtc_event_log/encoder/delta_encoding.cc
index a96d3a7..3a2bee1 100644
--- a/logging/rtc_event_log/encoder/delta_encoding.cc
+++ b/logging/rtc_event_log/encoder/delta_encoding.cc
@@ -21,7 +21,6 @@
#include "rtc_base/bit_buffer.h"
#include "rtc_base/bitstream_reader.h"
#include "rtc_base/checks.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
@@ -187,6 +186,9 @@
absl::optional<uint64_t> base,
const std::vector<absl::optional<uint64_t>>& values);
+ FixedLengthDeltaEncoder(const FixedLengthDeltaEncoder&) = delete;
+ FixedLengthDeltaEncoder& operator=(const FixedLengthDeltaEncoder&) = delete;
+
private:
// Calculate min/max values of unsigned/signed deltas, given the bit width
// of all the values in the series.
@@ -249,8 +251,6 @@
// ctor has finished running when this is constructed, so that the lower
// bound on the buffer size would be guaranteed correct.
std::unique_ptr<BitWriter> writer_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(FixedLengthDeltaEncoder);
};
// TODO(eladalon): Reduce the number of passes.
@@ -566,6 +566,9 @@
absl::optional<uint64_t> base,
size_t num_of_deltas);
+ FixedLengthDeltaDecoder(const FixedLengthDeltaDecoder&) = delete;
+ FixedLengthDeltaDecoder& operator=(const FixedLengthDeltaDecoder&) = delete;
+
private:
// Reads the encoding header in `input` and returns a FixedLengthDeltaDecoder
// with the corresponding configuration, that can be used to decode the
@@ -619,8 +622,6 @@
// The number of values to be known to be decoded.
const size_t num_of_deltas_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(FixedLengthDeltaDecoder);
};
bool FixedLengthDeltaDecoder::IsSuitableDecoderFor(const std::string& input) {
diff --git a/modules/video_coding/utility/ivf_file_reader.h b/modules/video_coding/utility/ivf_file_reader.h
index 5e0634f..cc64d4c 100644
--- a/modules/video_coding/utility/ivf_file_reader.h
+++ b/modules/video_coding/utility/ivf_file_reader.h
@@ -17,6 +17,7 @@
#include "absl/types/optional.h"
#include "api/video/encoded_image.h"
#include "api/video_codecs/video_codec.h"
+#include "rtc_base/constructor_magic.h"
#include "rtc_base/system/file_wrapper.h"
namespace webrtc {
diff --git a/p2p/base/async_stun_tcp_socket.h b/p2p/base/async_stun_tcp_socket.h
index eb4eef7..f0df42b 100644
--- a/p2p/base/async_stun_tcp_socket.h
+++ b/p2p/base/async_stun_tcp_socket.h
@@ -15,7 +15,6 @@
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/async_tcp_socket.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/socket.h"
#include "rtc_base/socket_address.h"
@@ -32,6 +31,9 @@
explicit AsyncStunTCPSocket(rtc::Socket* socket);
+ AsyncStunTCPSocket(const AsyncStunTCPSocket&) = delete;
+ AsyncStunTCPSocket& operator=(const AsyncStunTCPSocket&) = delete;
+
int Send(const void* pv,
size_t cb,
const rtc::PacketOptions& options) override;
@@ -42,8 +44,6 @@
// This method also returns the number of padding bytes needed/added to the
// turn message. `pad_bytes` should be used only when `is_turn` is true.
size_t GetExpectedLength(const void* data, size_t len, int* pad_bytes);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(AsyncStunTCPSocket);
};
} // namespace cricket
diff --git a/p2p/base/dtls_transport.h b/p2p/base/dtls_transport.h
index edfa889..d503a92 100644
--- a/p2p/base/dtls_transport.h
+++ b/p2p/base/dtls_transport.h
@@ -22,7 +22,6 @@
#include "p2p/base/ice_transport_internal.h"
#include "rtc_base/buffer.h"
#include "rtc_base/buffer_queue.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/ssl_stream_adapter.h"
#include "rtc_base/stream.h"
#include "rtc_base/strings/string_builder.h"
@@ -40,6 +39,9 @@
public:
explicit StreamInterfaceChannel(IceTransportInternal* ice_transport);
+ StreamInterfaceChannel(const StreamInterfaceChannel&) = delete;
+ StreamInterfaceChannel& operator=(const StreamInterfaceChannel&) = delete;
+
// Push in a packet; this gets pulled out from Read().
bool OnPacketReceived(const char* data, size_t size);
@@ -60,8 +62,6 @@
IceTransportInternal* const ice_transport_; // owned by DtlsTransport
rtc::StreamState state_ RTC_GUARDED_BY(sequence_checker_);
rtc::BufferQueue packets_ RTC_GUARDED_BY(sequence_checker_);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(StreamInterfaceChannel);
};
// This class provides a DTLS SSLStreamAdapter inside a TransportChannel-style
@@ -110,6 +110,9 @@
~DtlsTransport() override;
+ DtlsTransport(const DtlsTransport&) = delete;
+ DtlsTransport& operator=(const DtlsTransport&) = delete;
+
webrtc::DtlsTransportState dtls_state() const override;
const std::string& transport_name() const override;
int component() const override;
@@ -248,8 +251,6 @@
bool writable_ = false;
webrtc::RtcEventLog* const event_log_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransport);
};
} // namespace cricket
diff --git a/p2p/base/dtls_transport_internal.h b/p2p/base/dtls_transport_internal.h
index 0b26a7f..24c682f 100644
--- a/p2p/base/dtls_transport_internal.h
+++ b/p2p/base/dtls_transport_internal.h
@@ -25,7 +25,6 @@
#include "p2p/base/ice_transport_internal.h"
#include "p2p/base/packet_transport_internal.h"
#include "rtc_base/callback_list.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/ssl_certificate.h"
#include "rtc_base/ssl_fingerprint.h"
#include "rtc_base/ssl_stream_adapter.h"
@@ -48,6 +47,9 @@
public:
~DtlsTransportInternal() override;
+ DtlsTransportInternal(const DtlsTransportInternal&) = delete;
+ DtlsTransportInternal& operator=(const DtlsTransportInternal&) = delete;
+
virtual webrtc::DtlsTransportState dtls_state() const = 0;
virtual int component() const = 0;
@@ -135,7 +137,6 @@
DtlsTransportInternal();
private:
- RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportInternal);
webrtc::CallbackList<const rtc::SSLHandshakeError>
dtls_handshake_error_callback_list_;
webrtc::CallbackList<DtlsTransportInternal*, const webrtc::DtlsTransportState>
diff --git a/p2p/base/p2p_transport_channel.h b/p2p/base/p2p_transport_channel.h
index 28248e7..7f5fb05 100644
--- a/p2p/base/p2p_transport_channel.h
+++ b/p2p/base/p2p_transport_channel.h
@@ -56,7 +56,6 @@
#include "p2p/base/transport_description.h"
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/checks.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/dscp.h"
#include "rtc_base/network/sent_packet.h"
#include "rtc_base/network_route.h"
@@ -124,6 +123,9 @@
IceControllerFactoryInterface* ice_controller_factory = nullptr);
~P2PTransportChannel() override;
+ P2PTransportChannel(const P2PTransportChannel&) = delete;
+ P2PTransportChannel& operator=(const P2PTransportChannel&) = delete;
+
// From TransportChannelImpl:
IceTransportState GetState() const override;
webrtc::IceTransportState GetIceTransportState() const override;
@@ -494,8 +496,6 @@
int64_t last_data_received_ms_ = 0;
IceFieldTrials field_trials_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
};
} // namespace cricket
diff --git a/p2p/stunprober/stun_prober.cc b/p2p/stunprober/stun_prober.cc
index 4195230..efe0fbd 100644
--- a/p2p/stunprober/stun_prober.cc
+++ b/p2p/stunprober/stun_prober.cc
@@ -21,7 +21,6 @@
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/async_resolver_interface.h"
#include "rtc_base/checks.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/helpers.h"
#include "rtc_base/logging.h"
#include "rtc_base/task_utils/to_queued_task.h"
@@ -69,6 +68,9 @@
const std::vector<rtc::SocketAddress>& server_ips);
~Requester() override;
+ Requester(const Requester&) = delete;
+ Requester& operator=(const Requester&) = delete;
+
// There is no callback for SendStunRequest as the underneath socket send is
// expected to be completed immediately. Otherwise, it'll skip this request
// and move to the next one.
@@ -105,8 +107,6 @@
int16_t num_response_received_ = 0;
webrtc::SequenceChecker& thread_checker_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(Requester);
};
StunProber::Requester::Requester(
diff --git a/p2p/stunprober/stun_prober.h b/p2p/stunprober/stun_prober.h
index fe2f14c..b562394 100644
--- a/p2p/stunprober/stun_prober.h
+++ b/p2p/stunprober/stun_prober.h
@@ -17,7 +17,6 @@
#include "api/sequence_checker.h"
#include "rtc_base/byte_buffer.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/ip_address.h"
#include "rtc_base/network.h"
#include "rtc_base/socket_address.h"
@@ -101,6 +100,9 @@
const rtc::NetworkManager::NetworkList& networks);
~StunProber() override;
+ StunProber(const StunProber&) = delete;
+ StunProber& operator=(const StunProber&) = delete;
+
// Begin performing the probe test against the `servers`. If
// `shared_socket_mode` is false, each request will be done with a new socket.
// Otherwise, a unique socket will be used for a single round of requests
@@ -241,8 +243,6 @@
rtc::NetworkManager::NetworkList networks_;
webrtc::ScopedTaskSafety task_safety_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(StunProber);
};
} // namespace stunprober
diff --git a/pc/dtmf_sender.h b/pc/dtmf_sender.h
index a208b10..915d987 100644
--- a/pc/dtmf_sender.h
+++ b/pc/dtmf_sender.h
@@ -18,7 +18,6 @@
#include "api/dtmf_sender_interface.h"
#include "api/scoped_refptr.h"
#include "pc/proxy.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/location.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/task_utils/pending_task_safety_flag.h"
@@ -72,6 +71,9 @@
DtmfSender(rtc::Thread* signaling_thread, DtmfProviderInterface* provider);
virtual ~DtmfSender();
+ DtmfSender(const DtmfSender&) = delete;
+ DtmfSender& operator=(const DtmfSender&) = delete;
+
private:
DtmfSender();
@@ -96,8 +98,6 @@
// For cancelling the tasks which feed the DTMF provider one tone at a time.
rtc::scoped_refptr<PendingTaskSafetyFlag> safety_flag_ RTC_GUARDED_BY(
signaling_thread_) RTC_PT_GUARDED_BY(signaling_thread_) = nullptr;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(DtmfSender);
};
// Define proxy for DtmfSenderInterface.
diff --git a/pc/jsep_transport.h b/pc/jsep_transport.h
index e3e929b..93604a1 100644
--- a/pc/jsep_transport.h
+++ b/pc/jsep_transport.h
@@ -44,7 +44,6 @@
#include "pc/srtp_transport.h"
#include "pc/transport_stats.h"
#include "rtc_base/checks.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/rtc_certificate.h"
#include "rtc_base/ssl_fingerprint.h"
#include "rtc_base/ssl_stream_adapter.h"
@@ -106,6 +105,9 @@
~JsepTransport();
+ JsepTransport(const JsepTransport&) = delete;
+ JsepTransport& operator=(const JsepTransport&) = delete;
+
// Returns the MID of this transport. This is only used for logging.
const std::string& mid() const { return mid_; }
@@ -326,8 +328,6 @@
// `rtcp_dtls_transport_` is destroyed. The JsepTransportController will
// receive the callback and update the aggregate transport states.
std::function<void()> rtcp_mux_active_callback_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport);
};
} // namespace cricket
diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h
index fb42009..4e06566 100644
--- a/pc/jsep_transport_controller.h
+++ b/pc/jsep_transport_controller.h
@@ -58,7 +58,6 @@
#include "pc/transport_stats.h"
#include "rtc_base/callback_list.h"
#include "rtc_base/checks.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/helpers.h"
#include "rtc_base/ref_counted_object.h"
@@ -150,6 +149,9 @@
Config config);
virtual ~JsepTransportController();
+ JsepTransportController(const JsepTransportController&) = delete;
+ JsepTransportController& operator=(const JsepTransportController&) = delete;
+
// The main method to be called; applies a description at the transport
// level, creating/destroying transport objects as needed and updating their
// properties. This includes RTP, DTLS, and ICE (but not SCTP). At least not
@@ -478,8 +480,6 @@
rtc::scoped_refptr<rtc::RTCCertificate> certificate_;
BundleManager bundles_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransportController);
};
} // namespace webrtc
diff --git a/pc/srtp_session.h b/pc/srtp_session.h
index 89fab0d..f1b6a52 100644
--- a/pc/srtp_session.h
+++ b/pc/srtp_session.h
@@ -15,7 +15,6 @@
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
// Forward declaration to avoid pulling in libsrtp headers here
@@ -35,6 +34,9 @@
SrtpSession();
~SrtpSession();
+ SrtpSession(const SrtpSession&) = delete;
+ SrtpSession& operator=(const SrtpSession&) = delete;
+
// Configures the session for sending data using the specified
// cipher-suite and key. Receiving must be done by a separate session.
bool SetSend(int cs,
@@ -141,7 +143,6 @@
bool external_auth_enabled_ = false;
int decryption_failure_count_ = 0;
bool dump_plain_rtp_ = false;
- RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession);
};
} // namespace cricket
diff --git a/pc/video_rtp_track_source.h b/pc/video_rtp_track_source.h
index 23a7cd2..a9e43f6 100644
--- a/pc/video_rtp_track_source.h
+++ b/pc/video_rtp_track_source.h
@@ -20,7 +20,6 @@
#include "api/video/video_source_interface.h"
#include "media/base/video_broadcaster.h"
#include "pc/video_track_source.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/system/no_unique_address.h"
#include "rtc_base/thread_annotations.h"
@@ -45,6 +44,9 @@
explicit VideoRtpTrackSource(Callback* callback);
+ VideoRtpTrackSource(const VideoRtpTrackSource&) = delete;
+ VideoRtpTrackSource& operator=(const VideoRtpTrackSource&) = delete;
+
// Call before the object implementing Callback finishes it's destructor. No
// more callbacks will be fired after completion. Must be called on the
// worker thread
@@ -83,8 +85,6 @@
std::vector<rtc::VideoSinkInterface<RecordableEncodedFrame>*> encoded_sinks_
RTC_GUARDED_BY(mu_);
Callback* callback_ RTC_GUARDED_BY(worker_sequence_checker_);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(VideoRtpTrackSource);
};
} // namespace webrtc
diff --git a/pc/webrtc_session_description_factory.h b/pc/webrtc_session_description_factory.h
index 8e80fb5..efa208f 100644
--- a/pc/webrtc_session_description_factory.h
+++ b/pc/webrtc_session_description_factory.h
@@ -26,7 +26,6 @@
#include "pc/channel_manager.h"
#include "pc/media_session.h"
#include "pc/sdp_state_provider.h"
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/message_handler.h"
#include "rtc_base/rtc_certificate.h"
#include "rtc_base/rtc_certificate_generator.h"
@@ -92,6 +91,11 @@
on_certificate_ready);
virtual ~WebRtcSessionDescriptionFactory();
+ WebRtcSessionDescriptionFactory(const WebRtcSessionDescriptionFactory&) =
+ delete;
+ WebRtcSessionDescriptionFactory& operator=(
+ const WebRtcSessionDescriptionFactory&) = delete;
+
static void CopyCandidatesFromSessionDescription(
const SessionDescriptionInterface* source_desc,
const std::string& content_name,
@@ -159,8 +163,6 @@
std::function<void(const rtc::scoped_refptr<rtc::RTCCertificate>&)>
on_certificate_ready_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSessionDescriptionFactory);
};
} // namespace webrtc
diff --git a/system_wrappers/source/metrics.cc b/system_wrappers/source/metrics.cc
index b14eef4..8c9cf0c 100644
--- a/system_wrappers/source/metrics.cc
+++ b/system_wrappers/source/metrics.cc
@@ -11,7 +11,6 @@
#include <algorithm>
-#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/thread_annotations.h"
@@ -35,6 +34,9 @@
RTC_DCHECK_GT(bucket_count, 0);
}
+ RtcHistogram(const RtcHistogram&) = delete;
+ RtcHistogram& operator=(const RtcHistogram&) = delete;
+
void Add(int sample) {
sample = std::min(sample, max_);
sample = std::max(sample, min_ - 1); // Underflow bucket.
@@ -99,8 +101,6 @@
const int min_;
const int max_;
SampleInfo info_ RTC_GUARDED_BY(mutex_);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(RtcHistogram);
};
class RtcHistogramMap {
@@ -108,6 +108,9 @@
RtcHistogramMap() {}
~RtcHistogramMap() {}
+ RtcHistogramMap(const RtcHistogramMap&) = delete;
+ RtcHistogramMap& operator=(const RtcHistogramMap&) = delete;
+
Histogram* GetCountsHistogram(const std::string& name,
int min,
int max,
@@ -178,8 +181,6 @@
mutable Mutex mutex_;
std::map<std::string, std::unique_ptr<RtcHistogram>> map_
RTC_GUARDED_BY(mutex_);
-
- RTC_DISALLOW_COPY_AND_ASSIGN(RtcHistogramMap);
};
// RtcHistogramMap is allocated upon call to Enable().
diff --git a/test/network/network_emulation.h b/test/network/network_emulation.h
index e60deaf..d10e9a8 100644
--- a/test/network/network_emulation.h
+++ b/test/network/network_emulation.h
@@ -26,6 +26,7 @@
#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"