Remove sigslot from PeerConnectionInternal and RTCStatsCollector.
It turns out that there were several sigslot instances across data
channel, pc and stats classes that in practice only served as means
to update two counters in RTCStatsCollector. There's already a
notification path that's suitable.
This also fixes a case where the PC instance sat in the middle
of notifications from datachannels to the datachannel controller.
Bug: webrtc:11943
Change-Id: Ic60b76021584019f82085f6651230fe2fe82d465
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295781
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39456}
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index 88b99bb..ca234f7 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -2113,11 +2113,12 @@
SetSctpTransportName("");
}
-void PeerConnection::OnSctpDataChannelClosed(DataChannelInterface* channel) {
- // Since data_channel_controller doesn't do signals, this
- // signal is relayed here.
- data_channel_controller_.OnSctpDataChannelClosed(
- static_cast<SctpDataChannel*>(channel));
+void PeerConnection::OnSctpDataChannelStateChanged(
+ DataChannelInterface* channel,
+ DataChannelInterface::DataState state) {
+ RTC_DCHECK_RUN_ON(signaling_thread());
+ if (stats_collector_)
+ stats_collector_->OnSctpDataChannelStateChanged(channel, state);
}
PeerConnection::InitializePortAllocatorResult