Index: webrtc/p2p/base/p2ptransportchannel.cc |
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc |
index 3ac291fa1f5481e5863cca20b5aadaf871aee5fe..b70f271b1848d430aa01107493f8a8452f6ba451 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.cc |
+++ b/webrtc/p2p/base/p2ptransportchannel.cc |
@@ -991,12 +991,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 |
@@ -1062,12 +1058,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_) { |
@@ -1098,22 +1090,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_) { |