Combining "SetTransportChannel" and "SetRtcpTransportChannel".
The only real difference between the two is that SetRtcpTransportChannel
had a workaround to prevent a signal from being emitted early.
Basically, in SetTransport, we want to switch the transport channels and
*then* update the state, rather than updating the state after changing
only one transport channel.
But this can be accomplished more easily by simply updating the state in
SetTransport directly.
Review-Url: https://codereview.webrtc.org/2274283004
Cr-Commit-Position: refs/heads/master@{#13945}
diff --git a/webrtc/pc/channel.h b/webrtc/pc/channel.h
index 2a5d3a5..7d3bc94 100644
--- a/webrtc/pc/channel.h
+++ b/webrtc/pc/channel.h
@@ -48,15 +48,16 @@
struct CryptoParams;
class MediaContentDescription;
-// BaseChannel contains logic common to voice and video, including
-// enable, marshaling calls to a worker and network threads, and
-// connection and media monitors.
+// BaseChannel contains logic common to voice and video, including enable,
+// marshaling calls to a worker and network threads, and connection and media
+// monitors.
+//
// BaseChannel assumes signaling and other threads are allowed to make
// synchronous calls to the worker thread, the worker thread makes synchronous
// calls only to the network thread, and the network thread can't be blocked by
// other threads.
// All methods with _n suffix must be called on network thread,
-// methods with _w suffix - on worker thread
+// methods with _w suffix on worker thread
// and methods with _s suffix on signaling thread.
// Network and worker threads may be the same thread.
//
@@ -187,11 +188,12 @@
// Sets the |transport_channel_| (and |rtcp_transport_channel_|, if
// |rtcp_enabled_| is true). Gets the transport channels from
// |transport_controller_|.
+ // This method also updates writability and "ready-to-send" state.
bool SetTransport_n(const std::string& transport_name);
- void SetTransportChannel_n(TransportChannel* transport);
- void SetRtcpTransportChannel_n(TransportChannel* transport,
- bool update_writablity);
+ // 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_channel);
bool was_ever_writable() const { return was_ever_writable_; }
void set_local_content_direction(MediaContentDirection direction) {