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

Unified Diff: webrtc/p2p/base/port.h

Issue 2018693002: Create a new connection if a candidate reuses an address (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: address comments 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/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port.h
diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h
index 704fbb7a65416d42fab37cd8858a43fcdcc0292d..21203572b1e0d88a1bd89bdff09544131d5888b4 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -316,8 +316,10 @@ class Port : public PortInterface, public rtc::MessageHandler,
uint32_t relay_preference,
bool final);
- // Adds the given connection to the list. (Deleting removes them.)
- void AddConnection(Connection* conn);
+ // Adds the given connection to the map keyed by the remote candidate address.
+ // If an existing connection has the same address, the existing one will be
+ // replaced and destroyed.
+ void AddOrReplaceConnection(Connection* conn);
// Called when a packet is received from an unknown address that is not
// currently a connection. If this is an authenticated STUN binding request,
@@ -346,6 +348,9 @@ class Port : public PortInterface, public rtc::MessageHandler,
return rtc::DSCP_NO_CHANGE;
}
+ // Extra work to be done in subclasses when a connection is destroyed.
+ virtual void HandleConnectionDestroyed(Connection* conn) {}
+
private:
void Construct();
// Called when one of our connections deletes itself.
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698