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

Unified Diff: talk/app/webrtc/jsepsessiondescription.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/jsepsessiondescription.cc
diff --git a/talk/app/webrtc/jsepsessiondescription.cc b/talk/app/webrtc/jsepsessiondescription.cc
index 226432db6956d63852d536fcb40fc68c778a8ec4..1ddbbba37af205795973d4a293c01addf6d89614 100644
--- a/talk/app/webrtc/jsepsessiondescription.cc
+++ b/talk/app/webrtc/jsepsessiondescription.cc
@@ -154,6 +154,22 @@ bool JsepSessionDescription::AddCandidate(
return true;
}
+bool JsepSessionDescription::RemoveCandidate(
+ const IceCandidateInterface* candidate) {
+ if (!candidate || candidate->sdp_mline_index() < 0 ||
+ candidate->candidate().priority() != 0) {
+ return false;
+ }
+ size_t mediasection_index = 0;
+ if (!GetMediasectionIndex(candidate, &mediasection_index) ||
+ mediasection_index >= number_of_mediasections()) {
+ return false;
+ }
+ int num_removed = candidate_collection_[mediasection_index].remove(candidate);
+ ASSERT(num_removed <= 1);
+ return num_removed > 0;
+}
+
size_t JsepSessionDescription::number_of_mediasections() const {
if (!description_)
return 0;

Powered by Google App Engine
This is Rietveld 408576698