commit 154c34692a7e705d617780ded80d776285249b9f
parent 44c5e08d3f21cac853b89f136586875c8860f620
Author: Michael Froman <mfroman@mozilla.com>
Date: Thu, 9 Oct 2025 23:37:32 -0500
Bug 1993083 - Vendor libwebrtc from ee93a2cebb
Upstream commit: https://webrtc.googlesource.com/src/+/ee93a2cebbeb193c3b9f2e836f96af102ce89832
Remove unused RemoveRemoteCandidates and RemoveCandidates methods
Bug: webrtc:42233526
Change-Id: I8bc3f16cf6d96c53fd0665269ceeef2cc07c5eed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/402061
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45222}
Diffstat:
9 files changed, 3 insertions(+), 116 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor
@@ -1,4 +1,4 @@
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
-libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-10T04:36:03.801562+00:00.
+libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-10T04:37:22.813255+00:00.
# base of lastest vendoring
-4f787cd5a3
+ee93a2cebb
diff --git a/third_party/libwebrtc/api/jsep.cc b/third_party/libwebrtc/api/jsep.cc
@@ -13,19 +13,9 @@
#include <cstddef>
#include <optional>
#include <string>
-#include <vector>
-
-#include "absl/strings/string_view.h"
-#include "api/candidate.h"
namespace webrtc {
-size_t SessionDescriptionInterface::RemoveCandidates(
- absl::string_view mid,
- const std::vector<Candidate>& /* candidates */) {
- return 0;
-}
-
const char SessionDescriptionInterface::kOffer[] = "offer";
const char SessionDescriptionInterface::kPrAnswer[] = "pranswer";
const char SessionDescriptionInterface::kAnswer[] = "answer";
diff --git a/third_party/libwebrtc/api/jsep.h b/third_party/libwebrtc/api/jsep.h
@@ -157,11 +157,6 @@ class IceCandidateCollection final {
// Removes the candidate that has a matching address and protocol.
//
// Returns the number of candidates that were removed.
- size_t remove(const Candidate& candidate);
-
- // Removes the candidate that has a matching address and protocol.
- //
- // Returns the number of candidates that were removed.
size_t remove(const IceCandidate* candidate);
const std::vector<std::unique_ptr<IceCandidate>>& candidates() const {
@@ -268,14 +263,6 @@ class RTC_EXPORT SessionDescriptionInterface {
// Returns false if no matching candidate was found (and removed).
virtual bool RemoveCandidate(const IceCandidate* candidate) = 0;
- // Removes the candidates from the description, if found.
- //
- // Returns the number of candidates removed.
- // TODO: webrtc:42233526 - Deprecate and eventually remove this method in
- // favor of the IceCandidate version.
- virtual size_t RemoveCandidates(absl::string_view mid,
- const std::vector<Candidate>& candidates);
-
// Returns the number of m= sections in the session description.
virtual size_t number_of_mediasections() const = 0;
diff --git a/third_party/libwebrtc/api/jsep_ice_candidate.cc b/third_party/libwebrtc/api/jsep_ice_candidate.cc
@@ -73,18 +73,6 @@ bool IceCandidateCollection::HasCandidate(const IceCandidate* candidate) const {
});
}
-size_t JsepCandidateCollection::remove(const Candidate& candidate) {
- auto iter =
- absl::c_find_if(candidates_, [&](const std::unique_ptr<IceCandidate>& c) {
- return candidate.MatchesForRemoval(c->candidate());
- });
- if (iter != candidates_.end()) {
- candidates_.erase(iter);
- return 1;
- }
- return 0;
-}
-
size_t JsepCandidateCollection::remove(const IceCandidate* candidate) {
RTC_DCHECK(candidate);
auto iter =
diff --git a/third_party/libwebrtc/api/jsep_session_description.h b/third_party/libwebrtc/api/jsep_session_description.h
@@ -20,7 +20,6 @@
#include <vector>
#include "absl/strings/string_view.h"
-#include "api/candidate.h"
#include "api/jsep.h"
namespace webrtc {
@@ -60,10 +59,7 @@ class JsepSessionDescription : public SessionDescriptionInterface {
// Allows changing the type. Used for testing.
virtual bool AddCandidate(const IceCandidate* candidate);
virtual bool RemoveCandidate(const IceCandidate* candidate);
- // TODO: https://issues.webrtc.org/42233526 - Remove this method in favor of
- // the IceCandidate version.
- virtual size_t RemoveCandidates(absl::string_view mid,
- const std::vector<Candidate>& candidates);
+
virtual size_t number_of_mediasections() const;
virtual const IceCandidateCollection* candidates(
size_t mediasection_index) const;
diff --git a/third_party/libwebrtc/api/test/mock_session_description_interface.h b/third_party/libwebrtc/api/test/mock_session_description_interface.h
@@ -15,10 +15,7 @@
#include <memory>
#include <string>
#include <type_traits>
-#include <vector>
-#include "absl/strings/string_view.h"
-#include "api/candidate.h"
#include "api/jsep.h"
#include "test/gmock.h"
@@ -38,10 +35,6 @@ class MockSessionDescriptionInterface : public SessionDescriptionInterface {
MOCK_METHOD(std::string, type, (), (const, override));
MOCK_METHOD(bool, AddCandidate, (const IceCandidate*), (override));
MOCK_METHOD(bool, RemoveCandidate, (const IceCandidate*), (override));
- MOCK_METHOD(size_t,
- RemoveCandidates,
- (absl::string_view, const std::vector<Candidate>&),
- (override));
MOCK_METHOD(size_t, number_of_mediasections, (), (const, override));
MOCK_METHOD(const IceCandidateCollection*,
candidates,
diff --git a/third_party/libwebrtc/pc/jsep_session_description.cc b/third_party/libwebrtc/pc/jsep_session_description.cc
@@ -279,24 +279,6 @@ bool JsepSessionDescription::RemoveCandidate(const IceCandidate* candidate) {
return true;
}
-size_t JsepSessionDescription::RemoveCandidates(
- absl::string_view mid,
- const std::vector<Candidate>& candidates) {
- int mediasection_index = GetMediasectionIndex(mid);
- if (mediasection_index < 0) {
- return 0u;
- }
-
- size_t num_removed = 0u;
- for (auto& candidate : candidates) {
- num_removed += candidate_collection_[mediasection_index].remove(candidate);
- UpdateConnectionAddress(
- candidate_collection_[mediasection_index],
- description_->contents()[mediasection_index].media_description());
- }
- return num_removed;
-}
-
size_t JsepSessionDescription::number_of_mediasections() const {
if (!description_)
return 0;
diff --git a/third_party/libwebrtc/pc/jsep_transport_controller.cc b/third_party/libwebrtc/pc/jsep_transport_controller.cc
@@ -407,54 +407,6 @@ RTCError JsepTransportController::AddRemoteCandidates(
return jsep_transport->AddRemoteCandidates(candidates);
}
-RTCError JsepTransportController::RemoveRemoteCandidates(
- const Candidates& candidates) {
- if (!network_thread_->IsCurrent()) {
- return network_thread_->BlockingCall(
- [&] { return RemoveRemoteCandidates(candidates); });
- }
-
- RTC_DCHECK_RUN_ON(network_thread_);
-
- // Verify each candidate before passing down to the transport layer.
- RTCError error = VerifyCandidates(candidates);
- if (!error.ok()) {
- return error;
- }
-
- std::map<std::string, Candidates> candidates_by_transport_name;
- for (const Candidate& cand : candidates) {
- if (!cand.transport_name().empty()) {
- candidates_by_transport_name[cand.transport_name()].push_back(cand);
- } else {
- RTC_LOG(LS_ERROR) << "Not removing candidate because it does not have a "
- "transport name set: "
- << cand.ToSensitiveString();
- }
- }
-
- for (const auto& kv : candidates_by_transport_name) {
- const std::string& transport_name = kv.first;
- const Candidates& transport_candidates = kv.second;
- JsepTransport* jsep_transport = GetJsepTransportByName(transport_name);
- if (!jsep_transport) {
- RTC_LOG(LS_WARNING)
- << "Not removing candidate because the JsepTransport doesn't exist.";
- continue;
- }
- for (const Candidate& candidate : transport_candidates) {
- DtlsTransportInternal* dtls =
- candidate.component() == ICE_CANDIDATE_COMPONENT_RTP
- ? jsep_transport->rtp_dtls_transport()
- : jsep_transport->rtcp_dtls_transport();
- if (dtls) {
- dtls->ice_transport()->RemoveRemoteCandidate(candidate);
- }
- }
- }
- return RTCError::OK();
-}
-
bool JsepTransportController::RemoveRemoteCandidate(const IceCandidate* c) {
if (!network_thread_->IsCurrent()) {
return network_thread_->BlockingCall(
diff --git a/third_party/libwebrtc/pc/jsep_transport_controller.h b/third_party/libwebrtc/pc/jsep_transport_controller.h
@@ -210,7 +210,6 @@ class JsepTransportController : public PayloadTypeSuggester,
void MaybeStartGathering();
RTCError AddRemoteCandidates(const std::string& mid,
const std::vector<Candidate>& candidates);
- RTCError RemoveRemoteCandidates(const std::vector<Candidate>& candidates);
bool RemoveRemoteCandidate(const IceCandidate* candidate);
/**********************