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

Unified Diff: webrtc/api/jsepicecandidate.cc

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/api/jsepicecandidate.cc
diff --git a/webrtc/api/jsepicecandidate.cc b/webrtc/api/jsepicecandidate.cc
index 2aabcb83498ead96000f9624b423a21102516bfb..ea563991578d63399b89418690e18734b314f602 100644
--- a/webrtc/api/jsepicecandidate.cc
+++ b/webrtc/api/jsepicecandidate.cc
@@ -79,4 +79,14 @@ bool JsepCandidateCollection::HasCandidate(
return ret;
}
+size_t JsepCandidateCollection::remove(const cricket::Candidate& candidate) {
+ size_t original_size = candidates_.size();
+ auto new_end = std::remove_if(
+ candidates_.begin(), candidates_.end(), [candidate](JsepIceCandidate* c) {
+ return candidate.MatchesForRemoval(c->candidate());
+ });
+ candidates_.erase(new_end, candidates_.end());
+ return original_size - candidates_.size();
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698