A little cleanup in p2ptransportchannel and transportchannel.
No functional changes.
BUG=
Review URL: https://codereview.webrtc.org/1411103012
Cr-Commit-Position: refs/heads/master@{#10614}
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index a39ad93..ab7c322 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -984,12 +984,8 @@
// 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::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 @@
}
}
-// 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 f3211e4..9f2f3a0 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -178,8 +178,6 @@
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 767a5f6..ea18957 100644
--- a/webrtc/p2p/base/transportchannel.h
+++ b/webrtc/p2p/base/transportchannel.h
@@ -154,9 +154,6 @@
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);