Reland of: Separating SCTP code from BaseChannel/MediaChannel.

The BaseChannel code is geared around RTP; the presence of media engines,
send and receive streams, SRTP, SDP directional attribute negotiation, etc.
It doesn't make sense to use it for SCTP as well. This separation should make
future work both on BaseChannel and the SCTP code paths easier.

SctpDataEngine now becomes SctpTransport, and is used by WebRtcSession
directly. cricket::DataChannel is also renamed, to RtpDataChannel, so it
doesn't get confused with webrtc::DataChannel any more.

Beyond just moving code around, some consequences of this CL:
- We'll now stop using the worker thread for SCTP. Packets will be
  processed right on the network thread instead.
- The SDP directional attribute is ignored, as it's supposed to be.

BUG=None

Review-Url: https://codereview.webrtc.org/2564333002
Cr-Original-Commit-Position: refs/heads/master@{#15906}
Committed: https://chromium.googlesource.com/external/webrtc/+/67b3bbe639645ab719972682359acda303d94454
Review-Url: https://codereview.webrtc.org/2564333002
Cr-Commit-Position: refs/heads/master@{#15973}
diff --git a/webrtc/pc/channelmanager.h b/webrtc/pc/channelmanager.h
index 7df49bb..3022eca 100644
--- a/webrtc/pc/channelmanager.h
+++ b/webrtc/pc/channelmanager.h
@@ -110,16 +110,15 @@
       const VideoOptions& options);
   // Destroys a video channel created with the Create API.
   void DestroyVideoChannel(VideoChannel* video_channel);
-  DataChannel* CreateDataChannel(
+  RtpDataChannel* CreateRtpDataChannel(
       webrtc::MediaControllerInterface* media_controller,
       TransportController* transport_controller,
       const std::string& content_name,
       const std::string* bundle_transport_name,
       bool rtcp,
-      bool srtp_required,
-      DataChannelType data_channel_type);
+      bool srtp_required);
   // Destroys a data channel created with the Create API.
-  void DestroyDataChannel(DataChannel* data_channel);
+  void DestroyRtpDataChannel(RtpDataChannel* data_channel);
 
   // Indicates whether any channels exist.
   bool has_channels() const {
@@ -150,7 +149,7 @@
  private:
   typedef std::vector<VoiceChannel*> VoiceChannels;
   typedef std::vector<VideoChannel*> VideoChannels;
-  typedef std::vector<DataChannel*> DataChannels;
+  typedef std::vector<RtpDataChannel*> RtpDataChannels;
 
   void Construct(MediaEngineInterface* me,
                  DataEngineInterface* dme,
@@ -178,15 +177,14 @@
       bool srtp_required,
       const VideoOptions& options);
   void DestroyVideoChannel_w(VideoChannel* video_channel);
-  DataChannel* CreateDataChannel_w(
+  RtpDataChannel* CreateRtpDataChannel_w(
       webrtc::MediaControllerInterface* media_controller,
       TransportController* transport_controller,
       const std::string& content_name,
       const std::string* bundle_transport_name,
       bool rtcp,
-      bool srtp_required,
-      DataChannelType data_channel_type);
-  void DestroyDataChannel_w(DataChannel* data_channel);
+      bool srtp_required);
+  void DestroyRtpDataChannel_w(RtpDataChannel* data_channel);
 
   std::unique_ptr<MediaEngineInterface> media_engine_;
   std::unique_ptr<DataEngineInterface> data_media_engine_;
@@ -197,7 +195,7 @@
 
   VoiceChannels voice_channels_;
   VideoChannels video_channels_;
-  DataChannels data_channels_;
+  RtpDataChannels data_channels_;
 
   bool enable_rtx_;
   rtc::CryptoOptions crypto_options_;