From 4f3541505064694c7fc44588fb9fec44c9af4c7c Mon Sep 17 00:00:00 2001 From: Michael Froman Date: Mon, 14 Aug 2023 15:00:55 -0500 Subject: [PATCH] Bug 1847074 - Vendor libwebrtc from 2abe6e2214 We already cherry-picked this when we vendored 151be743d4. Upstream commit: https://webrtc.googlesource.com/src/+/2abe6e2214fa4fcecdb9614715c55a82c0067e25 [M115] Bail out early if the RTP send module for a SSRC was not found since it might have been deregistered previously. BUG=chromium:1454860,chromium:1459124 (cherry picked from commit c0ed83eac258032a2416b7e4200bd074a6455f4b) Change-Id: I70ba43265361d040e568f83b6400ff8f3c2a8e98 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311800 Reviewed-by: Harald Alvestrand Commit-Queue: Philipp Hancke Cr-Original-Commit-Position: refs/heads/main@{#40431} Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/312121 Cr-Commit-Position: refs/branch-heads/5790@{#7} Cr-Branched-From: 2eacbbc03a4a41ea658661225eb1c8fc07884c33-refs/heads/main@{#40122} --- third_party/libwebrtc/README.moz-ff-commit | 3 +++ third_party/libwebrtc/README.mozilla | 2 ++ .../libwebrtc/modules/pacing/packet_router.cc | 5 ++++- .../modules/pacing/packet_router_unittest.cc | 16 +++++++++++----- .../2abe6e2214.no-op-cherry-pick-msg | 1 - 5 files changed, 20 insertions(+), 7 deletions(-) delete mode 100644 third_party/libwebrtc/moz-patch-stack/2abe6e2214.no-op-cherry-pick-msg diff --git a/third_party/libwebrtc/README.moz-ff-commit b/third_party/libwebrtc/README.moz-ff-commit index 2711b62af68ed..b0c14bf194a7b 100644 --- a/third_party/libwebrtc/README.moz-ff-commit +++ b/third_party/libwebrtc/README.moz-ff-commit @@ -24042,3 +24042,6 @@ f5ffd45855 # MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh # base of lastest vendoring 43670de877 +# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh +# base of lastest vendoring +2abe6e2214 diff --git a/third_party/libwebrtc/README.mozilla b/third_party/libwebrtc/README.mozilla index d09d74a75706e..48b280db1a471 100644 --- a/third_party/libwebrtc/README.mozilla +++ b/third_party/libwebrtc/README.mozilla @@ -16050,3 +16050,5 @@ libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-08-14T19:58:55.023984. # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-08-14T19:59:50.566324. +# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-08-14T20:00:42.527963. diff --git a/third_party/libwebrtc/modules/pacing/packet_router.cc b/third_party/libwebrtc/modules/pacing/packet_router.cc index 135b618bfac2b..ba133f3d1f313 100644 --- a/third_party/libwebrtc/modules/pacing/packet_router.cc +++ b/third_party/libwebrtc/modules/pacing/packet_router.cc @@ -88,7 +88,10 @@ void PacketRouter::AddSendRtpModuleToMap(RtpRtcpInterface* rtp_module, void PacketRouter::RemoveSendRtpModuleFromMap(uint32_t ssrc) { RTC_DCHECK_RUN_ON(&thread_checker_); auto it = send_modules_map_.find(ssrc); - RTC_DCHECK(it != send_modules_map_.end()); + if (it == send_modules_map_.end()) { + RTC_LOG(LS_ERROR) << "No send module found for ssrc " << ssrc; + return; + } send_modules_list_.remove(it->second); RTC_CHECK(modules_used_in_current_batch_.empty()); send_modules_map_.erase(it); diff --git a/third_party/libwebrtc/modules/pacing/packet_router_unittest.cc b/third_party/libwebrtc/modules/pacing/packet_router_unittest.cc index 7604de6fba4e2..af8534316c38b 100644 --- a/third_party/libwebrtc/modules/pacing/packet_router_unittest.cc +++ b/third_party/libwebrtc/modules/pacing/packet_router_unittest.cc @@ -541,18 +541,24 @@ TEST_F(PacketRouterDeathTest, DoubleRegistrationOfReceiveModuleDisallowed) { packet_router_.RemoveReceiveRtpModule(&module); } -TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedSendModuleDisallowed) { +TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedReceiveModuleDisallowed) { NiceMock module; - EXPECT_DEATH(packet_router_.RemoveSendRtpModule(&module), ""); + EXPECT_DEATH(packet_router_.RemoveReceiveRtpModule(&module), ""); } +#endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedReceiveModuleDisallowed) { +TEST_F(PacketRouterTest, RemovalOfNeverAddedSendModuleIgnored) { NiceMock module; + packet_router_.RemoveSendRtpModule(&module); +} - EXPECT_DEATH(packet_router_.RemoveReceiveRtpModule(&module), ""); +TEST_F(PacketRouterTest, DuplicateRemovalOfSendModuleIgnored) { + NiceMock module; + packet_router_.AddSendRtpModule(&module, false); + packet_router_.RemoveSendRtpModule(&module); + packet_router_.RemoveSendRtpModule(&module); } -#endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) TEST(PacketRouterRembTest, ChangeSendRtpModuleChangeRembSender) { rtc::ScopedFakeClock clock; diff --git a/third_party/libwebrtc/moz-patch-stack/2abe6e2214.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/2abe6e2214.no-op-cherry-pick-msg deleted file mode 100644 index cc7c33f4a21f9..0000000000000 --- a/third_party/libwebrtc/moz-patch-stack/2abe6e2214.no-op-cherry-pick-msg +++ /dev/null @@ -1 +0,0 @@ -We already cherry-picked this when we vendored 151be743d4.