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

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: Fix a Windows compiling error 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..580ed33edfbe8f128a96869518a14ddd6c422cae 100644
--- a/webrtc/api/jsepicecandidate.cc
+++ b/webrtc/api/jsepicecandidate.cc
@@ -79,4 +79,14 @@ bool JsepCandidateCollection::HasCandidate(
return ret;
}
+int JsepCandidateCollection::remove(const IceCandidateInterface* candidate) {
+ size_t original_size = candidates_.size();
+ auto new_end = std::remove_if(
+ candidates_.begin(), candidates_.end(), [candidate](JsepIceCandidate* c) {
+ return candidate->candidate().MatchesForRemoval(c->candidate());
+ });
+ candidates_.erase(new_end, candidates_.end());
+ return static_cast<int>(original_size - candidates_.size());
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698