diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc index 3344bffe27..6c853c14f7 100644 --- a/webrtc/p2p/base/dtlstransportchannel.cc +++ b/webrtc/p2p/base/dtlstransportchannel.cc @@ -121,21 +121,6 @@ void DtlsTransportChannelWrapper::Connect() { channel_->Connect(); } -void DtlsTransportChannelWrapper::Reset() { - channel_->Reset(); - set_writable(false); - set_readable(false); - - // Re-call SetupDtls() - if (!SetupDtls()) { - LOG_J(LS_ERROR, this) << "Error re-initializing DTLS"; - dtls_state_ = STATE_CLOSED; - return; - } - - dtls_state_ = STATE_ACCEPTED; -} - bool DtlsTransportChannelWrapper::SetLocalIdentity( rtc::SSLIdentity* identity) { if (dtls_state_ != STATE_NONE) { diff --git a/webrtc/p2p/base/dtlstransportchannel.h b/webrtc/p2p/base/dtlstransportchannel.h index 03a916b767..a5fd035267 100644 --- a/webrtc/p2p/base/dtlstransportchannel.h +++ b/webrtc/p2p/base/dtlstransportchannel.h @@ -204,7 +204,6 @@ class DtlsTransportChannelWrapper : public TransportChannelImpl { } virtual void Connect(); - virtual void Reset(); virtual void OnSignalingReady() { channel_->OnSignalingReady(); diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc index bca2c450cc..ef21559621 100644 --- a/webrtc/p2p/base/p2ptransportchannel.cc +++ b/webrtc/p2p/base/p2ptransportchannel.cc @@ -371,39 +371,6 @@ void P2PTransportChannel::Connect() { thread()->Post(this, MSG_PING); } -// Reset the socket, clear up any previous allocations and start over -void P2PTransportChannel::Reset() { - ASSERT(worker_thread_ == rtc::Thread::Current()); - - // Get rid of all the old allocators. This should clean up everything. - for (uint32 i = 0; i < allocator_sessions_.size(); ++i) - delete allocator_sessions_[i]; - - allocator_sessions_.clear(); - ports_.clear(); - connections_.clear(); - best_connection_ = NULL; - - // Forget about all of the candidates we got before. - remote_candidates_.clear(); - - // Revert to the initial state. - set_readable(false); - set_writable(false); - - // Reinitialize the rest of our state. - waiting_for_signaling_ = false; - sort_dirty_ = false; - - // If we allocated before, start a new one now. - if (transport_->connect_requested()) - Allocate(); - - // Start pinging as the ports come in. - thread()->Clear(this); - thread()->Post(this, MSG_PING); -} - // A new port is available, attempt to make connections for it void P2PTransportChannel::OnPortReady(PortAllocatorSession *session, PortInterface* port) { diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h index a9312b7e05..a014701f18 100644 --- a/webrtc/p2p/base/p2ptransportchannel.h +++ b/webrtc/p2p/base/p2ptransportchannel.h @@ -71,7 +71,6 @@ class P2PTransportChannel : public TransportChannelImpl, const std::string& ice_pwd); virtual void SetRemoteIceMode(IceMode mode); virtual void Connect(); - virtual void Reset(); virtual void OnSignalingReady(); virtual void OnCandidate(const Candidate& candidate); diff --git a/webrtc/p2p/base/transport.cc b/webrtc/p2p/base/transport.cc index 10a069683c..dfc7d34b43 100644 --- a/webrtc/p2p/base/transport.cc +++ b/webrtc/p2p/base/transport.cc @@ -380,25 +380,6 @@ void Transport::DestroyAllChannels_w() { DestroyTransportChannel(impls[i]); } -void Transport::ResetChannels() { - ASSERT(signaling_thread()->IsCurrent()); - worker_thread_->Invoke(Bind(&Transport::ResetChannels_w, this)); -} - -void Transport::ResetChannels_w() { - ASSERT(worker_thread()->IsCurrent()); - - // We are no longer attempting to connect - connect_requested_ = false; - - // Clear out the old messages, they aren't relevant - rtc::CritScope cs(&crit_); - ready_candidates_.clear(); - - // Reset all of the channels - CallChannels_w(&TransportChannelImpl::Reset); -} - void Transport::OnSignalingReady() { ASSERT(signaling_thread()->IsCurrent()); if (destroyed_) return; diff --git a/webrtc/p2p/base/transportchannelimpl.h b/webrtc/p2p/base/transportchannelimpl.h index db62c9aea9..f57b76e33d 100644 --- a/webrtc/p2p/base/transportchannelimpl.h +++ b/webrtc/p2p/base/transportchannelimpl.h @@ -55,9 +55,6 @@ class TransportChannelImpl : public TransportChannel { // Begins the process of attempting to make a connection to the other client. virtual void Connect() = 0; - // Resets this channel back to the initial state (i.e., not connecting). - virtual void Reset() = 0; - // Allows an individual channel to request signaling and be notified when it // is ready. This is useful if the individual named channels have need to // send their own transport-info stanzas.