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

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

Issue 2025573002: Use continual gathering to restore backup connections (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 years, 6 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/port.cc
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc
index 0add358ec91392917091e957dfc39d28224be5af..f73beda272716437aa69d5195cc81d84a084f20f 100644
--- a/webrtc/p2p/base/port.cc
+++ b/webrtc/p2p/base/port.cc
@@ -216,6 +216,16 @@ Port::~Port() {
delete list[i];
}
+Port::CloseAndSignalCandidateRemovals() {
+ if (closed_) {
+ return;
+ }
+
+ closed_ = true;
+ SignalClosed(this);
+ SignalCandidatesRemoved(this, candidates_);
+}
+
void Port::SetIceParameters(int component,
const std::string& username_fragment,
const std::string& password) {
@@ -237,6 +247,12 @@ Connection* Port::GetConnection(const rtc::SocketAddress& remote_addr) {
return NULL;
}
+void Port::FailAndDestroyConnections() {
+ for (auto kv : connections_) {
+ kv.second->FailAndDestroy();
+ }
+}
+
void Port::AddAddress(const rtc::SocketAddress& address,
const rtc::SocketAddress& base_address,
const rtc::SocketAddress& related_address,
@@ -652,7 +668,7 @@ void Port::OnMessage(rtc::Message *pmsg) {
void Port::OnNetworkInactive(const rtc::Network* network) {
ASSERT(network == network_);
- SignalNetworkInactive(this);
+ CloseAndSignalCandidateRemovals();
}
void Port::OnNetworkTypeChanged(const rtc::Network* network) {

Powered by Google App Engine
This is Rietveld 408576698