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

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

Issue 1270613006: First step of passive aggressive nomination. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments Created 5 years, 4 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
« webrtc/p2p/base/p2ptransportchannel.cc ('K') | « webrtc/p2p/base/port.h ('k') | no next file » | 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 4023b322e732ef31e6827bd3fc95715351fc2f22..d5ea551e676689570299c972239421de8455f1ee 100644
--- a/webrtc/p2p/base/port.cc
+++ b/webrtc/p2p/base/port.cc
@@ -887,6 +887,7 @@ Connection::Connection(Port* port,
connected_(true),
pruned_(false),
use_candidate_attr_(false),
+ nominated_(false),
remote_ice_mode_(ICEMODE_FULL),
requests_(port->thread()),
rtt_(DEFAULT_RTT),
@@ -1057,7 +1058,7 @@ void Connection::OnReadPacket(
const StunByteStringAttribute* use_candidate_attr =
msg->GetByteString(STUN_ATTR_USE_CANDIDATE);
if (use_candidate_attr)
- SignalUseCandidate(this);
+ set_nominated(true);
}
} else {
// The packet had the right local username, but the remote username
@@ -1473,6 +1474,13 @@ size_t Connection::sent_total_packets() {
return sent_packets_total_;
}
+void Connection::set_nominated(bool nominated) {
+ nominated_ = nominated;
+ if (nominated_) {
+ SignalUseCandidate(this);
juberti1 2015/08/07 01:31:19 This seems like an unexpected side effect. I would
honghaiz3 2015/08/07 20:42:04 Done.
+ }
+}
+
void Connection::MaybeAddPrflxCandidate(ConnectionRequest* request,
StunMessage* response) {
// RFC 5245
« webrtc/p2p/base/p2ptransportchannel.cc ('K') | « webrtc/p2p/base/port.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698