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

Unified Diff: talk/app/webrtc/jsepicecandidate.cc

Issue 1648813004: Remove candidates when doing continual gathering (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: 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: talk/app/webrtc/jsepicecandidate.cc
diff --git a/talk/app/webrtc/jsepicecandidate.cc b/talk/app/webrtc/jsepicecandidate.cc
index 768bd0a281bc3ee7097a116f00e3e4cc677c8644..2ca7ab134c74399d2304d69d34c1d3c490ce3101 100644
--- a/talk/app/webrtc/jsepicecandidate.cc
+++ b/talk/app/webrtc/jsepicecandidate.cc
@@ -96,4 +96,15 @@ bool JsepCandidateCollection::HasCandidate(
return ret;
}
+int JsepCandidateCollection::remove(const IceCandidateInterface* target) {
+ size_t original_size = candidates_.size();
+ auto new_end = std::remove_if(
+ candidates_.begin(), candidates_.end(),
+ [target](JsepIceCandidate* candidate) {
+ return target->candidate().IsWeaklyEquivalent(candidate->candidate());
+ });
+ candidates_.erase(new_end, candidates_.end());
+ return candidates_.size() - original_size;
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698