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

Unified Diff: webrtc/api/jsepsessiondescription.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/jsepsessiondescription.cc
diff --git a/webrtc/api/jsepsessiondescription.cc b/webrtc/api/jsepsessiondescription.cc
index b47114b9bcd052979f13a19bdea35d3faae6efc5..ac9b6afbd829aa1c743c6146196d18cb1e3a6cfe 100644
--- a/webrtc/api/jsepsessiondescription.cc
+++ b/webrtc/api/jsepsessiondescription.cc
@@ -137,6 +137,28 @@ bool JsepSessionDescription::AddCandidate(
return true;
}
+int JsepSessionDescription::RemoveCandidate(
+ const IceCandidateInterface* candidate) {
+ if (!candidate || candidate->sdp_mline_index() < 0) {
+ return 0;
+ }
+ size_t mediasection_index = 0;
+ if (!GetMediasectionIndex(candidate, &mediasection_index) ||
+ mediasection_index >= number_of_mediasections()) {
+ return 0;
+ }
+ return candidate_collection_[mediasection_index].remove(candidate);
+}
+
+int JsepSessionDescription::RemoveCandidates(
+ const std::vector<IceCandidateInterfaceRefPtr>& candidates) {
+ int num_removed = 0;
+ for (auto candidate : candidates) {
+ num_removed += RemoveCandidate(candidate.get());
+ }
+ return num_removed;
+}
+
size_t JsepSessionDescription::number_of_mediasections() const {
if (!description_)
return 0;

Powered by Google App Engine
This is Rietveld 408576698