Cleanup deprecated monitoring of MediaTransport state.
PeerConnection now watches when data channels become ready to send through its implementation of DataChannelSink, and no longer needs to monitor the MediaTransport state. Bug: webrtc:9719 Change-Id: I3e17747eb03926a3791c204bf5a1d2dc67855c09 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154001 Commit-Queue: Seth Hampson <shampson@webrtc.org> Reviewed-by: Seth Hampson <shampson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29261}
This commit is contained in:
parent
5ac329c8aa
commit
d702231268
@ -1450,7 +1450,6 @@ void JsepTransportController::OnTransportStateChanged_n(
|
||||
}
|
||||
|
||||
void JsepTransportController::OnMediaTransportStateChanged_n() {
|
||||
SignalMediaTransportStateChanged();
|
||||
UpdateAggregateStates_n();
|
||||
}
|
||||
|
||||
|
||||
@ -287,10 +287,6 @@ class JsepTransportController : public sigslot::has_slots<> {
|
||||
|
||||
sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError;
|
||||
|
||||
// TODO(mellem): Delete this signal once PeerConnection no longer
|
||||
// uses it to determine data channel state.
|
||||
sigslot::signal<> SignalMediaTransportStateChanged;
|
||||
|
||||
private:
|
||||
RTCError ApplyDescription_n(bool local,
|
||||
SdpType type,
|
||||
|
||||
@ -6825,13 +6825,6 @@ bool PeerConnection::SetupDataChannelTransport_n(const std::string& mid) {
|
||||
data_channel_transport_invoker_ = std::make_unique<rtc::AsyncInvoker>();
|
||||
data_channel_transport_->SetDataSink(this);
|
||||
sctp_mid_ = mid;
|
||||
// TODO(mellem): Handling data channel state through media transport is
|
||||
// deprecated. Delete these lines when downstream implementations call
|
||||
// DataChannelSink::OnStateChanged().
|
||||
transport_controller_->SignalMediaTransportStateChanged.connect(
|
||||
this, &PeerConnection::OnMediaTransportStateChanged_n);
|
||||
// Check the initial state right away, in case transport is already writable.
|
||||
OnMediaTransportStateChanged_n();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -6842,9 +6835,6 @@ void PeerConnection::TeardownDataChannelTransport_n() {
|
||||
RTC_LOG(LS_INFO) << "Tearing down data channel transport for mid="
|
||||
<< *sctp_mid_;
|
||||
|
||||
// TODO(mellem): Delete this line when downstream implementations call
|
||||
// DataChannelSink::OnStateChanged().
|
||||
transport_controller_->SignalMediaTransportStateChanged.disconnect(this);
|
||||
// |sctp_mid_| may still be active through an SCTP transport. If not, unset
|
||||
// it.
|
||||
if (!sctp_transport_) {
|
||||
@ -6855,25 +6845,6 @@ void PeerConnection::TeardownDataChannelTransport_n() {
|
||||
data_channel_transport_ = nullptr;
|
||||
}
|
||||
|
||||
// TODO(mellem): Handling of data channel state through the media transport
|
||||
// callback is deprecated. This function should be deleted once downstream
|
||||
// implementations call DataChannelSink::OnStateChanged().
|
||||
void PeerConnection::OnMediaTransportStateChanged_n() {
|
||||
if (!sctp_mid_ || transport_controller_->GetMediaTransportState(*sctp_mid_) !=
|
||||
MediaTransportState::kWritable) {
|
||||
return;
|
||||
}
|
||||
data_channel_transport_invoker_->AsyncInvoke<void>(
|
||||
RTC_FROM_HERE, signaling_thread(), [this] {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread());
|
||||
data_channel_transport_ready_to_send_ = true;
|
||||
if (data_channel_transport_negotiated_) {
|
||||
SignalDataChannelTransportWritable_s(
|
||||
data_channel_transport_ready_to_send_);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Returns false if bundle is enabled and rtcp_mux is disabled.
|
||||
bool PeerConnection::ValidateBundleSettings(const SessionDescription* desc) {
|
||||
bool bundle_enabled = desc->HasGroup(cricket::GROUP_TYPE_BUNDLE);
|
||||
|
||||
@ -1049,7 +1049,6 @@ class PeerConnection : public PeerConnectionInternal,
|
||||
|
||||
bool SetupDataChannelTransport_n(const std::string& mid)
|
||||
RTC_RUN_ON(network_thread());
|
||||
void OnMediaTransportStateChanged_n() RTC_RUN_ON(network_thread());
|
||||
void TeardownDataChannelTransport_n() RTC_RUN_ON(network_thread());
|
||||
|
||||
bool ValidateBundleSettings(const cricket::SessionDescription* desc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user