Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: webrtc/pc/channel.h

Issue 2606123002: Remove the dependency of TransportChannel and TransportChannelImpl. (Closed)
Patch Set: Fix the memory leak. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/udptransport.h ('k') | webrtc/pc/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel.h
diff --git a/webrtc/pc/channel.h b/webrtc/pc/channel.h
index 4c289a2345ea630afa4b55b96cd2b64d206f856c..e4848b2334c444496e368f119b23f570d3094eb6 100644
--- a/webrtc/pc/channel.h
+++ b/webrtc/pc/channel.h
@@ -86,8 +86,8 @@ class BaseChannel
bool rtcp_mux_required,
bool srtp_required);
virtual ~BaseChannel();
- bool Init_w(TransportChannel* rtp_transport,
- TransportChannel* rtcp_transport);
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport,
+ DtlsTransportInternal* rtcp_dtls_transport);
// Deinit may be called multiple times and is simply ignored if it's already
// done.
void Deinit();
@@ -113,8 +113,8 @@ class BaseChannel
// RTCP muxing is not fully active yet).
// |rtp_transport| and |rtcp_transport| must share the same transport name as
// well.
- void SetTransports(TransportChannel* rtp_transport,
- TransportChannel* rtcp_transport);
+ void SetTransports(DtlsTransportInternal* rtp_dtls_transport,
+ DtlsTransportInternal* rtcp_dtls_transport);
bool PushdownLocalDescription(const SessionDescription* local_desc,
ContentAction action,
std::string* error_desc);
@@ -159,7 +159,7 @@ class BaseChannel
// Used for latency measurements.
sigslot::signal1<BaseChannel*> SignalFirstPacketReceived;
- // Forward TransportChannel SignalSentPacket to worker thread.
+ // Forward SignalSentPacket to worker thread.
sigslot::signal1<const rtc::SentPacket&> SignalSentPacket;
// Emitted whenever rtcp-mux is fully negotiated and the rtcp-transport can
@@ -167,8 +167,13 @@ class BaseChannel
// Fired on the network thread.
sigslot::signal1<const std::string&> SignalRtcpMuxFullyActive;
- TransportChannel* rtp_transport() const { return rtp_transport_; }
- TransportChannel* rtcp_transport() const { return rtcp_transport_; }
+ // Only public for unit tests. Otherwise, consider private.
+ DtlsTransportInternal* rtp_dtls_transport() const {
+ return rtp_dtls_transport_;
+ }
+ DtlsTransportInternal* rtcp_dtls_transport() const {
+ return rtcp_dtls_transport_;
+ }
bool NeedsRtcpTransport();
@@ -200,12 +205,12 @@ class BaseChannel
protected:
virtual MediaChannel* media_channel() const { return media_channel_; }
- void SetTransports_n(TransportChannel* rtp_transport,
- TransportChannel* rtcp_transport);
+ void SetTransports_n(DtlsTransportInternal* rtp_dtls_transport,
+ DtlsTransportInternal* rtcp_dtls_transport);
// This does not update writability or "ready-to-send" state; it just
// disconnects from the old channel and connects to the new one.
- void SetTransportChannel_n(bool rtcp, TransportChannel* new_transport);
+ void SetTransport_n(bool rtcp, DtlsTransportInternal* new_transport);
bool was_ever_writable() const { return was_ever_writable_; }
void set_local_content_direction(MediaContentDirection direction) {
@@ -228,8 +233,8 @@ class BaseChannel
bool IsReadyToSendMedia_w() const;
rtc::Thread* signaling_thread() { return signaling_thread_; }
- void ConnectToTransportChannel(TransportChannel* tc);
- void DisconnectFromTransportChannel(TransportChannel* tc);
+ void ConnectToTransport(DtlsTransportInternal* transport);
+ void DisconnectFromTransport(DtlsTransportInternal* transport);
void FlushRtcpMessages_n();
@@ -248,10 +253,10 @@ class BaseChannel
int flags);
void OnReadyToSend(rtc::PacketTransportInterface* transport);
- void OnDtlsState(TransportChannel* channel, DtlsTransportState state);
+ void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state);
void OnSelectedCandidatePairChanged(
- TransportChannel* channel,
+ IceTransportInternal* ice_transport,
CandidatePairInterface* selected_candidate_pair,
int last_sent_packet_id,
bool ready_to_send);
@@ -287,10 +292,10 @@ class BaseChannel
bool ShouldSetupDtlsSrtp_n() const;
// Do the DTLS key expansion and impose it on the SRTP/SRTCP filters.
// |rtcp_channel| indicates whether to set up the RTP or RTCP filter.
- bool SetupDtlsSrtp_n(bool rtcp_channel);
+ bool SetupDtlsSrtp_n(bool rtcp);
void MaybeSetupDtlsSrtp_n();
// Set the DTLS-SRTP cipher policy on this channel as appropriate.
- bool SetDtlsSrtpCryptoSuites_n(TransportChannel* tc, bool rtcp);
+ bool SetDtlsSrtpCryptoSuites_n(DtlsTransportInternal* transport, bool rtcp);
// Should be called whenever the conditions for
// IsReadyToReceiveMedia/IsReadyToSendMedia are satisfied (or unsatisfied).
@@ -360,8 +365,8 @@ class BaseChannel
}
private:
- bool InitNetwork_n(TransportChannel* rtp_transport,
- TransportChannel* rtcp_transport);
+ bool InitNetwork_n(DtlsTransportInternal* rtp_dtls_transport,
+ DtlsTransportInternal* rtcp_dtls_transport);
void DisconnectTransportChannels_n();
void SignalSentPacket_n(rtc::PacketTransportInterface* transport,
const rtc::SentPacket& sent_packet);
@@ -383,10 +388,10 @@ class BaseChannel
// True if RTCP-multiplexing is required. In other words, no standalone RTCP
// transport will ever be used for this channel.
const bool rtcp_mux_required_;
- // TODO(johan): Replace TransportChannel* with rtc::PacketTransportInterface*.
- TransportChannel* rtp_transport_ = nullptr;
+
+ DtlsTransportInternal* rtp_dtls_transport_ = nullptr;
std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
- TransportChannel* rtcp_transport_ = nullptr;
+ DtlsTransportInternal* rtcp_dtls_transport_ = nullptr;
std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
SrtpFilter srtp_filter_;
RtcpMuxFilter rtcp_mux_filter_;
@@ -428,8 +433,8 @@ class VoiceChannel : public BaseChannel {
bool rtcp_mux_required,
bool srtp_required);
~VoiceChannel();
- bool Init_w(TransportChannel* rtp_transport,
- TransportChannel* rtcp_transport);
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport,
+ DtlsTransportInternal* rtcp_dtls_transport);
// Configure sending media on the stream with SSRC |ssrc|
// If there is only one sending stream SSRC 0 can be used.
@@ -547,8 +552,8 @@ class VideoChannel : public BaseChannel {
bool rtcp_mux_required,
bool srtp_required);
~VideoChannel();
- bool Init_w(TransportChannel* rtp_transport,
- TransportChannel* rtcp_transport);
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport,
+ DtlsTransportInternal* rtcp_dtls_transport);
// downcasts a MediaChannel
VideoMediaChannel* media_channel() const override {
@@ -627,8 +632,8 @@ class RtpDataChannel : public BaseChannel {
bool rtcp_mux_required,
bool srtp_required);
~RtpDataChannel();
- bool Init_w(TransportChannel* rtp_transport,
- TransportChannel* rtcp_transport);
+ bool Init_w(DtlsTransportInternal* rtp_dtls_transport,
+ DtlsTransportInternal* rtcp_dtls_transport);
virtual bool SendData(const SendDataParams& params,
const rtc::CopyOnWriteBuffer& payload,
« no previous file with comments | « webrtc/p2p/base/udptransport.h ('k') | webrtc/pc/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698