Add API for returning a webrtc::DtlsTransport for a MID on a PC

This includes a refactoring of jseptransport to store a refcounted
object instead of a std::unique_ptr to the cricket::DtlsTransport.

Bug: chromium:907849
Change-Id: Ib557ce72c2e6ce8af297c2b8deb7ec3a103d6d31
Reviewed-on: https://webrtc-review.googlesource.com/c/111920
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25831}
diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h
index 54161b8..02b925d 100644
--- a/api/peerconnectioninterface.h
+++ b/api/peerconnectioninterface.h
@@ -129,6 +129,7 @@
 class AudioDeviceModule;
 class AudioMixer;
 class AudioProcessing;
+class DtlsTransportInterface;
 class MediaConstraintsInterface;
 class VideoDecoderFactory;
 class VideoEncoderFactory;
@@ -1029,6 +1030,14 @@
   // TODO(henrika): deprecate and remove this.
   virtual void SetAudioRecording(bool recording) {}
 
+  // Looks up the DtlsTransport associated with a MID value.
+  // In the Javascript API, DtlsTransport is a property of a sender, but
+  // because the PeerConnection owns the DtlsTransport in this implementation,
+  // it is better to look them up on the PeerConnection.
+  virtual rtc::scoped_refptr<DtlsTransportInterface> LookupDtlsTransportByMid(
+      const std::string& mid);
+  // TODO(hta): Remove default implementation.
+
   // Returns the current SignalingState.
   virtual SignalingState signaling_state() = 0;