commit 09052ce908dd71fca63c8ce6f910e7e3f37f4882 parent 628820d6a2ffb4a5224c2d33649dc5472c95a871 Author: Dan Baker <dbaker@mozilla.com> Date: Wed, 22 Oct 2025 14:47:54 -0600 Bug 1995393 - Vendor libwebrtc from 3bd6510e6f Upstream commit: https://webrtc.googlesource.com/src/+/3bd6510e6f1a508b4042e4be266f126afaa18e8c clang-tidy: apply readability-container-size-empty rule which prefers .empty() over .size() == 0 Bug: webrtc:424706384 Change-Id: I7fb63a60ae8cd2e572d35ff3247940087c1c202f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/403505 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Philipp Hancke <phancke@meta.com> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45306} Diffstat:
68 files changed, 89 insertions(+), 88 deletions(-)
diff --git a/third_party/libwebrtc/.clang-tidy b/third_party/libwebrtc/.clang-tidy @@ -3,6 +3,7 @@ Checks: '-*, llvm-namespace-comment, modernize-use-override, + readability-container-size-empty, readability-static-definition-in-anonymous-namespace, readability-redundant-smartptr-get, readability-redundant-declaration' 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-22T20:44:54.919368+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-22T20:47:38.382296+00:00. # base of lastest vendoring -4cc505058c +3bd6510e6f diff --git a/third_party/libwebrtc/examples/peerconnection/client/linux/main_wnd.cc b/third_party/libwebrtc/examples/peerconnection/client/linux/main_wnd.cc @@ -374,7 +374,7 @@ void GtkMainWnd::OnClicked(GtkWidget* widget) { gtk_widget_set_sensitive(widget, false); server_ = gtk_entry_get_text(GTK_ENTRY(server_edit_)); port_ = gtk_entry_get_text(GTK_ENTRY(port_edit_)); - int port = port_.length() ? atoi(port_.c_str()) : 0; + int port = !port_.empty() ? atoi(port_.c_str()) : 0; callback_->StartLogin(server_, port); } diff --git a/third_party/libwebrtc/media/base/media_engine.cc b/third_party/libwebrtc/media/base/media_engine.cc @@ -65,7 +65,7 @@ RtpParameters CreateRtpParametersWithEncodings(StreamParams sp) { } const std::vector<RidDescription>& rids = sp.rids(); - RTC_DCHECK(rids.size() == 0 || rids.size() == encoding_count); + RTC_DCHECK(rids.empty() || rids.size() == encoding_count); for (size_t i = 0; i < rids.size(); ++i) { encodings[i].rid = rids[i].rid; } diff --git a/third_party/libwebrtc/media/base/rtp_utils.cc b/third_party/libwebrtc/media/base/rtp_utils.cc @@ -353,7 +353,7 @@ bool UpdateRtpAbsSendTimeExtension(ArrayView<uint8_t> packet, bool ApplyPacketOptions(ArrayView<uint8_t> data, const PacketTimeUpdateParams& packet_time_params, uint64_t time_us) { - RTC_DCHECK(data.size() > 0); + RTC_DCHECK(!data.empty()); // if there is no valid `rtp_sendtime_extension_id` and `srtp_auth_key` in // PacketOptions, nothing to be updated in this packet. diff --git a/third_party/libwebrtc/media/base/stream_params.cc b/third_party/libwebrtc/media/base/stream_params.cc @@ -92,7 +92,7 @@ SsrcGroup& SsrcGroup::operator=(const SsrcGroup&) = default; SsrcGroup& SsrcGroup::operator=(SsrcGroup&&) = default; bool SsrcGroup::has_semantics(const std::string& semantics_in) const { - return (semantics == semantics_in && ssrcs.size() > 0); + return (semantics == semantics_in && !ssrcs.empty()); } std::string SsrcGroup::ToString() const { diff --git a/third_party/libwebrtc/media/engine/webrtc_video_engine.cc b/third_party/libwebrtc/media/engine/webrtc_video_engine.cc @@ -2171,7 +2171,7 @@ RTCError WebRtcVideoSendChannel::WebRtcVideoSendStream::SetRtpParameters( } if (!key_frames_requested_by_rid.empty()) { if (key_frames_requested_by_rid.size() == 1 && - key_frames_requested_by_rid[0] == "") { + key_frames_requested_by_rid[0].empty()) { // For non-simulcast cases there is no rid, // request a keyframe on all layers. key_frames_requested_by_rid.clear(); @@ -2581,7 +2581,7 @@ WebRtcVideoSendChannel::WebRtcVideoSendStream::GetAggregatedVideoSenderInfo( info.firs_received += infos[i].firs_received; info.nacks_received += infos[i].nacks_received; info.plis_received += infos[i].plis_received; - if (infos[i].report_block_datas.size()) + if (!infos[i].report_block_datas.empty()) info.report_block_datas.push_back(infos[i].report_block_datas[0]); if (infos[i].qp_sum) { if (!info.qp_sum) { diff --git a/third_party/libwebrtc/media/engine/webrtc_voice_engine.cc b/third_party/libwebrtc/media/engine/webrtc_voice_engine.cc @@ -1791,7 +1791,7 @@ bool WebRtcVoiceSendChannel::GetStats(VoiceMediaSendInfo* info) { // With separate send and receive channels, we expect GetStats to be called on // both, and accumulate info, but only one channel (the send one) should have // senders. - RTC_DCHECK(info->senders.size() == 0U || send_streams_.size() == 0); + RTC_DCHECK(info->senders.empty() || send_streams_.empty()); for (const auto& stream : send_streams_) { AudioSendStream::Stats stats = stream.second->GetStats(false); VoiceSenderInfo sinfo; diff --git a/third_party/libwebrtc/modules/audio_coding/acm2/audio_coding_module.cc b/third_party/libwebrtc/modules/audio_coding/acm2/audio_coding_module.cc @@ -268,7 +268,7 @@ int32_t AudioCodingModuleImpl::Encode( &encode_buffer_); bitrate_logger_.MaybeLog(encoder_stack_->GetTargetBitrate() / 1000); - if (encode_buffer_.size() == 0 && !encoded_info.send_even_if_empty) { + if (encode_buffer_.empty() && !encoded_info.send_even_if_empty) { // Not enough data. return 0; } @@ -289,7 +289,7 @@ int32_t AudioCodingModuleImpl::Encode( } AudioFrameType frame_type; - if (encode_buffer_.size() == 0 && encoded_info.send_even_if_empty) { + if (encode_buffer_.empty() && encoded_info.send_even_if_empty) { frame_type = AudioFrameType::kEmptyFrame; encoded_info.payload_type = previous_pltype; } else { diff --git a/third_party/libwebrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc b/third_party/libwebrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc @@ -315,7 +315,7 @@ std::unique_ptr<ControllerManager> ControllerManagerImpl::Create( controllers.push_back(std::move(controller)); } - if (scoring_points.size() == 0) { + if (scoring_points.empty()) { return std::unique_ptr<ControllerManagerImpl>( new ControllerManagerImpl(ControllerManagerImpl::Config(0, 0), std::move(controllers), scoring_points)); @@ -363,7 +363,7 @@ ControllerManagerImpl::~ControllerManagerImpl() = default; std::vector<Controller*> ControllerManagerImpl::GetSortedControllers( const Controller::NetworkMetrics& metrics) { - if (controller_scoring_points_.size() == 0) + if (controller_scoring_points_.empty()) return default_sorted_controllers_; if (!metrics.uplink_bandwidth_bps || !metrics.uplink_packet_loss_fraction) diff --git a/third_party/libwebrtc/modules/audio_coding/codecs/opus/audio_decoder_opus_unittest.cc b/third_party/libwebrtc/modules/audio_coding/codecs/opus/audio_decoder_opus_unittest.cc @@ -139,7 +139,7 @@ void EncodeDecodeSpeech(AudioEncoderOpusImpl& encoder, encoder.Encode(rtp_timestamp++, audio_frame.data_view().data(), &payload); // Ignore empty payloads: the encoder needs more audio to produce a packet. - if (payload.size() == 0) { + if (payload.empty()) { continue; } @@ -171,7 +171,7 @@ void EncodeDecodeNoiseUntilDecoderInDtxMode(AudioEncoderOpusImpl& encoder, encoder.Encode(rtp_timestamp++, input_frame, &payload); // Ignore empty payloads: the encoder needs more audio to produce a packet. - if (payload.size() == 0) { + if (payload.empty()) { continue; } @@ -222,7 +222,7 @@ std::vector<int16_t> EncodeDecodeSpeechUntilOneFrameIsDecoded( encoder.Encode(rtp_timestamp++, audio_frame.data_view().data(), &payload); // Ignore empty payloads: the encoder needs more audio to produce a packet. - if (payload.size() == 0) { + if (payload.empty()) { continue; } @@ -265,7 +265,7 @@ TEST(AudioDecoderOpusTest, MonoEncoderStereoDecoderOutputsTrivialStereo) { generator.GenerateNextFrame(input_frame); Buffer payload; encoder.Encode(rtp_timestamp++, input_frame, &payload); - if (payload.size() == 0) { + if (payload.empty()) { continue; } diff --git a/third_party/libwebrtc/modules/audio_coding/codecs/opus/opus_bandwidth_unittest.cc b/third_party/libwebrtc/modules/audio_coding/codecs/opus/opus_bandwidth_unittest.cc @@ -102,7 +102,7 @@ float EncodedPowerRatio(AudioEncoder* encoder, AudioEncoder::EncodedInfo encoder_info = encoder->Encode(rtp_timestamp, audio_loop->GetNextBlock(), &encoded); rtp_timestamp += kInputBlockSizeSamples; - if (encoded.size() > 0) { + if (!encoded.empty()) { int decoder_info = decoder->Decode( encoded.data(), encoded.size(), kSampleRateHz, decoded.size() * sizeof(decoded[0]), decoded.data(), &speech_type); diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/packet_buffer.cc b/third_party/libwebrtc/modules/audio_coding/neteq/packet_buffer.cc @@ -232,7 +232,7 @@ size_t PacketBuffer::NumSamplesInBuffer(size_t last_decoded_length) const { size_t PacketBuffer::GetSpanSamples(size_t last_decoded_length, size_t sample_rate, bool count_waiting_time) const { - if (buffer_.size() == 0) { + if (buffer_.empty()) { return 0; } diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/statistics_calculator.cc b/third_party/libwebrtc/modules/audio_coding/neteq/statistics_calculator.cc @@ -390,7 +390,7 @@ void StatisticsCalculator::GetNetworkStatistics(size_t samples_per_packet, static_cast<uint32_t>(discarded_secondary_samples + secondary_decoded_samples_)); - if (waiting_times_.size() == 0) { + if (waiting_times_.empty()) { stats->mean_waiting_time_ms = -1; stats->median_waiting_time_ms = -1; stats->min_waiting_time_ms = -1; diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/tools/encode_neteq_input.cc b/third_party/libwebrtc/modules/audio_coding/neteq/tools/encode_neteq_input.cc @@ -78,7 +78,7 @@ void EncodeNetEqInput::CreatePacket() { AudioEncoder::EncodedInfo info; RTC_DCHECK(!info.send_even_if_empty); int num_blocks = 0; - while (packet_data_->payload.size() == 0 && !info.send_even_if_empty) { + while (packet_data_->payload.empty() && !info.send_even_if_empty) { const size_t num_samples = CheckedDivExact( static_cast<int>(encoder_->SampleRateHz() * kOutputPeriodMs), 1000); diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/third_party/libwebrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc @@ -397,7 +397,7 @@ int main(int argc, char* argv[]) { output_files_base_name, output_audio_filename, ""); // Check if an SSRC value was provided. - if (absl::GetFlag(FLAGS_ssrc).size() > 0) { + if (!absl::GetFlag(FLAGS_ssrc).empty()) { uint32_t ssrc; RTC_CHECK(ParseSsrc(absl::GetFlag(FLAGS_ssrc), &ssrc)) << "Flag verification has failed."; diff --git a/third_party/libwebrtc/modules/audio_coding/neteq/tools/neteq_test_factory.cc b/third_party/libwebrtc/modules/audio_coding/neteq/tools/neteq_test_factory.cc @@ -271,7 +271,7 @@ std::unique_ptr<NetEqTest> NetEqTestFactory::InitializeTest( CreateBuiltinAudioDecoderFactory(); // Check if a replacement audio file was provided. - if (config.replacement_audio_file.size() > 0) { + if (!config.replacement_audio_file.empty()) { // Find largest unused payload type. int replacement_pt = 127; while (codecs.find(replacement_pt) != codecs.end()) { diff --git a/third_party/libwebrtc/modules/audio_device/include/test_audio_device.cc b/third_party/libwebrtc/modules/audio_device/include/test_audio_device.cc @@ -133,7 +133,7 @@ class WavFileReader final : public TestAudioDeviceModule::Capturer { } return read; }); - return buffer->size() > 0; + return !buffer->empty(); } private: @@ -318,7 +318,7 @@ class RawFileReader final : public TestAudioDeviceModule::Capturer { memcpy(data.data(), read_buffer_view.data(), size); return read / 2; }); - return buffer->size() > 0; + return !buffer->empty(); } private: diff --git a/third_party/libwebrtc/modules/audio_device/test_audio_device_impl.cc b/third_party/libwebrtc/modules/audio_device/test_audio_device_impl.cc @@ -171,7 +171,7 @@ void TestAudioDevice::ProcessAudio() { if (capturing_ && capturer_ != nullptr) { // Capture 10ms of audio. 2 bytes per sample. const bool keep_capturing = capturer_->Capture(&recording_buffer_); - if (recording_buffer_.size() > 0) { + if (!recording_buffer_.empty()) { audio_buffer_->SetRecordedBuffer( recording_buffer_.data(), recording_buffer_.size() / capturer_->NumChannels(), diff --git a/third_party/libwebrtc/modules/audio_processing/utility/cascaded_biquad_filter.cc b/third_party/libwebrtc/modules/audio_processing/utility/cascaded_biquad_filter.cc @@ -33,7 +33,7 @@ CascadedBiQuadFilter::~CascadedBiQuadFilter() = default; void CascadedBiQuadFilter::Process(ArrayView<const float> x, ArrayView<float> y) { - if (biquads_.size() > 0) { + if (!biquads_.empty()) { ApplyBiQuad(x, y, &biquads_[0]); for (size_t k = 1; k < biquads_.size(); ++k) { ApplyBiQuad(y, y, &biquads_[k]); diff --git a/third_party/libwebrtc/modules/congestion_controller/pcc/pcc_network_controller.cc b/third_party/libwebrtc/modules/congestion_controller/pcc/pcc_network_controller.cc @@ -161,7 +161,7 @@ NetworkControlUpdate PccNetworkController::OnSentPacket(SentPacket msg) { received_size += last_received_packets_[i].sent_packet.size; } TimeDelta sending_time = TimeDelta::Zero(); - if (last_received_packets_.size() > 0) + if (!last_received_packets_.empty()) sending_time = last_received_packets_.back().receive_time - last_received_packets_.front().receive_time; DataRate receiving_rate = bandwidth_estimate_; @@ -179,7 +179,7 @@ NetworkControlUpdate PccNetworkController::OnSentPacket(SentPacket msg) { received_size += last_received_packets_[i].sent_packet.size; } TimeDelta sending_time = TimeDelta::Zero(); - if (last_received_packets_.size() > 0) + if (!last_received_packets_.empty()) sending_time = last_received_packets_.back().receive_time - last_received_packets_.front().receive_time; DataRate receiving_rate = bandwidth_estimate_; diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc @@ -189,7 +189,7 @@ void BaseCapturerPipeWire::CaptureFrame() { } bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { - RTC_DCHECK(sources->size() == 0); + RTC_DCHECK(sources->empty()); // List of available screens is already presented by the xdg-desktop-portal, // so we just need a (valid) source id for any callers to pass around, even // though it doesn't mean anything to us. Until the user selects a source in diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc @@ -555,7 +555,7 @@ bool EglDmaBuf::ImageFromDmaBuf(const DesktopSize& size, return false; } - if (plane_datas.size() <= 0) { + if (plane_datas.empty()) { RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; return false; } @@ -570,7 +570,7 @@ bool EglDmaBuf::ImageFromDmaBuf(const DesktopSize& size, attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; attribs[atti++] = SpaPixelFormatToDrmFormat(format); - if (plane_datas.size() > 0) { + if (!plane_datas.empty()) { attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; attribs[atti++] = plane_datas[0].fd; attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc @@ -91,7 +91,7 @@ spa_pod* BuildFormat(spa_pod_builder* builder, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), 0); spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), 0); - if (modifiers.size()) { + if (!modifiers.empty()) { if (modifiers.size() == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID) { spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_modifier, SPA_POD_PROP_FLAG_MANDATORY); diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc b/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc @@ -292,7 +292,7 @@ void ScreenCapturerX11::CaptureFrame() { } bool ScreenCapturerX11::GetSourceList(SourceList* sources) { - RTC_DCHECK(sources->size() == 0); + RTC_DCHECK(sources->empty()); if (!use_randr_) { sources->push_back({}); return true; diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/ulpfec_receiver.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/ulpfec_receiver.cc @@ -183,7 +183,7 @@ bool UlpfecReceiver::AddReceivedRedPacket(const RtpPacketReceived& rtp_packet) { rtp_packet.size() - rtp_packet.headers_size() - kRedHeaderLength); } - if (received_packet->pkt->data.size() > 0) { + if (!received_packet->pkt->data.empty()) { received_packets_.push_back(std::move(received_packet)); } return true; diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/video_rtp_depacketizer_av1.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/video_rtp_depacketizer_av1.cc @@ -368,7 +368,7 @@ scoped_refptr<EncodedImageBuffer> VideoRtpDepacketizerAv1::AssembleFrame( std::optional<VideoRtpDepacketizer::ParsedRtpPayload> VideoRtpDepacketizerAv1::Parse(CopyOnWriteBuffer rtp_payload) { - if (rtp_payload.size() == 0) { + if (rtp_payload.empty()) { RTC_DLOG(LS_ERROR) << "Empty rtp payload."; return std::nullopt; } diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/video_rtp_depacketizer_generic.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/video_rtp_depacketizer_generic.cc @@ -36,7 +36,7 @@ constexpr size_t kExtendedHeaderLength = 2; std::optional<VideoRtpDepacketizer::ParsedRtpPayload> VideoRtpDepacketizerGeneric::Parse(CopyOnWriteBuffer rtp_payload) { - if (rtp_payload.size() == 0) { + if (rtp_payload.empty()) { RTC_LOG(LS_WARNING) << "Empty payload."; return std::nullopt; } diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/video_rtp_depacketizer_h264.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/video_rtp_depacketizer_h264.cc @@ -293,7 +293,7 @@ std::optional<VideoRtpDepacketizer::ParsedRtpPayload> ParseFuaNalu( std::optional<VideoRtpDepacketizer::ParsedRtpPayload> VideoRtpDepacketizerH264::Parse(CopyOnWriteBuffer rtp_payload) { - if (rtp_payload.size() == 0) { + if (rtp_payload.empty()) { RTC_LOG(LS_ERROR) << "Empty payload."; return std::nullopt; } diff --git a/third_party/libwebrtc/moz-patch-stack/p0002.patch b/third_party/libwebrtc/moz-patch-stack/p0002.patch @@ -52,7 +52,7 @@ index 2d539e2e22..1e42998d4f 100644 networkBehavior.loss_percent = 50; diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc -index 604a9465c7..0bf0d8ea62 100644 +index 50be6b5c26..8c952cd3a2 100644 --- a/rtc_base/openssl_stream_adapter.cc +++ b/rtc_base/openssl_stream_adapter.cc @@ -852,10 +852,15 @@ void OpenSSLStreamAdapter::SetTimeout(int delay_ms) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0001.patch b/third_party/libwebrtc/moz-patch-stack/s0001.patch @@ -521,7 +521,7 @@ index 531130a876..fcaaee9eb7 100644 x_display_->AddEventHandler(xfixes_event_base_ + XFixesCursorNotify, this); diff --git a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc -index ce7312424b..d1898a2ea7 100644 +index 27b334f4f7..68ae5fea33 100644 --- a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc +++ b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc @@ -307,7 +307,7 @@ bool ScreenCapturerX11::GetSourceList(SourceList* sources) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0030.patch b/third_party/libwebrtc/moz-patch-stack/s0030.patch @@ -25,7 +25,7 @@ index ae9951e6f9..c69ec1a674 100644 // See LntfConfig for description. diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index f2715d3f5a..d69e876399 100644 +index 804fff8951..932a2cd7a7 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -1411,7 +1411,7 @@ void RtpVideoStreamReceiver2::StartReceive() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0035.patch b/third_party/libwebrtc/moz-patch-stack/s0035.patch @@ -267,7 +267,7 @@ index 40836198de..d2304e87db 100644 // DEPRECATED, transport_feedback_callback is no longer invoked by the RTP diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index d69e876399..abb834cca4 100644 +index 932a2cd7a7..a16b936cf6 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -129,7 +129,8 @@ std::unique_ptr<ModuleRtpRtcpImpl2> CreateRtpRtcpModule( diff --git a/third_party/libwebrtc/moz-patch-stack/s0037.patch b/third_party/libwebrtc/moz-patch-stack/s0037.patch @@ -15,7 +15,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/edac9d01a9ac7594f 3 files changed, 24 insertions(+) diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index abb834cca4..3d546ae5ea 100644 +index a16b936cf6..deb1c0d4f7 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -1177,6 +1177,16 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs() diff --git a/third_party/libwebrtc/moz-patch-stack/s0042.patch b/third_party/libwebrtc/moz-patch-stack/s0042.patch @@ -159,7 +159,7 @@ index d2304e87db..bbdb38864e 100644 // Within this list, the sender-source SSRC pair is unique and per-pair the // ReportBlockData represents the latest Report Block that was received for diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 3d546ae5ea..687ff8cf1c 100644 +index deb1c0d4f7..7f98bd0249 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -1182,9 +1182,10 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs() diff --git a/third_party/libwebrtc/moz-patch-stack/s0057.patch b/third_party/libwebrtc/moz-patch-stack/s0057.patch @@ -186,7 +186,7 @@ index f17b00efb1..e205032fa6 100644 void ForceSpsPpsIdrIsH264Keyframe(); diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc -index 1ce49cad5f..861f14d578 100644 +index 84b00b711e..c8058ea132 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc @@ -817,6 +817,11 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { @@ -214,7 +214,7 @@ index 111b7f3c45..fb411d4bbf 100644 int current_delay_ms, int target_delay_ms, diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 687ff8cf1c..f3e6ae91f9 100644 +index 7f98bd0249..172ffa94c9 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -286,6 +286,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( diff --git a/third_party/libwebrtc/moz-patch-stack/s0058.patch b/third_party/libwebrtc/moz-patch-stack/s0058.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56fbf0469e25fa0d5 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc -index 861f14d578..252cd3ecc2 100644 +index c8058ea132..568fd441d2 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc @@ -818,8 +818,13 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { @@ -30,7 +30,7 @@ index 861f14d578..252cd3ecc2 100644 void ReceiveStatisticsProxy::OnPreDecode(VideoCodecType codec_type, int qp) { diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index f3e6ae91f9..d27a24c3bd 100644 +index 172ffa94c9..be0e8914a3 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -1405,7 +1405,9 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0059.patch b/third_party/libwebrtc/moz-patch-stack/s0059.patch @@ -116,7 +116,7 @@ index 251b464f37..90fbb7780f 100644 num_discarded_packets_ += num_discarded_packets; } diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc -index 252cd3ecc2..cf5bab267e 100644 +index 568fd441d2..30eec9f090 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc @@ -39,6 +39,7 @@ @@ -166,7 +166,7 @@ index 252cd3ecc2..cf5bab267e 100644 } diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index d27a24c3bd..859dfb3d44 100644 +index be0e8914a3..52bb158a36 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -91,6 +91,7 @@ diff --git a/third_party/libwebrtc/moz-patch-stack/s0060.patch b/third_party/libwebrtc/moz-patch-stack/s0060.patch @@ -9,7 +9,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5b2a7894ef1cf096d 1 file changed, 6 insertions(+) diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 859dfb3d44..942f77db26 100644 +index 52bb158a36..ca9dc3fcf7 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -830,6 +830,12 @@ void RtpVideoStreamReceiver2::OnRtpPacket(const RtpPacketReceived& packet) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0063.patch b/third_party/libwebrtc/moz-patch-stack/s0063.patch @@ -18,7 +18,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c8606497de1f461a6 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -index 3a80f4ecc1..f7e1b0a00d 100644 +index cf5b4da824..50de04a0d4 100644 --- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc @@ -19,6 +19,7 @@ diff --git a/third_party/libwebrtc/moz-patch-stack/s0071.patch b/third_party/libwebrtc/moz-patch-stack/s0071.patch @@ -50,7 +50,7 @@ index 1e6678b4ee..1ed48c08d7 100644 Clock* const clock_; bool short_circuit_ RTC_GUARDED_BY(network_sequence_checker_) = false; diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc -index 942f77db26..09dfa8b2ac 100644 +index ca9dc3fcf7..273e0b01f5 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -383,7 +383,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( diff --git a/third_party/libwebrtc/p2p/base/async_stun_tcp_socket_unittest.cc b/third_party/libwebrtc/p2p/base/async_stun_tcp_socket_unittest.cc @@ -131,7 +131,7 @@ class AsyncStunTCPSocketTest : public ::testing::Test, bool CheckData(const void* data, int len) { bool ret = false; - if (recv_packets_.size()) { + if (!recv_packets_.empty()) { std::string packet = recv_packets_.front(); recv_packets_.pop_front(); ret = (memcmp(data, packet.c_str(), len) == 0); diff --git a/third_party/libwebrtc/p2p/base/connection.cc b/third_party/libwebrtc/p2p/base/connection.cc @@ -87,7 +87,7 @@ inline bool TooLongWithoutResponse( const std::vector<Connection::SentPing>& pings_since_last_response, int64_t maximum_time, int64_t now) { - if (pings_since_last_response.size() == 0) + if (pings_since_last_response.empty()) return false; auto first = pings_since_last_response[0]; diff --git a/third_party/libwebrtc/p2p/base/p2p_transport_channel_unittest.cc b/third_party/libwebrtc/p2p/base/p2p_transport_channel_unittest.cc @@ -6797,7 +6797,7 @@ TEST_F(P2PTransportChannelTest, EnableDnsLookupsWithTransportPolicyNoHost) { DestroyChannels(); } -static struct LocalAreaNetworkPermissionTestConfig { +struct LocalAreaNetworkPermissionTestConfig { template <typename Sink> friend void AbslStringify( Sink& sink, diff --git a/third_party/libwebrtc/p2p/base/stun_port.cc b/third_party/libwebrtc/p2p/base/stun_port.cc @@ -610,7 +610,7 @@ void UDPPort::MaybeSetPortCompleteOrError() { // The port is "completed" if there is no stun server provided, or the bind // request succeeded for any stun server, or the socket is shared. - if (server_addresses_.empty() || bind_request_succeeded_servers_.size() > 0 || + if (server_addresses_.empty() || !bind_request_succeeded_servers_.empty() || SharedSocket()) { SignalPortComplete(this); } else { diff --git a/third_party/libwebrtc/p2p/dtls/dtls_stun_piggyback_controller.cc b/third_party/libwebrtc/p2p/dtls/dtls_stun_piggyback_controller.cc @@ -200,7 +200,7 @@ void DtlsStunPiggybackController::ReportDataPiggybacked( return; } - if (!data.has_value() || data->size() == 0) { + if (!data.has_value() || data->empty()) { return; } diff --git a/third_party/libwebrtc/p2p/dtls/dtls_transport.cc b/third_party/libwebrtc/p2p/dtls/dtls_transport.cc @@ -380,7 +380,7 @@ bool DtlsTransportInternalImpl::SetRemoteFingerprint( } // At this point we know we are doing DTLS - bool fingerprint_changing = remote_fingerprint_value_.size() > 0u; + bool fingerprint_changing = !remote_fingerprint_value_.empty(); remote_fingerprint_value_ = std::move(remote_fingerprint_value); remote_fingerprint_algorithm_ = std::string(digest_alg); @@ -471,7 +471,7 @@ bool DtlsTransportInternalImpl::SetupDtls() { dtls_->SetServerRole(*dtls_role_); dtls_->SetEventCallback( [this](int events, int err) { OnDtlsEvent(events, err); }); - if (remote_fingerprint_value_.size() && + if (!remote_fingerprint_value_.empty() && dtls_->SetPeerCertificateDigest(remote_fingerprint_algorithm_, remote_fingerprint_value_) != SSLPeerCertificateDigestError::NONE) { diff --git a/third_party/libwebrtc/pc/legacy_stats_collector.cc b/third_party/libwebrtc/pc/legacy_stats_collector.cc @@ -1013,7 +1013,7 @@ void LegacyStatsCollector::ExtractSessionInfo_s(SessionStats& session_stats) { } int srtp_crypto_suite = channel_iter.srtp_crypto_suite; if (srtp_crypto_suite != kSrtpInvalidCryptoSuite && - SrtpCryptoSuiteToName(srtp_crypto_suite).length()) { + !SrtpCryptoSuiteToName(srtp_crypto_suite).empty()) { channel_report->AddString(StatsReport::kStatsValueNameSrtpCipher, SrtpCryptoSuiteToName(srtp_crypto_suite)); } diff --git a/third_party/libwebrtc/pc/legacy_stats_collector_unittest.cc b/third_party/libwebrtc/pc/legacy_stats_collector_unittest.cc @@ -691,7 +691,7 @@ class LegacyStatsCollectorTest : public ::testing::Test { std::string local_certificate_id = ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, StatsReport::kStatsValueNameLocalCertificateId); - if (local_ders.size() > 0) { + if (!local_ders.empty()) { EXPECT_NE(kNotFound, local_certificate_id); StatsReport::Id id(IdFromCertIdString(local_certificate_id)); CheckCertChainReports(reports, local_ders, id); @@ -703,7 +703,7 @@ class LegacyStatsCollectorTest : public ::testing::Test { std::string remote_certificate_id = ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, StatsReport::kStatsValueNameRemoteCertificateId); - if (remote_ders.size() > 0) { + if (!remote_ders.empty()) { EXPECT_NE(kNotFound, remote_certificate_id); StatsReport::Id id(IdFromCertIdString(remote_certificate_id)); CheckCertChainReports(reports, remote_ders, id); diff --git a/third_party/libwebrtc/pc/peer_connection.cc b/third_party/libwebrtc/pc/peer_connection.cc @@ -1364,7 +1364,7 @@ std::optional<bool> PeerConnection::can_trickle_ice_candidates() { return std::nullopt; } // TODO(bugs.webrtc.org/7443): Change to retrieve from session-level option. - if (description->description()->transport_infos().size() < 1) { + if (description->description()->transport_infos().empty()) { return std::nullopt; } return description->description()->transport_infos()[0].description.HasOption( diff --git a/third_party/libwebrtc/pc/rtc_stats_collector.cc b/third_party/libwebrtc/pc/rtc_stats_collector.cc @@ -2013,7 +2013,7 @@ void RTCStatsCollector::ProduceTransportStats_n( channel_transport_stats->dtls_cipher = channel_stats.tls_cipher_suite_name; if (channel_stats.srtp_crypto_suite != kSrtpInvalidCryptoSuite && - SrtpCryptoSuiteToName(channel_stats.srtp_crypto_suite).length()) { + !SrtpCryptoSuiteToName(channel_stats.srtp_crypto_suite).empty()) { channel_transport_stats->srtp_cipher = SrtpCryptoSuiteToName(channel_stats.srtp_crypto_suite); } diff --git a/third_party/libwebrtc/pc/sctp_utils.cc b/third_party/libwebrtc/pc/sctp_utils.cc @@ -49,7 +49,7 @@ enum DataChannelPriority { bool IsOpenMessage(const CopyOnWriteBuffer& payload) { // Format defined at // https://www.rfc-editor.org/rfc/rfc8832#section-5.1 - if (payload.size() < 1) { + if (payload.empty()) { RTC_DLOG(LS_WARNING) << "Could not read OPEN message type."; return false; } @@ -138,7 +138,7 @@ bool ParseDataChannelOpenMessage(const CopyOnWriteBuffer& payload, } bool ParseDataChannelOpenAckMessage(const CopyOnWriteBuffer& payload) { - if (payload.size() < 1) { + if (payload.empty()) { RTC_LOG(LS_WARNING) << "Could not read OPEN_ACK message type."; return false; } diff --git a/third_party/libwebrtc/pc/sdp_offer_answer.cc b/third_party/libwebrtc/pc/sdp_offer_answer.cc @@ -3691,7 +3691,7 @@ bool SdpOfferAnswerHandler::CheckIfNegotiationIsNeeded() { // m= section, or the MSID values themselves, differ from what is in // transceiver.sender.[[AssociatedMediaStreamIds]], return true. if (RtpTransceiverDirectionHasSend(transceiver->direction())) { - if (current_local_media_description->streams().size() == 0) + if (current_local_media_description->streams().empty()) return true; std::vector<std::string> msection_msids; diff --git a/third_party/libwebrtc/pc/webrtc_sdp.cc b/third_party/libwebrtc/pc/webrtc_sdp.cc @@ -2247,7 +2247,7 @@ bool ParseSsrcAttribute(absl::string_view line, // msid:identifier [appdata] std::vector<absl::string_view> fields = split(value, kSdpDelimiterSpaceChar); - if (fields.size() < 1 || fields.size() > 2) { + if (fields.empty() || fields.size() > 2) { return ParseFailed( line, "Expected format \"msid:<identifier>[ <appdata>]\".", error); } diff --git a/third_party/libwebrtc/rtc_base/async_tcp_socket.cc b/third_party/libwebrtc/rtc_base/async_tcp_socket.cc @@ -139,7 +139,7 @@ int AsyncTCPSocketBase::FlushOutBuffer() { RTC_DCHECK_GT(outbuf_.size(), 0); ArrayView<uint8_t> view = outbuf_; int res; - while (view.size() > 0) { + while (!view.empty()) { res = socket_->Send(view.data(), view.size()); if (res <= 0) { break; @@ -231,11 +231,11 @@ void AsyncTCPSocketBase::OnReadEvent(Socket* socket) { void AsyncTCPSocketBase::OnWriteEvent(Socket* socket) { RTC_DCHECK(socket_.get() == socket); - if (outbuf_.size() > 0) { + if (!outbuf_.empty()) { FlushOutBuffer(); } - if (outbuf_.size() == 0) { + if (outbuf_.empty()) { SignalReadyToSend(this); } } diff --git a/third_party/libwebrtc/rtc_base/byte_buffer.cc b/third_party/libwebrtc/rtc_base/byte_buffer.cc @@ -147,7 +147,7 @@ bool ByteBufferReader::ReadStringView(absl::string_view* val, size_t len) { } bool ByteBufferReader::ReadBytes(ArrayView<uint8_t> val) { - if (val.size() == 0) { + if (val.empty()) { return true; } return ReadBytes(val.data(), val.size()); diff --git a/third_party/libwebrtc/rtc_base/network.cc b/third_party/libwebrtc/rtc_base/network.cc @@ -533,7 +533,7 @@ Network* NetworkManagerBase::GetNetworkFromAddress(const IPAddress& ip) const { } bool NetworkManagerBase::IsVpnMacAddress(ArrayView<const uint8_t> address) { - if (address.data() == nullptr && address.size() == 0) { + if (address.data() == nullptr && address.empty()) { return false; } for (const auto& vpn : kVpns) { @@ -1142,7 +1142,7 @@ bool Network::SetIPs(const std::vector<InterfaceAddress>& ips, bool changed) { // Select the best IP address to use from this Network. IPAddress Network::GetBestIP() const { - if (ips_.size() == 0) { + if (ips_.empty()) { return IPAddress(); } diff --git a/third_party/libwebrtc/rtc_base/openssl_adapter.cc b/third_party/libwebrtc/rtc_base/openssl_adapter.cc @@ -1002,7 +1002,7 @@ std::string TransformAlpnProtocols( // each protocol. std::string transformed_alpn; for (const std::string& proto : alpn_protocols) { - if (proto.size() == 0 || proto.size() > 0xFF) { + if (proto.empty() || proto.size() > 0xFF) { RTC_LOG(LS_ERROR) << "OpenSSLAdapter::Error(" "TransformAlpnProtocols received proto with size " << proto.size() << ")"; diff --git a/third_party/libwebrtc/rtc_base/openssl_stream_adapter.cc b/third_party/libwebrtc/rtc_base/openssl_stream_adapter.cc @@ -608,7 +608,7 @@ StreamResult OpenSSLStreamAdapter::Write(ArrayView<const uint8_t> data, } // OpenSSL will return an error if we try to write zero bytes - if (data.size() == 0) { + if (data.empty()) { written = 0; return SR_SUCCESS; } @@ -665,7 +665,7 @@ StreamResult OpenSSLStreamAdapter::Read(ArrayView<uint8_t> data, } // Don't trust OpenSSL with zero byte reads - if (data.size() == 0) { + if (data.empty()) { read = 0; return SR_SUCCESS; } diff --git a/third_party/libwebrtc/rtc_base/virtual_socket_server.cc b/third_party/libwebrtc/rtc_base/virtual_socket_server.cc @@ -1217,7 +1217,7 @@ struct FunctionDomainCmp { std::unique_ptr<VirtualSocketServer::Function> VirtualSocketServer::Accumulate( std::unique_ptr<Function> f) { - RTC_DCHECK(f->size() >= 1); + RTC_DCHECK(!f->empty()); double v = 0; for (Function::size_type i = 0; i < f->size() - 1; ++i) { double dx = (*f)[i + 1].first - (*f)[i].first; @@ -1260,7 +1260,7 @@ double VirtualSocketServer::Evaluate(const Function* f, double x) { if (iter == f->begin()) { return (*f)[0].second; } else if (iter == f->end()) { - RTC_DCHECK(f->size() >= 1); + RTC_DCHECK(!f->empty()); return (*f)[f->size() - 1].second; } else if (iter->first == x) { return iter->second; diff --git a/third_party/libwebrtc/rtc_tools/frame_analyzer/video_quality_analysis.cc b/third_party/libwebrtc/rtc_tools/frame_analyzer/video_quality_analysis.cc @@ -125,7 +125,7 @@ int GetTotalNumberOfSkippedFrames(const std::vector<Cluster>& clusters) { void PrintAnalysisResults(const std::string& label, ResultsContainer& results, MetricsLogger& logger) { - if (results.frames.size() > 0u) { + if (!results.frames.empty()) { logger.LogSingleValueMetric("Unique_frames_count", label, results.frames.size(), Unit::kUnitless, ImprovementDirection::kNeitherIsBetter); diff --git a/third_party/libwebrtc/rtc_tools/network_tester/config_reader.cc b/third_party/libwebrtc/rtc_tools/network_tester/config_reader.cc @@ -28,7 +28,7 @@ ConfigReader::ConfigReader(const std::string& config_file_path) RTC_DCHECK(config_stream.good()); std::string config_data((std::istreambuf_iterator<char>(config_stream)), (std::istreambuf_iterator<char>())); - if (config_data.size() > 0) { + if (!config_data.empty()) { proto_all_configs_.ParseFromString(config_data); } } diff --git a/third_party/libwebrtc/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc b/third_party/libwebrtc/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc @@ -70,7 +70,7 @@ void VideoQualityMetricsReporter::OnStatsReports( std::vector<const RTCTransportStats*> transport_stats = report->GetStatsOfType<RTCTransportStats>(); - if (transport_stats.size() == 0u || + if (transport_stats.empty() || !transport_stats[0]->selected_candidate_pair_id.has_value()) { return; } diff --git a/third_party/libwebrtc/test/pc/e2e/echo/echo_emulation.cc b/third_party/libwebrtc/test/pc/e2e/echo/echo_emulation.cc @@ -115,7 +115,7 @@ EchoEmulatingRenderer::EchoEmulatingRenderer( } bool EchoEmulatingRenderer::Render(ArrayView<const int16_t> data) { - if (data.size() > 0) { + if (!data.empty()) { echo_emulating_capturer_->OnAudioRendered(data); } return delegate_->Render(data); diff --git a/third_party/libwebrtc/test/testsupport/file_utils.cc b/third_party/libwebrtc/test/testsupport/file_utils.cc @@ -149,7 +149,7 @@ std::string GenerateTempFilename(absl::string_view dir, } std::optional<std::vector<std::string>> ReadDirectory(absl::string_view path) { - if (path.length() == 0) + if (path.empty()) return std::optional<std::vector<std::string>>(); std::string path_str(path); diff --git a/third_party/libwebrtc/test/video_codec_tester.cc b/third_party/libwebrtc/test/video_codec_tester.cc @@ -949,7 +949,7 @@ class Decoder : public DecodedImageCallback { MutexLock lock(&mutex_); spatial_idx = *spatial_idx_; - if (ref_frames_.size() > 0) { + if (!ref_frames_.empty()) { auto it = ref_frames_.find(decoded_frame.rtp_timestamp()); RTC_CHECK(it != ref_frames_.end()); ref_frame = it->second; diff --git a/third_party/libwebrtc/video/receive_statistics_proxy.cc b/third_party/libwebrtc/video/receive_statistics_proxy.cc @@ -617,7 +617,7 @@ void ReceiveStatisticsProxy::OnDecodedFrame(const VideoFrame& frame, Timestamp current_time = clock_->CurrentTime(); // TODO(bugs.webrtc.org/13984): some tests do not fill packet_infos(). TimeDelta assembly_time = TimeDelta::Zero(); - if (frame.packet_infos().size() > 0) { + if (!frame.packet_infos().empty()) { const auto [first_packet, last_packet] = std::minmax_element( frame.packet_infos().cbegin(), frame.packet_infos().cend(), [](const webrtc::RtpPacketInfo& a, const webrtc::RtpPacketInfo& b) { diff --git a/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc b/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc @@ -745,7 +745,7 @@ bool RtpVideoStreamReceiver2::OnReceivedPayloadData( packet->times_nacked = times_nacked; - if (codec_payload.size() == 0) { + if (codec_payload.empty()) { NotifyReceiverOfEmptyPacket(packet->seq_num(), GetCodecFromPayloadType(packet->payload_type)); rtcp_feedback_buffer_.SendBufferedRtcpFeedback();