Add GetSctpStats to PeerConnectionInternal, remove sctp_data_channels() This removes code from DataChannelController that exposes an internal vector of data channels and puts the onus of returning stats for a data channel, on the data channel object itself. This will come in handy as we make threading changes to the data channel object. Change-Id: Ie164cc5823cd5f9782fc5c9a63aa4c76b8229639 Bug: webrtc:11547, webrtc:11687 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177244 Commit-Queue: Tommi <tommi@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31533}
diff --git a/pc/data_channel_controller.h b/pc/data_channel_controller.h index 156bbe5..c3e64ab 100644 --- a/pc/data_channel_controller.h +++ b/pc/data_channel_controller.h
@@ -64,6 +64,9 @@ void OnTransportChanged( DataChannelTransportInterface* data_channel_transport); + // Called from PeerConnection::GetDataChannelStats on the signaling thread. + std::vector<DataChannel::Stats> GetDataChannelStats() const; + // Creates channel and adds it to the collection of DataChannels that will // be offered in a SessionDescription. rtc::scoped_refptr<DataChannel> InternalCreateDataChannel( @@ -101,8 +104,6 @@ void set_data_channel_transport(DataChannelTransportInterface* transport); const std::map<std::string, rtc::scoped_refptr<DataChannel>>* rtp_data_channels() const; - const std::vector<rtc::scoped_refptr<DataChannel>>* sctp_data_channels() - const; sigslot::signal1<DataChannel*>& SignalDataChannelCreated() { RTC_DCHECK_RUN_ON(signaling_thread()); @@ -137,6 +138,10 @@ const rtc::CopyOnWriteBuffer& payload, cricket::SendDataResult* result); + // Called when all data channels need to be notified of a transport channel + // (calls OnTransportChannelCreated on the signaling thread). + void NotifyDataChannelsOfTransportCreated(); + rtc::Thread* network_thread() const; rtc::Thread* signaling_thread() const;