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

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

Issue 1976683003: Update the type and cost of existing networks if its type is found later by network monitor (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Get network type from name matching only on IOS or Android. 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
Index: webrtc/p2p/base/p2ptransportchannel.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index 206113c4ebcc554d9b401e716c5031412eda4845..4733bea0c996bff49dd01194123b59f98164f49b 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -507,6 +507,8 @@ void P2PTransportChannel::OnPortReady(PortAllocatorSession *session,
port->SignalDestroyed.connect(this, &P2PTransportChannel::OnPortDestroyed);
port->SignalNetworkInactive.connect(
this, &P2PTransportChannel::OnPortNetworkInactive);
+ port->SignalNetworkCostChanged.connect(
+ this, &P2PTransportChannel::OnPortNetworkCostChanged);
port->SignalRoleConflict.connect(
this, &P2PTransportChannel::OnRoleConflict);
port->SignalSentPacket.connect(this, &P2PTransportChannel::OnSentPacket);
@@ -1497,6 +1499,12 @@ void P2PTransportChannel::OnPortNetworkInactive(PortInterface* port) {
SignalCandidatesRemoved(this, candidates);
}
+void P2PTransportChannel::OnPortNetworkCostChanged(PortInterface* port) {
+ // Network cost of a port will affect the connection comparison.
+ // So request sorting if the network cost of any port has changed.
+ RequestSort();
+}
+
// We data is available, let listeners know
void P2PTransportChannel::OnReadPacket(Connection* connection,
const char* data,

Powered by Google App Engine
This is Rietveld 408576698