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

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..091832c40d4c403a97b8e9989af60fd42df44faa 100644
--- a/talk/app/webrtc/jsepicecandidate.cc
+++ b/talk/app/webrtc/jsepicecandidate.cc
@@ -96,4 +96,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 candidates_.size() - original_size;
Taylor Brandstetter 2016/02/10 21:58:08 This will return a negative number, is that right?
honghaiz3 2016/02/12 00:56:55 Thanks for the good catch.
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698