Remove Transport::Reset, which is never used, and only makes reading the code harder.

R=guoweis@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/43049004

Cr-Commit-Position: refs/heads/master@{#8965}
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
index 3344bff..6c853c1 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -121,21 +121,6 @@
   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 03a916b..a5fd035 100644
--- a/webrtc/p2p/base/dtlstransportchannel.h
+++ b/webrtc/p2p/base/dtlstransportchannel.h
@@ -204,7 +204,6 @@
   }
 
   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 bca2c45..ef21559 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -371,39 +371,6 @@
   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 a9312b7..a014701 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -71,7 +71,6 @@
                                        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 10a0696..dfc7d34 100644
--- a/webrtc/p2p/base/transport.cc
+++ b/webrtc/p2p/base/transport.cc
@@ -380,25 +380,6 @@
     DestroyTransportChannel(impls[i]);
 }
 
-void Transport::ResetChannels() {
-  ASSERT(signaling_thread()->IsCurrent());
-  worker_thread_->Invoke<void>(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 db62c9a..f57b76e 100644
--- a/webrtc/p2p/base/transportchannelimpl.h
+++ b/webrtc/p2p/base/transportchannelimpl.h
@@ -55,9 +55,6 @@
   // 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.