Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1996693002: Fire a signal when the transport channel state changes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Changed signal name to SignalStateChanged Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/faketransportcontroller.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index 2801c446461679011e091ccd5fd5af46dcb81cdf..92bec6f8970a95878fcb5fe3ed20cb7ed43c1603 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -357,7 +357,6 @@ TransportChannelState P2PTransportChannel::ComputeState() const {
}
}
- LOG_J(LS_VERBOSE, this) << "Ice is completed for this channel.";
return TransportChannelState::STATE_COMPLETED;
}
@@ -1209,7 +1208,13 @@ void P2PTransportChannel::SwitchBestConnectionTo(Connection* conn) {
// change, it should be called after all the connection states have changed. For
// example, we call this at the end of SortConnections.
void P2PTransportChannel::UpdateState() {
- state_ = ComputeState();
+ TransportChannelState state = ComputeState();
+ if (state_ != state) {
+ LOG_J(LS_INFO, this) << "Transport channel state changed from " << state_
+ << " to " << state;
+ state_ = state;
+ SignalStateChanged(this);
+ }
bool writable = best_connection_ && best_connection_->writable();
set_writable(writable);
@@ -1472,9 +1477,6 @@ void P2PTransportChannel::OnConnectionDestroyed(Connection* connection) {
}
UpdateState();
- // SignalConnectionRemoved should be called after the channel state is
- // updated because the receiver of the event may access the channel state.
- SignalConnectionRemoved(this);
}
// When a port is destroyed remove it from our list of ports to use for
« no previous file with comments | « webrtc/p2p/base/faketransportcontroller.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698