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

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

Issue 1696933003: When doing continual gathering, remove local candidates when a network is dropped. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix a type conversion error on Windows Created 4 years, 10 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/port.h ('k') | webrtc/p2p/base/portinterface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port.cc
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc
index 4d95279bba79b60307866eeeb43a9e70c31c168f..ed26fe494c0b00d0abad104d917eb2de78a96785 100644
--- a/webrtc/p2p/base/port.cc
+++ b/webrtc/p2p/base/port.cc
@@ -20,6 +20,7 @@
#include "webrtc/base/helpers.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/messagedigest.h"
+#include "webrtc/base/network.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/stringencode.h"
#include "webrtc/base/stringutils.h"
@@ -195,6 +196,7 @@ void Port::Construct() {
ice_username_fragment_ = rtc::CreateRandomString(ICE_UFRAG_LENGTH);
password_ = rtc::CreateRandomString(ICE_PWD_LENGTH);
}
+ network_->SignalInactive.connect(this, &Port::OnNetworkInactive);
// TODO(honghaiz): Make it configurable from user setting.
network_cost_ =
(network_->type() == rtc::ADAPTER_TYPE_CELLULAR) ? kMaxNetworkCost : 0;
@@ -633,11 +635,16 @@ void Port::OnMessage(rtc::Message *pmsg) {
}
}
+void Port::OnNetworkInactive(const rtc::Network* network) {
+ ASSERT(network == network_);
+ SignalNetworkInactive(this);
+}
+
std::string Port::ToString() const {
std::stringstream ss;
- ss << "Port[" << content_name_ << ":" << component_
- << ":" << generation_ << ":" << type_
- << ":" << network_->ToString() << "]";
+ ss << "Port[" << std::hex << this << std::dec << ":" << content_name_ << ":"
+ << component_ << ":" << generation_ << ":" << type_ << ":"
+ << network_->ToString() << "]";
return ss.str();
}
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | webrtc/p2p/base/portinterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698