Stop an SCTP connection when the DTLS transport closes.

This CL propagates a "closed" signal from DTLS up to the
SCTP section of the data channel controller, where it causes
closing of all open datachannels.

Bug: chromium:1030631, webrtc:10360
Change-Id: I88bb9e1aff5c25f330edfd092ef609d4fcc3a9f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162206
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30099}
diff --git a/pc/data_channel_controller.cc b/pc/data_channel_controller.cc
index cb93384..2800992 100644
--- a/pc/data_channel_controller.cc
+++ b/pc/data_channel_controller.cc
@@ -181,6 +181,15 @@
       });
 }
 
+void DataChannelController::OnTransportClosed() {
+  RTC_DCHECK_RUN_ON(network_thread());
+  data_channel_transport_invoker_->AsyncInvoke<void>(
+      RTC_FROM_HERE, signaling_thread(), [this] {
+        RTC_DCHECK_RUN_ON(signaling_thread());
+        OnTransportChannelClosed();
+      });
+}
+
 void DataChannelController::SetupDataChannelTransport_n() {
   RTC_DCHECK_RUN_ON(network_thread());
   data_channel_transport_invoker_ = std::make_unique<rtc::AsyncInvoker>();