Chromium Code Reviews| Index: webrtc/api/quicdatachannel.cc | 
| diff --git a/webrtc/api/quicdatachannel.cc b/webrtc/api/quicdatachannel.cc | 
| index 5493382e1a022650b997d678a7742b24b6fc14be..23f126e2c02d234ac3264088be150e4cd0d9131d 100644 | 
| --- a/webrtc/api/quicdatachannel.cc | 
| +++ b/webrtc/api/quicdatachannel.cc | 
| @@ -228,15 +228,18 @@ bool QuicDataChannel::SetTransportChannel( | 
| LOG(LS_ERROR) << "|channel| is NULL. Cannot set transport channel."; | 
| return false; | 
| } | 
| - if (quic_transport_channel_) { | 
| - if (channel == quic_transport_channel_) { | 
| - LOG(LS_WARNING) << "Ignoring duplicate transport channel."; | 
| - return true; | 
| - } | 
| - LOG(LS_ERROR) << "|channel| does not match existing transport channel."; | 
| - return false; | 
| + | 
| + if (channel == quic_transport_channel_) { | 
| + LOG(LS_WARNING) << "Ignoring duplicate transport channel."; | 
| + return true; | 
| } | 
| + // Disconnect from the old transport channel. | 
| + if (quic_transport_channel_) { | 
| + quic_transport_channel_->SignalReadyToSend.disconnect(this); | 
| + quic_transport_channel_->SignalClosed.disconnect(this); | 
| + } | 
| + // Set new transport channel. | 
| 
 
Taylor Brandstetter
2016/07/21 23:39:57
Is it possible to switch transports in the middle
 
pthatcher1
2016/07/22 17:57:57
We should at least do this:
 
if (state_ == kOpen)
 
Taylor Brandstetter
2016/07/22 19:04:56
If we base the success of "Set___Description" on t
 
Zhi Huang
2016/07/25 23:40:36
I will revert this change for now. I think we migh
 
 | 
| quic_transport_channel_ = channel; | 
| LOG(LS_INFO) << "Setting QuicTransportChannel for QUIC data channel " << id_; | 
| DataState data_channel_state = worker_thread_->Invoke<DataState>( |