diff --git a/pc/data_channel_controller.cc b/pc/data_channel_controller.cc index 832eb03f79..a9fa3dabb9 100644 --- a/pc/data_channel_controller.cc +++ b/pc/data_channel_controller.cc @@ -359,16 +359,6 @@ void DataChannelController::OnTransportChannelClosed(RTCError error) { } } -SctpDataChannel* DataChannelController::FindDataChannelBySid(int sid) const { - RTC_DCHECK_RUN_ON(signaling_thread()); - for (const auto& channel : sctp_data_channels_) { - if (channel->id() == sid) { - return channel; - } - } - return nullptr; -} - DataChannelTransportInterface* DataChannelController::data_channel_transport() const { // TODO(bugs.webrtc.org/11547): Only allow this accessor to be called on the diff --git a/pc/data_channel_controller.h b/pc/data_channel_controller.h index a3efe41ad0..56a9435f9e 100644 --- a/pc/data_channel_controller.h +++ b/pc/data_channel_controller.h @@ -87,8 +87,6 @@ class DataChannelController : public SctpDataChannelProviderInterface, config) /* RTC_RUN_ON(signaling_thread()) */; void AllocateSctpSids(rtc::SSLRole role); - SctpDataChannel* FindDataChannelBySid(int sid) const; - // Checks if any data channel has been added. bool HasDataChannels() const; bool HasSctpDataChannels() const { diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 1a17fd4368..0705c84a97 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -2027,10 +2027,6 @@ void PeerConnection::OnSctpDataChannelClosed(DataChannelInterface* channel) { static_cast(channel)); } -SctpDataChannel* PeerConnection::FindDataChannelBySid(int sid) const { - return data_channel_controller_.FindDataChannelBySid(sid); -} - PeerConnection::InitializePortAllocatorResult PeerConnection::InitializePortAllocator_n( const cricket::ServerAddresses& stun_servers, diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 6ada0c0683..919d377b2b 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -494,11 +494,6 @@ class PeerConnection : public PeerConnectionInternal, void OnNegotiationNeeded(); - // Returns the specified SCTP DataChannel in sctp_data_channels_, - // or nullptr if not found. - SctpDataChannel* FindDataChannelBySid(int sid) const - RTC_RUN_ON(signaling_thread()); - // Called when first configuring the port allocator. struct InitializePortAllocatorResult { bool enable_ipv6;