Use new TransportController implementation in PeerConnection.

The TransportController will be replaced by the JsepTransportController
and JsepTransport will be replace be JsepTransport2.

The JsepTransportController will take the entire SessionDescription
and handle the RtcpMux, Sdes and BUNDLE internally.

The ownership model is also changed. The P2P layer transports are not
ref-counted and will be owned by the JsepTransport2.

In ORTC aspect, RtpTransportAdapter is now a wrapper over RtpTransport
or SrtpTransport and it implements the public and internal interface
by calling the transport underneath.

Bug: webrtc:8587
Change-Id: Ia7fa61288a566f211f8560072ea0eecaf19e48df
Reviewed-on: https://webrtc-review.googlesource.com/59586
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22693}
diff --git a/ortc/rtptransportcontrolleradapter.h b/ortc/rtptransportcontrolleradapter.h
index ec30687..bdc245d 100644
--- a/ortc/rtptransportcontrolleradapter.h
+++ b/ortc/rtptransportcontrolleradapter.h
@@ -66,7 +66,8 @@
       cricket::ChannelManager* channel_manager,
       webrtc::RtcEventLog* event_log,
       rtc::Thread* signaling_thread,
-      rtc::Thread* worker_thread);
+      rtc::Thread* worker_thread,
+      rtc::Thread* network_thread);
 
   ~RtpTransportControllerAdapter() override;
 
@@ -100,6 +101,7 @@
   // Methods used internally by other "adapter" classes.
   rtc::Thread* signaling_thread() const { return signaling_thread_; }
   rtc::Thread* worker_thread() const { return worker_thread_; }
+  rtc::Thread* network_thread() const { return network_thread_; }
 
   // |parameters.keepalive| will be set for ALL RTP transports in the call.
   RTCError SetRtpTransportParameters(const RtpTransportParameters& parameters,
@@ -131,7 +133,8 @@
                                 cricket::ChannelManager* channel_manager,
                                 webrtc::RtcEventLog* event_log,
                                 rtc::Thread* signaling_thread,
-                                rtc::Thread* worker_thread);
+                                rtc::Thread* worker_thread,
+                                rtc::Thread* network_thread);
   void Init_w();
   void Close_w();
 
@@ -180,15 +183,9 @@
       const std::string& cname,
       const cricket::MediaContentDescription& description) const;
 
-  // If the |rtp_transport| is a SrtpTransport, set the cryptos of the
-  // audio/video content descriptions.
-  RTCError MaybeSetCryptos(
-      RtpTransportInterface* rtp_transport,
-      cricket::MediaContentDescription* local_description,
-      cricket::MediaContentDescription* remote_description);
-
   rtc::Thread* signaling_thread_;
   rtc::Thread* worker_thread_;
+  rtc::Thread* network_thread_;
   // |transport_proxies_| and |inner_audio_transport_|/|inner_audio_transport_|
   // are somewhat redundant, but the latter are only set when
   // RtpSenders/RtpReceivers are attached to the transport.