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

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

Issue 1648813004: Remove candidates when doing continual gathering (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: small fixes 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
Index: webrtc/p2p/base/candidate.h
diff --git a/webrtc/p2p/base/candidate.h b/webrtc/p2p/base/candidate.h
index afea2a21c7b7f8b8530951a0339c7fc07bbb931c..caff4537c392ae43a029ba9e5a0f820289645b0a 100644
--- a/webrtc/p2p/base/candidate.h
+++ b/webrtc/p2p/base/candidate.h
@@ -169,6 +169,11 @@ class Candidate {
tcptype_ = tcptype;
}
+ const std::string& transport_name() const { return transport_name_; }
+ void set_transport_name(const std::string& transport_name) {
+ transport_name_ = transport_name;
+ }
pthatcher1 2016/03/05 02:14:32 We should probably put a comment explaining what t
honghaiz3 2016/03/09 17:40:06 Done.
+
// Determines whether this candidate is equivalent to the given one.
bool IsEquivalent(const Candidate& c) const {
// We ignore the network name, since that is just debug information, and
@@ -181,6 +186,13 @@ class Candidate {
(related_address_ == c.related_address_);
}
+ // Determines whether this candidate can be considered equivalent to the
+ // given one when looking for a matching candidate to remove.
+ bool MatchesForRemoval(const Candidate& c) const {
+ return component_ == c.component_ && protocol_ == c.protocol_ &&
+ address_ == c.address_;
+ }
+
std::string ToString() const {
return ToStringInternal(false);
}
@@ -245,8 +257,11 @@ class Candidate {
rtc::SocketAddress related_address_;
std::string tcptype_;
uint32_t network_cost_ = 0;
+ std::string transport_name_;
pthatcher1 2016/03/05 02:14:32 Can you make this the first thing (before id_) and
honghaiz3 2016/03/09 17:40:06 Done. The first thing was foundation.
};
+typedef std::vector<Candidate> Candidates;
pthatcher1 2016/03/05 02:14:32 Same here as before.
honghaiz3 2016/03/09 17:40:06 Done.
+
// Used during parsing and writing to map component to channel name
// and back. This is primarily for converting old G-ICE candidate
// signalling to new ICE candidate classes.

Powered by Google App Engine
This is Rietveld 408576698