diff --git a/third_party/libwebrtc/README.moz-ff-commit b/third_party/libwebrtc/README.moz-ff-commit index 2f5fa8203c511..3412db7d229a9 100644 --- a/third_party/libwebrtc/README.moz-ff-commit +++ b/third_party/libwebrtc/README.moz-ff-commit @@ -17799,3 +17799,6 @@ c898c82884 # MOZ_LIBWEBRTC_SRC=/Users/danielbaker/moz-libwebrtc MOZ_LIBWEBRTC_COMMIT=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh # base of lastest vendoring 80ed9b8eb9 +# MOZ_LIBWEBRTC_SRC=/Users/danielbaker/moz-libwebrtc MOZ_LIBWEBRTC_COMMIT=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh +# base of lastest vendoring +18408391ad diff --git a/third_party/libwebrtc/README.mozilla b/third_party/libwebrtc/README.mozilla index b6cd57d594570..ff7ce5432c30a 100644 --- a/third_party/libwebrtc/README.mozilla +++ b/third_party/libwebrtc/README.mozilla @@ -11888,3 +11888,5 @@ libwebrtc updated from /Users/danielbaker/moz-libwebrtc commit mozpatches on 202 libwebrtc updated from /Users/danielbaker/moz-libwebrtc commit mozpatches on 2023-01-09T22:54:37.395531. # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/moz-libwebrtc --commit mozpatches libwebrtc libwebrtc updated from /Users/danielbaker/moz-libwebrtc commit mozpatches on 2023-01-09T22:59:53.109826. +# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/moz-libwebrtc --commit mozpatches libwebrtc +libwebrtc updated from /Users/danielbaker/moz-libwebrtc commit mozpatches on 2023-01-09T23:01:12.545588. diff --git a/third_party/libwebrtc/p2p/base/p2p_transport_channel.cc b/third_party/libwebrtc/p2p/base/p2p_transport_channel.cc index 213cfbde77a75..82d77bba4b1ca 100644 --- a/third_party/libwebrtc/p2p/base/p2p_transport_channel.cc +++ b/third_party/libwebrtc/p2p/base/p2p_transport_channel.cc @@ -223,7 +223,7 @@ P2PTransportChannel::~P2PTransportChannel() { std::vector copy(connections().begin(), connections().end()); for (Connection* connection : copy) { connection->SignalDestroyed.disconnect(this); - ice_controller_->OnConnectionDestroyed(connection); + RemoveConnection(connection); connection->Destroy(); } resolvers_.clear(); @@ -281,6 +281,7 @@ void P2PTransportChannel::AddConnection(Connection* connection) { LogCandidatePairConfig(connection, webrtc::IceCandidatePairConfigType::kAdded); + connections_.push_back(connection); ice_controller_->AddConnection(connection); } @@ -1693,7 +1694,7 @@ void P2PTransportChannel::RemoveConnectionForTest(Connection* connection) { RTC_DCHECK_RUN_ON(network_thread_); RTC_DCHECK(FindConnection(connection)); connection->SignalDestroyed.disconnect(this); - ice_controller_->OnConnectionDestroyed(connection); + RemoveConnection(connection); RTC_DCHECK(!FindConnection(connection)); if (selected_connection_ == connection) selected_connection_ = nullptr; @@ -2045,7 +2046,7 @@ void P2PTransportChannel::HandleAllTimedOut() { update_selected_connection = true; } connection->SignalDestroyed.disconnect(this); - ice_controller_->OnConnectionDestroyed(connection); + RemoveConnection(connection); connection->Destroy(); } @@ -2172,7 +2173,7 @@ void P2PTransportChannel::OnConnectionDestroyed(Connection* connection) { // use it. // Remove this connection from the list. - ice_controller_->OnConnectionDestroyed(connection); + RemoveConnection(connection); RTC_LOG(LS_INFO) << ToString() << ": Removed connection " << connection << " (" << connections().size() << " remaining)"; @@ -2193,6 +2194,14 @@ void P2PTransportChannel::OnConnectionDestroyed(Connection* connection) { } } +void P2PTransportChannel::RemoveConnection(const Connection* connection) { + RTC_DCHECK_RUN_ON(network_thread_); + auto it = absl::c_find(connections_, connection); + RTC_DCHECK(it != connections_.end()); + connections_.erase(it); + ice_controller_->OnConnectionDestroyed(connection); +} + // When a port is destroyed, remove it from our list of ports to use for // connection attempts. void P2PTransportChannel::OnPortDestroyed(PortInterface* port) { diff --git a/third_party/libwebrtc/p2p/base/p2p_transport_channel.h b/third_party/libwebrtc/p2p/base/p2p_transport_channel.h index 981bd9a064906..5e56df64ebf5a 100644 --- a/third_party/libwebrtc/p2p/base/p2p_transport_channel.h +++ b/third_party/libwebrtc/p2p/base/p2p_transport_channel.h @@ -200,6 +200,8 @@ class RTC_EXPORT P2PTransportChannel : public IceTransportInternal { int check_receiving_interval() const; absl::optional network_route() const override; + void RemoveConnection(const Connection* connection); + // Helper method used only in unittest. rtc::DiffServCodePoint DefaultDscpValue() const; @@ -427,6 +429,7 @@ class RTC_EXPORT P2PTransportChannel : public IceTransportInternal { std::vector pruned_ports_ RTC_GUARDED_BY(network_thread_); Connection* selected_connection_ RTC_GUARDED_BY(network_thread_) = nullptr; + std::vector connections_ RTC_GUARDED_BY(network_thread_); std::vector remote_candidates_ RTC_GUARDED_BY(network_thread_);