diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc index a39ad93d5a..ab7c32277f 100644 --- a/webrtc/p2p/base/p2ptransportchannel.cc +++ b/webrtc/p2p/base/p2ptransportchannel.cc @@ -984,12 +984,8 @@ void P2PTransportChannel::SortConnections() { // Now update the writable state of the channel with the information we have // so far. - if (best_connection_ && best_connection_->writable()) { - HandleWritable(); - } else if (all_connections_timedout) { + if (all_connections_timedout) { HandleAllTimedOut(); - } else { - HandleNotWritable(); } // Update the state of this channel. This method is called whenever the @@ -1055,12 +1051,8 @@ void P2PTransportChannel::SwitchBestConnectionTo(Connection* conn) { } void P2PTransportChannel::UpdateChannelState() { - // The Handle* functions already set the writable state. We'll just double- - // check it here. bool writable = best_connection_ && best_connection_->writable(); - ASSERT(writable == this->writable()); - if (writable != this->writable()) - LOG(LS_ERROR) << "UpdateChannelState: writable state mismatch"; + set_writable(writable); bool receiving = false; for (const Connection* connection : connections_) { @@ -1091,22 +1083,6 @@ void P2PTransportChannel::MaybeStopPortAllocatorSessions() { } } -// Go into the writable state and notify upper layer if it was not before. -void P2PTransportChannel::HandleWritable() { - ASSERT(worker_thread_ == rtc::Thread::Current()); - if (!writable()) { - set_writable(true); - } -} - -// Notify upper layer about channel not writable state, if it was before. -void P2PTransportChannel::HandleNotWritable() { - ASSERT(worker_thread_ == rtc::Thread::Current()); - if (writable()) { - set_writable(false); - } -} - // If all connections timed out, delete them all. void P2PTransportChannel::HandleAllTimedOut() { for (Connection* connection : connections_) { diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h index f3211e4a53..9f2f3a0bb3 100644 --- a/webrtc/p2p/base/p2ptransportchannel.h +++ b/webrtc/p2p/base/p2ptransportchannel.h @@ -178,8 +178,6 @@ class P2PTransportChannel : public TransportChannelImpl, void SortConnections(); void SwitchBestConnectionTo(Connection* conn); void UpdateChannelState(); - void HandleWritable(); - void HandleNotWritable(); void HandleAllTimedOut(); void MaybeStopPortAllocatorSessions(); diff --git a/webrtc/p2p/base/transportchannel.h b/webrtc/p2p/base/transportchannel.h index 767a5f68bf..ea18957ef3 100644 --- a/webrtc/p2p/base/transportchannel.h +++ b/webrtc/p2p/base/transportchannel.h @@ -154,9 +154,6 @@ class TransportChannel : public sigslot::has_slots<> { std::string ToString() const; protected: - // TODO(honghaiz): Remove this once chromium's unit tests no longer call it. - void set_readable(bool readable) { set_receiving(readable); } - // Sets the writable state, signaling if necessary. void set_writable(bool writable);