commit 77772d24a81a3382db5c723aa1876d235f8283cb parent 9fd746606b4dd7bbde2203fdee339727d9f133aa Author: Dan Baker <dbaker@mozilla.com> Date: Thu, 23 Oct 2025 17:24:36 -0600 Bug 1995393 - Vendor libwebrtc from 4e1217b0dd Upstream commit: https://webrtc.googlesource.com/src/+/4e1217b0dd975827e8659b8e28559c79e8f6c004 Cleanup RtcEvents copy constructors Remove direct references and make RtcEvent data member private as mandated by style guide. This would simplify changing type of that data member. Rely on RtcEvent copy constructor over copying one member explicitly, in particular make RtcEvents copy constructors default where possible. While at it cleanup usage of WrapUnique helper - duplicating class name when using that helper is not needed. Bug: webrtc:42223979 Change-Id: I6d81cd69ce86af20c8a31b4716f52a5e93a105d3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405020 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45378} Diffstat:
51 files changed, 60 insertions(+), 193 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T23:21:24.737541+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T23:24:23.591316+00:00. # base of lastest vendoring -234b25c51d +4e1217b0dd diff --git a/third_party/libwebrtc/api/rtc_event_log/rtc_event.h b/third_party/libwebrtc/api/rtc_event_log/rtc_event.h @@ -61,6 +61,8 @@ class RtcEvent { }; RtcEvent(); + RtcEvent(const RtcEvent&) = default; + RtcEvent& operator=(const RtcEvent&) = delete; virtual ~RtcEvent() = default; virtual Type GetType() const = 0; @@ -80,6 +82,7 @@ class RtcEvent { protected: explicit RtcEvent(int64_t timestamp_us) : timestamp_us_(timestamp_us) {} + private: const int64_t timestamp_us_; }; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_alr_state.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_alr_state.cc @@ -15,7 +15,6 @@ #include "absl/memory/memory.h" #include "absl/strings/string_view.h" -#include "api/rtc_event_log/rtc_event.h" #include "logging/rtc_event_log/events/rtc_event_definition.h" #include "logging/rtc_event_log/events/rtc_event_log_parse_status.h" @@ -23,13 +22,10 @@ namespace webrtc { RtcEventAlrState::RtcEventAlrState(bool in_alr) : in_alr_(in_alr) {} -RtcEventAlrState::RtcEventAlrState(const RtcEventAlrState& other) - : RtcEvent(other.timestamp_us_), in_alr_(other.in_alr_) {} - RtcEventAlrState::~RtcEventAlrState() = default; std::unique_ptr<RtcEventAlrState> RtcEventAlrState::Copy() const { - return absl::WrapUnique<RtcEventAlrState>(new RtcEventAlrState(*this)); + return absl::WrapUnique(new RtcEventAlrState(*this)); } RtcEventLogParseStatus RtcEventAlrState::Parse( diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_alr_state.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_alr_state.h @@ -62,7 +62,7 @@ class RtcEventAlrState final : public RtcEvent { std::vector<LoggedAlrStateEvent>& output); private: - RtcEventAlrState(const RtcEventAlrState& other); + RtcEventAlrState(const RtcEventAlrState&) = default; const bool in_alr_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_network_adaptation.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_network_adaptation.cc @@ -28,7 +28,7 @@ RtcEventAudioNetworkAdaptation::RtcEventAudioNetworkAdaptation( RtcEventAudioNetworkAdaptation::RtcEventAudioNetworkAdaptation( const RtcEventAudioNetworkAdaptation& other) - : RtcEvent(other.timestamp_us_), + : RtcEvent(other), config_(std::make_unique<AudioEncoderRuntimeConfig>(*other.config_)) {} RtcEventAudioNetworkAdaptation::~RtcEventAudioNetworkAdaptation() = default; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_playout.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_playout.cc @@ -14,18 +14,13 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { RtcEventAudioPlayout::RtcEventAudioPlayout(uint32_t ssrc) : ssrc_(ssrc) {} -RtcEventAudioPlayout::RtcEventAudioPlayout(const RtcEventAudioPlayout& other) - : RtcEvent(other.timestamp_us_), ssrc_(other.ssrc_) {} - std::unique_ptr<RtcEventAudioPlayout> RtcEventAudioPlayout::Copy() const { - return absl::WrapUnique<RtcEventAudioPlayout>( - new RtcEventAudioPlayout(*this)); + return absl::WrapUnique(new RtcEventAudioPlayout(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_playout.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_playout.h @@ -73,7 +73,7 @@ class RtcEventAudioPlayout final : public RtcEvent { } private: - RtcEventAudioPlayout(const RtcEventAudioPlayout& other); + RtcEventAudioPlayout(const RtcEventAudioPlayout&) = default; const uint32_t ssrc_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_receive_stream_config.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_receive_stream_config.cc @@ -28,15 +28,14 @@ RtcEventAudioReceiveStreamConfig::RtcEventAudioReceiveStreamConfig( RtcEventAudioReceiveStreamConfig::RtcEventAudioReceiveStreamConfig( const RtcEventAudioReceiveStreamConfig& other) - : RtcEvent(other.timestamp_us_), + : RtcEvent(other), config_(std::make_unique<rtclog::StreamConfig>(*other.config_)) {} RtcEventAudioReceiveStreamConfig::~RtcEventAudioReceiveStreamConfig() = default; std::unique_ptr<RtcEventAudioReceiveStreamConfig> RtcEventAudioReceiveStreamConfig::Copy() const { - return absl::WrapUnique<RtcEventAudioReceiveStreamConfig>( - new RtcEventAudioReceiveStreamConfig(*this)); + return absl::WrapUnique(new RtcEventAudioReceiveStreamConfig(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_send_stream_config.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_audio_send_stream_config.cc @@ -28,15 +28,14 @@ RtcEventAudioSendStreamConfig::RtcEventAudioSendStreamConfig( RtcEventAudioSendStreamConfig::RtcEventAudioSendStreamConfig( const RtcEventAudioSendStreamConfig& other) - : RtcEvent(other.timestamp_us_), + : RtcEvent(other), config_(std::make_unique<rtclog::StreamConfig>(*other.config_)) {} RtcEventAudioSendStreamConfig::~RtcEventAudioSendStreamConfig() = default; std::unique_ptr<RtcEventAudioSendStreamConfig> RtcEventAudioSendStreamConfig::Copy() const { - return absl::WrapUnique<RtcEventAudioSendStreamConfig>( - new RtcEventAudioSendStreamConfig(*this)); + return absl::WrapUnique(new RtcEventAudioSendStreamConfig(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_begin_log.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_begin_log.cc @@ -28,9 +28,6 @@ RtcEventBeginLog::RtcEventBeginLog(Timestamp timestamp, Timestamp utc_start_time) : RtcEvent(timestamp.us()), utc_start_time_ms_(utc_start_time.ms()) {} -RtcEventBeginLog::RtcEventBeginLog(const RtcEventBeginLog& other) - : RtcEvent(other.timestamp_us_) {} - RtcEventBeginLog::~RtcEventBeginLog() = default; std::string RtcEventBeginLog::Encode(ArrayView<const RtcEvent*> batch) { diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_begin_log.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_begin_log.h @@ -60,7 +60,7 @@ class RtcEventBeginLog final : public RtcEvent { std::vector<LoggedStartEvent>& output); private: - RtcEventBeginLog(const RtcEventBeginLog& other); + RtcEventBeginLog(const RtcEventBeginLog&) = default; int64_t utc_start_time_ms_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.cc @@ -14,7 +14,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" #include "api/transport/bandwidth_usage.h" namespace webrtc { @@ -24,18 +23,11 @@ RtcEventBweUpdateDelayBased::RtcEventBweUpdateDelayBased( BandwidthUsage detector_state) : bitrate_bps_(bitrate_bps), detector_state_(detector_state) {} -RtcEventBweUpdateDelayBased::RtcEventBweUpdateDelayBased( - const RtcEventBweUpdateDelayBased& other) - : RtcEvent(other.timestamp_us_), - bitrate_bps_(other.bitrate_bps_), - detector_state_(other.detector_state_) {} - RtcEventBweUpdateDelayBased::~RtcEventBweUpdateDelayBased() = default; std::unique_ptr<RtcEventBweUpdateDelayBased> RtcEventBweUpdateDelayBased::Copy() const { - return absl::WrapUnique<RtcEventBweUpdateDelayBased>( - new RtcEventBweUpdateDelayBased(*this)); + return absl::WrapUnique(new RtcEventBweUpdateDelayBased(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.h @@ -117,7 +117,7 @@ class RtcEventBweUpdateDelayBased final : public RtcEvent { } private: - RtcEventBweUpdateDelayBased(const RtcEventBweUpdateDelayBased& other); + RtcEventBweUpdateDelayBased(const RtcEventBweUpdateDelayBased&) = default; const int32_t bitrate_bps_; const BandwidthUsage detector_state_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.cc @@ -14,7 +14,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { @@ -25,19 +24,11 @@ RtcEventBweUpdateLossBased::RtcEventBweUpdateLossBased(int32_t bitrate_bps, fraction_loss_(fraction_loss), total_packets_(total_packets) {} -RtcEventBweUpdateLossBased::RtcEventBweUpdateLossBased( - const RtcEventBweUpdateLossBased& other) - : RtcEvent(other.timestamp_us_), - bitrate_bps_(other.bitrate_bps_), - fraction_loss_(other.fraction_loss_), - total_packets_(other.total_packets_) {} - RtcEventBweUpdateLossBased::~RtcEventBweUpdateLossBased() = default; std::unique_ptr<RtcEventBweUpdateLossBased> RtcEventBweUpdateLossBased::Copy() const { - return absl::WrapUnique<RtcEventBweUpdateLossBased>( - new RtcEventBweUpdateLossBased(*this)); + return absl::WrapUnique(new RtcEventBweUpdateLossBased(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h @@ -78,7 +78,7 @@ class RtcEventBweUpdateLossBased final : public RtcEvent { } private: - RtcEventBweUpdateLossBased(const RtcEventBweUpdateLossBased& other); + RtcEventBweUpdateLossBased(const RtcEventBweUpdateLossBased&) = default; const int32_t bitrate_bps_; const uint8_t fraction_loss_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_transport_state.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_transport_state.cc @@ -14,24 +14,17 @@ #include "absl/memory/memory.h" #include "api/dtls_transport_interface.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { RtcEventDtlsTransportState::RtcEventDtlsTransportState(DtlsTransportState state) : dtls_transport_state_(state) {} -RtcEventDtlsTransportState::RtcEventDtlsTransportState( - const RtcEventDtlsTransportState& other) - : RtcEvent(other.timestamp_us_), - dtls_transport_state_(other.dtls_transport_state_) {} - RtcEventDtlsTransportState::~RtcEventDtlsTransportState() = default; std::unique_ptr<RtcEventDtlsTransportState> RtcEventDtlsTransportState::Copy() const { - return absl::WrapUnique<RtcEventDtlsTransportState>( - new RtcEventDtlsTransportState(*this)); + return absl::WrapUnique(new RtcEventDtlsTransportState(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_transport_state.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_transport_state.h @@ -64,7 +64,7 @@ class RtcEventDtlsTransportState : public RtcEvent { } private: - RtcEventDtlsTransportState(const RtcEventDtlsTransportState& other); + RtcEventDtlsTransportState(const RtcEventDtlsTransportState&) = default; const DtlsTransportState dtls_transport_state_; }; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_writable_state.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_writable_state.cc @@ -13,23 +13,17 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { RtcEventDtlsWritableState::RtcEventDtlsWritableState(bool writable) : writable_(writable) {} -RtcEventDtlsWritableState::RtcEventDtlsWritableState( - const RtcEventDtlsWritableState& other) - : RtcEvent(other.timestamp_us_), writable_(other.writable_) {} - RtcEventDtlsWritableState::~RtcEventDtlsWritableState() = default; std::unique_ptr<RtcEventDtlsWritableState> RtcEventDtlsWritableState::Copy() const { - return absl::WrapUnique<RtcEventDtlsWritableState>( - new RtcEventDtlsWritableState(*this)); + return absl::WrapUnique(new RtcEventDtlsWritableState(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_writable_state.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_dtls_writable_state.h @@ -64,7 +64,7 @@ class RtcEventDtlsWritableState : public RtcEvent { } private: - RtcEventDtlsWritableState(const RtcEventDtlsWritableState& other); + RtcEventDtlsWritableState(const RtcEventDtlsWritableState&) = default; const bool writable_; }; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_end_log.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_end_log.cc @@ -27,9 +27,6 @@ namespace webrtc { RtcEventEndLog::RtcEventEndLog(Timestamp timestamp) : RtcEvent(timestamp.us()) {} -RtcEventEndLog::RtcEventEndLog(const RtcEventEndLog& other) - : RtcEvent(other.timestamp_us_) {} - RtcEventEndLog::~RtcEventEndLog() = default; std::string RtcEventEndLog::Encode(ArrayView<const RtcEvent*> batch) { diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_end_log.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_end_log.h @@ -53,7 +53,7 @@ class RtcEventEndLog final : public RtcEvent { std::vector<LoggedStopEvent>& output); private: - RtcEventEndLog(const RtcEventEndLog& other); + RtcEventEndLog(const RtcEventEndLog&) = default; static constexpr EventParameters event_params_{"EndLog", RtcEventEndLog::kType}; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_frame_decoded.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_frame_decoded.cc @@ -14,7 +14,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" #include "api/video/video_codec_type.h" namespace webrtc { @@ -32,18 +31,8 @@ RtcEventFrameDecoded::RtcEventFrameDecoded(int64_t render_time_ms, codec_(codec), qp_(qp) {} -RtcEventFrameDecoded::RtcEventFrameDecoded(const RtcEventFrameDecoded& other) - : RtcEvent(other.timestamp_us_), - render_time_ms_(other.render_time_ms_), - ssrc_(other.ssrc_), - width_(other.width_), - height_(other.height_), - codec_(other.codec_), - qp_(other.qp_) {} - std::unique_ptr<RtcEventFrameDecoded> RtcEventFrameDecoded::Copy() const { - return absl::WrapUnique<RtcEventFrameDecoded>( - new RtcEventFrameDecoded(*this)); + return absl::WrapUnique(new RtcEventFrameDecoded(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_frame_decoded.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_frame_decoded.h @@ -79,7 +79,7 @@ class RtcEventFrameDecoded final : public RtcEvent { } private: - RtcEventFrameDecoded(const RtcEventFrameDecoded& other); + RtcEventFrameDecoded(const RtcEventFrameDecoded&) = default; const int64_t render_time_ms_; const uint32_t ssrc_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_ack_received.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_ack_received.cc @@ -16,6 +16,7 @@ #include <vector> #include "absl/memory/memory.h" +#include "api/array_view.h" #include "api/rtc_event_log/rtc_event.h" #include "rtc_base/time_utils.h" @@ -24,7 +25,7 @@ namespace webrtc { std::vector<std::unique_ptr<RtcEventGenericAckReceived>> RtcEventGenericAckReceived::CreateLogs( int64_t packet_number, - const std::vector<AckedPacket>& acked_packets) { + ArrayView<const AckedPacket> acked_packets) { std::vector<std::unique_ptr<RtcEventGenericAckReceived>> result; int64_t time_us = TimeMicros(); result.reserve(acked_packets.size()); @@ -51,9 +52,6 @@ std::unique_ptr<RtcEventGenericAckReceived> RtcEventGenericAckReceived::Copy() return absl::WrapUnique(new RtcEventGenericAckReceived(*this)); } -RtcEventGenericAckReceived::RtcEventGenericAckReceived( - const RtcEventGenericAckReceived& packet) = default; - RtcEventGenericAckReceived::~RtcEventGenericAckReceived() = default; } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_ack_received.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_ack_received.h @@ -63,7 +63,7 @@ class RtcEventGenericAckReceived final : public RtcEvent { // the same timestamp. static std::vector<std::unique_ptr<RtcEventGenericAckReceived>> CreateLogs( int64_t packet_number, - const std::vector<AckedPacket>& acked_packets); + ArrayView<const AckedPacket> acked_packets); ~RtcEventGenericAckReceived() override; @@ -97,7 +97,7 @@ class RtcEventGenericAckReceived final : public RtcEvent { } private: - RtcEventGenericAckReceived(const RtcEventGenericAckReceived& packet); + RtcEventGenericAckReceived(const RtcEventGenericAckReceived&) = default; // When the ack is received, `packet_number` identifies the packet which // contained an ack for `acked_packet_number`, and contains the diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_received.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_received.cc @@ -23,9 +23,6 @@ RtcEventGenericPacketReceived::RtcEventGenericPacketReceived( size_t packet_length) : packet_number_(packet_number), packet_length_(packet_length) {} -RtcEventGenericPacketReceived::RtcEventGenericPacketReceived( - const RtcEventGenericPacketReceived& packet) = default; - RtcEventGenericPacketReceived::~RtcEventGenericPacketReceived() = default; std::unique_ptr<RtcEventGenericPacketReceived> diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_received.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_received.h @@ -76,7 +76,7 @@ class RtcEventGenericPacketReceived final : public RtcEvent { } private: - RtcEventGenericPacketReceived(const RtcEventGenericPacketReceived& packet); + RtcEventGenericPacketReceived(const RtcEventGenericPacketReceived&) = default; const int64_t packet_number_; const size_t packet_length_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_sent.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_sent.cc @@ -27,9 +27,6 @@ RtcEventGenericPacketSent::RtcEventGenericPacketSent(int64_t packet_number, payload_length_(payload_length), padding_length_(padding_length) {} -RtcEventGenericPacketSent::RtcEventGenericPacketSent( - const RtcEventGenericPacketSent& packet) = default; - RtcEventGenericPacketSent::~RtcEventGenericPacketSent() = default; std::unique_ptr<RtcEventGenericPacketSent> RtcEventGenericPacketSent::Copy() diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_sent.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_generic_packet_sent.h @@ -100,7 +100,7 @@ class RtcEventGenericPacketSent final : public RtcEvent { } private: - RtcEventGenericPacketSent(const RtcEventGenericPacketSent& packet); + RtcEventGenericPacketSent(const RtcEventGenericPacketSent&) = default; const int64_t packet_number_; const size_t overhead_length_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.cc @@ -14,7 +14,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { @@ -26,19 +25,11 @@ RtcEventIceCandidatePair::RtcEventIceCandidatePair( candidate_pair_id_(candidate_pair_id), transaction_id_(transaction_id) {} -RtcEventIceCandidatePair::RtcEventIceCandidatePair( - const RtcEventIceCandidatePair& other) - : RtcEvent(other.timestamp_us_), - type_(other.type_), - candidate_pair_id_(other.candidate_pair_id_), - transaction_id_(other.transaction_id_) {} - RtcEventIceCandidatePair::~RtcEventIceCandidatePair() = default; std::unique_ptr<RtcEventIceCandidatePair> RtcEventIceCandidatePair::Copy() const { - return absl::WrapUnique<RtcEventIceCandidatePair>( - new RtcEventIceCandidatePair(*this)); + return absl::WrapUnique(new RtcEventIceCandidatePair(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h @@ -87,7 +87,7 @@ class RtcEventIceCandidatePair final : public RtcEvent { } private: - RtcEventIceCandidatePair(const RtcEventIceCandidatePair& other); + RtcEventIceCandidatePair(const RtcEventIceCandidatePair& other) = default; const IceCandidatePairEventType type_; const uint32_t candidate_pair_id_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.cc @@ -15,7 +15,6 @@ #include "absl/memory/memory.h" #include "api/candidate.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { @@ -52,19 +51,11 @@ RtcEventIceCandidatePairConfig::RtcEventIceCandidatePairConfig( candidate_pair_id_(candidate_pair_id), candidate_pair_desc_(candidate_pair_desc) {} -RtcEventIceCandidatePairConfig::RtcEventIceCandidatePairConfig( - const RtcEventIceCandidatePairConfig& other) - : RtcEvent(other.timestamp_us_), - type_(other.type_), - candidate_pair_id_(other.candidate_pair_id_), - candidate_pair_desc_(other.candidate_pair_desc_) {} - RtcEventIceCandidatePairConfig::~RtcEventIceCandidatePairConfig() = default; std::unique_ptr<RtcEventIceCandidatePairConfig> RtcEventIceCandidatePairConfig::Copy() const { - return absl::WrapUnique<RtcEventIceCandidatePairConfig>( - new RtcEventIceCandidatePairConfig(*this)); + return absl::WrapUnique(new RtcEventIceCandidatePairConfig(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h @@ -132,7 +132,8 @@ class RtcEventIceCandidatePairConfig final : public RtcEvent { } private: - RtcEventIceCandidatePairConfig(const RtcEventIceCandidatePairConfig& other); + RtcEventIceCandidatePairConfig(const RtcEventIceCandidatePairConfig&) = + default; const IceCandidatePairConfigType type_; const uint32_t candidate_pair_id_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_neteq_set_minimum_delay.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_neteq_set_minimum_delay.h @@ -52,8 +52,7 @@ class RtcEventNetEqSetMinimumDelay final : public RtcEvent { int minimum_delay_ms() const { return minimum_delay_ms_; } std::unique_ptr<RtcEventNetEqSetMinimumDelay> Copy() const { - return absl::WrapUnique<RtcEventNetEqSetMinimumDelay>( - new RtcEventNetEqSetMinimumDelay(*this)); + return absl::WrapUnique(new RtcEventNetEqSetMinimumDelay(*this)); } private: diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_cluster_created.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_cluster_created.cc @@ -14,7 +14,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { @@ -27,18 +26,9 @@ RtcEventProbeClusterCreated::RtcEventProbeClusterCreated(int32_t id, min_probes_(min_probes), min_bytes_(min_bytes) {} -RtcEventProbeClusterCreated::RtcEventProbeClusterCreated( - const RtcEventProbeClusterCreated& other) - : RtcEvent(other.timestamp_us_), - id_(other.id_), - bitrate_bps_(other.bitrate_bps_), - min_probes_(other.min_probes_), - min_bytes_(other.min_bytes_) {} - std::unique_ptr<RtcEventProbeClusterCreated> RtcEventProbeClusterCreated::Copy() const { - return absl::WrapUnique<RtcEventProbeClusterCreated>( - new RtcEventProbeClusterCreated(*this)); + return absl::WrapUnique(new RtcEventProbeClusterCreated(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_cluster_created.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_cluster_created.h @@ -83,7 +83,7 @@ class RtcEventProbeClusterCreated final : public RtcEvent { } private: - RtcEventProbeClusterCreated(const RtcEventProbeClusterCreated& other); + RtcEventProbeClusterCreated(const RtcEventProbeClusterCreated&) = default; const int32_t id_; const int32_t bitrate_bps_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_failure.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_failure.cc @@ -14,7 +14,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { @@ -23,16 +22,9 @@ RtcEventProbeResultFailure::RtcEventProbeResultFailure( ProbeFailureReason failure_reason) : id_(id), failure_reason_(failure_reason) {} -RtcEventProbeResultFailure::RtcEventProbeResultFailure( - const RtcEventProbeResultFailure& other) - : RtcEvent(other.timestamp_us_), - id_(other.id_), - failure_reason_(other.failure_reason_) {} - std::unique_ptr<RtcEventProbeResultFailure> RtcEventProbeResultFailure::Copy() const { - return absl::WrapUnique<RtcEventProbeResultFailure>( - new RtcEventProbeResultFailure(*this)); + return absl::WrapUnique(new RtcEventProbeResultFailure(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_failure.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_failure.h @@ -77,7 +77,7 @@ class RtcEventProbeResultFailure final : public RtcEvent { } private: - RtcEventProbeResultFailure(const RtcEventProbeResultFailure& other); + RtcEventProbeResultFailure(const RtcEventProbeResultFailure&) = default; const int32_t id_; const ProbeFailureReason failure_reason_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_success.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_success.cc @@ -14,7 +14,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { @@ -22,16 +21,9 @@ RtcEventProbeResultSuccess::RtcEventProbeResultSuccess(int32_t id, int32_t bitrate_bps) : id_(id), bitrate_bps_(bitrate_bps) {} -RtcEventProbeResultSuccess::RtcEventProbeResultSuccess( - const RtcEventProbeResultSuccess& other) - : RtcEvent(other.timestamp_us_), - id_(other.id_), - bitrate_bps_(other.bitrate_bps_) {} - std::unique_ptr<RtcEventProbeResultSuccess> RtcEventProbeResultSuccess::Copy() const { - return absl::WrapUnique<RtcEventProbeResultSuccess>( - new RtcEventProbeResultSuccess(*this)); + return absl::WrapUnique(new RtcEventProbeResultSuccess(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_success.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_probe_result_success.h @@ -70,7 +70,7 @@ class RtcEventProbeResultSuccess final : public RtcEvent { } private: - RtcEventProbeResultSuccess(const RtcEventProbeResultSuccess& other); + RtcEventProbeResultSuccess(const RtcEventProbeResultSuccess&) = default; const int32_t id_; const int32_t bitrate_bps_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_route_change.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_route_change.cc @@ -14,22 +14,16 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" namespace webrtc { RtcEventRouteChange::RtcEventRouteChange(bool connected, uint32_t overhead) : connected_(connected), overhead_(overhead) {} -RtcEventRouteChange::RtcEventRouteChange(const RtcEventRouteChange& other) - : RtcEvent(other.timestamp_us_), - connected_(other.connected_), - overhead_(other.overhead_) {} - RtcEventRouteChange::~RtcEventRouteChange() = default; std::unique_ptr<RtcEventRouteChange> RtcEventRouteChange::Copy() const { - return absl::WrapUnique<RtcEventRouteChange>(new RtcEventRouteChange(*this)); + return absl::WrapUnique(new RtcEventRouteChange(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_route_change.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_route_change.h @@ -67,7 +67,7 @@ class RtcEventRouteChange final : public RtcEvent { } private: - RtcEventRouteChange(const RtcEventRouteChange& other); + RtcEventRouteChange(const RtcEventRouteChange&) = default; const bool connected_; const uint32_t overhead_; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.cc @@ -25,15 +25,13 @@ RtcEventRtcpPacketIncoming::RtcEventRtcpPacketIncoming( RtcEventRtcpPacketIncoming::RtcEventRtcpPacketIncoming( const RtcEventRtcpPacketIncoming& other) - : RtcEvent(other.timestamp_us_), - packet_(other.packet_.data(), other.packet_.size()) {} + : RtcEvent(other), packet_(other.packet_.data(), other.packet_.size()) {} RtcEventRtcpPacketIncoming::~RtcEventRtcpPacketIncoming() = default; std::unique_ptr<RtcEventRtcpPacketIncoming> RtcEventRtcpPacketIncoming::Copy() const { - return absl::WrapUnique<RtcEventRtcpPacketIncoming>( - new RtcEventRtcpPacketIncoming(*this)); + return absl::WrapUnique(new RtcEventRtcpPacketIncoming(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtcp_packet_outgoing.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtcp_packet_outgoing.cc @@ -25,15 +25,13 @@ RtcEventRtcpPacketOutgoing::RtcEventRtcpPacketOutgoing( RtcEventRtcpPacketOutgoing::RtcEventRtcpPacketOutgoing( const RtcEventRtcpPacketOutgoing& other) - : RtcEvent(other.timestamp_us_), - packet_(other.packet_.data(), other.packet_.size()) {} + : RtcEvent(other), packet_(other.packet_.data(), other.packet_.size()) {} RtcEventRtcpPacketOutgoing::~RtcEventRtcpPacketOutgoing() = default; std::unique_ptr<RtcEventRtcpPacketOutgoing> RtcEventRtcpPacketOutgoing::Copy() const { - return absl::WrapUnique<RtcEventRtcpPacketOutgoing>( - new RtcEventRtcpPacketOutgoing(*this)); + return absl::WrapUnique(new RtcEventRtcpPacketOutgoing(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_incoming.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_incoming.cc @@ -13,7 +13,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" #include "modules/rtp_rtcp/source/rtp_packet_received.h" namespace webrtc { @@ -22,16 +21,11 @@ RtcEventRtpPacketIncoming::RtcEventRtpPacketIncoming( const RtpPacketReceived& packet) : packet_(packet) {} -RtcEventRtpPacketIncoming::RtcEventRtpPacketIncoming( - const RtcEventRtpPacketIncoming& other) - : RtcEvent(other.timestamp_us_), packet_(other.packet_) {} - RtcEventRtpPacketIncoming::~RtcEventRtpPacketIncoming() = default; std::unique_ptr<RtcEventRtpPacketIncoming> RtcEventRtpPacketIncoming::Copy() const { - return absl::WrapUnique<RtcEventRtpPacketIncoming>( - new RtcEventRtpPacketIncoming(*this)); + return absl::WrapUnique(new RtcEventRtpPacketIncoming(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_incoming.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_incoming.h @@ -83,7 +83,7 @@ class RtcEventRtpPacketIncoming final : public RtcEvent { } private: - RtcEventRtpPacketIncoming(const RtcEventRtpPacketIncoming& other); + RtcEventRtpPacketIncoming(const RtcEventRtpPacketIncoming&) = default; const RtpPacket packet_; }; diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_outgoing.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_outgoing.cc @@ -13,7 +13,6 @@ #include <memory> #include "absl/memory/memory.h" -#include "api/rtc_event_log/rtc_event.h" #include "modules/rtp_rtcp/source/rtp_packet_to_send.h" namespace webrtc { @@ -23,18 +22,11 @@ RtcEventRtpPacketOutgoing::RtcEventRtpPacketOutgoing( int probe_cluster_id) : packet_(packet), probe_cluster_id_(probe_cluster_id) {} -RtcEventRtpPacketOutgoing::RtcEventRtpPacketOutgoing( - const RtcEventRtpPacketOutgoing& other) - : RtcEvent(other.timestamp_us_), - packet_(other.packet_), - probe_cluster_id_(other.probe_cluster_id_) {} - RtcEventRtpPacketOutgoing::~RtcEventRtpPacketOutgoing() = default; std::unique_ptr<RtcEventRtpPacketOutgoing> RtcEventRtpPacketOutgoing::Copy() const { - return absl::WrapUnique<RtcEventRtpPacketOutgoing>( - new RtcEventRtpPacketOutgoing(*this)); + return absl::WrapUnique(new RtcEventRtpPacketOutgoing(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_outgoing.h b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_rtp_packet_outgoing.h @@ -85,7 +85,7 @@ class RtcEventRtpPacketOutgoing final : public RtcEvent { } private: - RtcEventRtpPacketOutgoing(const RtcEventRtpPacketOutgoing& other); + RtcEventRtpPacketOutgoing(const RtcEventRtpPacketOutgoing& other) = default; const RtpPacket packet_; // TODO(eladalon): Delete `probe_cluster_id_` along with legacy encoding. diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_video_receive_stream_config.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_video_receive_stream_config.cc @@ -28,15 +28,14 @@ RtcEventVideoReceiveStreamConfig::RtcEventVideoReceiveStreamConfig( RtcEventVideoReceiveStreamConfig::RtcEventVideoReceiveStreamConfig( const RtcEventVideoReceiveStreamConfig& other) - : RtcEvent(other.timestamp_us_), + : RtcEvent(other), config_(std::make_unique<rtclog::StreamConfig>(*other.config_)) {} RtcEventVideoReceiveStreamConfig::~RtcEventVideoReceiveStreamConfig() = default; std::unique_ptr<RtcEventVideoReceiveStreamConfig> RtcEventVideoReceiveStreamConfig::Copy() const { - return absl::WrapUnique<RtcEventVideoReceiveStreamConfig>( - new RtcEventVideoReceiveStreamConfig(*this)); + return absl::WrapUnique(new RtcEventVideoReceiveStreamConfig(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_video_send_stream_config.cc b/third_party/libwebrtc/logging/rtc_event_log/events/rtc_event_video_send_stream_config.cc @@ -25,15 +25,14 @@ RtcEventVideoSendStreamConfig::RtcEventVideoSendStreamConfig( RtcEventVideoSendStreamConfig::RtcEventVideoSendStreamConfig( const RtcEventVideoSendStreamConfig& other) - : RtcEvent(other.timestamp_us_), + : RtcEvent(other), config_(std::make_unique<rtclog::StreamConfig>(*other.config_)) {} RtcEventVideoSendStreamConfig::~RtcEventVideoSendStreamConfig() = default; std::unique_ptr<RtcEventVideoSendStreamConfig> RtcEventVideoSendStreamConfig::Copy() const { - return absl::WrapUnique<RtcEventVideoSendStreamConfig>( - new RtcEventVideoSendStreamConfig(*this)); + return absl::WrapUnique(new RtcEventVideoSendStreamConfig(*this)); } } // namespace webrtc diff --git a/third_party/libwebrtc/logging/rtc_event_log/rtc_event_log_unittest_helper.cc b/third_party/libwebrtc/logging/rtc_event_log/rtc_event_log_unittest_helper.cc @@ -636,9 +636,9 @@ EventGenerator::NewGenericAckReceived() { if (prng_.Rand(0, 2) > 0) { receive_timestamp = prng_.Rand(0, 100000); } - AckedPacket packet = {prng_.Rand(40, 250), receive_timestamp}; + AckedPacket packet[1] = {{prng_.Rand(40, 250), receive_timestamp}}; return std::move(RtcEventGenericAckReceived::CreateLogs( - received_packet_number_++, std::vector<AckedPacket>{packet})[0]); + received_packet_number_++, packet)[0]); } void EventGenerator::RandomizeRtpPacket(