Remove 6 deprecated symbols Removed 6 deprecated symbols that have no usage in WebRTC internals or downstream projects (google3 and Chromium). Removed symbols: - SctpTransportInternal::Start(int, int, int) - AbsoluteCaptureTimeSender::OnSendPacket (deprecated overload) - IceTransportInternal::SubscribeCandidateGathered (without tag) - PacketTransportInternal::SubscribeReceivingState (without tag) - PortAllocatorSession::SubscribeCandidatesAllocationDone (without tag) - DtlsTransportInternalImpl (deprecated constructor) Also removed SimpleIceTransport which was only used by the removed DtlsTransportInternalImpl constructor. Updated remove_deprecated.md instructions to clarify downstream search and use this bug. Bug: webrtc:42224904 Change-Id: If267474a094f88a687d501b3a376889e04a64836 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/479420 Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Auto-Submit: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47929}
diff --git a/g3doc/todo/remove_deprecated.md b/g3doc/todo/remove_deprecated.md index 8cab68f..e336af8 100644 --- a/g3doc/todo/remove_deprecated.md +++ b/g3doc/todo/remove_deprecated.md
@@ -32,9 +32,8 @@ 3. **Internal Audit:** Run `git grep <SymbolName>` in the WebRTC repository. Discard any symbols that still have internal call-sites (these must be migrated first). Discard the oldest symbols first. -4. **Downstream Audit (CodeSearch):** For each matured symbol, perform - high-precision searches in downstream projects (outside - `third_party/webrtc`). +4. **Downstream Audit (CodeSearch):** For each matured symbol, perform searches + in downstream projects, excluding the WebRTC mirror. - **Reference Check:** Use the `usage:` filter with the fully qualified name (including the `webrtc::` namespace) to find semantic references. - *Example:* @@ -43,13 +42,16 @@ filter to identify if the symbol is overridden in downstream implementations. - *Example:* `cs "func:InsertEmptyPacket -file:stable/webrtc"` - - **Broad Audit (Fallback):** Only use `content:` if semantic filters are - inconclusive, and combine with negative filters to reduce noise. - - *Example:* - `cs "content:InitRandom -file:stable/webrtc -file:test -file:mock"` - - *Note:* A symbol is only a candidate for removal if **all** high-precision - searches return zero results in downstream projects. Skip any symbol found - in active downstream dependencies that are not confirmed mirrors. + - **Broad Audit (Verification):** Even if `usage:` returns zero results, + perform a `content:` search for the symbol name (combining with `webrtc` + and language filters to reduce noise) to verify. This avoids missing usages + due to indexer limitations. + - *Example:* `cs "content:ApplyGain webrtc -file:stable/webrtc lang:cpp"` + - *Note:* A symbol is only a candidate for removal if **all** searches + (including content search) return zero results in downstream projects. Do + not exclude `third_party/webrtc` entirely; only exclude the mirror path + (e.g. `stable/webrtc`), as downstream internal projects may reside in other + subdirectories like `third_party/webrtc/internal`. 5. **Iteration Stop:** Continue the audit process until exactly **10 symbols** have been confirmed to have zero results. Once 10 are found, stop the search. 6. **Documentation:** List the 10 selected symbols, their locations, and their @@ -66,7 +68,9 @@ 2. **Code Removal:** Delete the deprecated declarations and implementation. 3. **Bug Tracking:** If a `TODO` with a bug number was attached to the deprecated function and removed, add that bug number with a `webrtc:` prefix - to the `Bug:` line in the commit message. + to the `Bug:` line in the commit message. If no specific bug is associated + with the removed code, use `Bug: webrtc:42224904` as the default tracking + bug. 4. **Local Build:** Perform a clean build of all major targets (e.g., `rtc_unittests`, `rtc_pc_unittests`, `peerconnection_unittests`). 5. **Verification:** Run the relevant test suites and ensure 100% pass rate.
diff --git a/media/sctp/sctp_transport_internal.h b/media/sctp/sctp_transport_internal.h index 49bdf67..8170aea 100644 --- a/media/sctp/sctp_transport_internal.h +++ b/media/sctp/sctp_transport_internal.h
@@ -47,16 +47,6 @@ // TODO(deadbeef): Support calling Start with different local/remote ports // and create a new association? Not clear if this is something we need to // support though. See: https://github.com/w3c/webrtc-pc/issues/979 - [[deprecated("Call with SctpOptions")]] - virtual bool Start(int local_sctp_port, - int remote_sctp_port, - int max_message_size) { - return Start({ - .local_port = local_sctp_port, - .remote_port = remote_sctp_port, - .max_message_size = max_message_size, - }); - } // NOTE: Initially there was a "Stop" method here, but it was never used, so // it was removed.
diff --git a/modules/rtp_rtcp/source/absolute_capture_time_sender.cc b/modules/rtp_rtcp/source/absolute_capture_time_sender.cc index bf621fe..5f37958 100644 --- a/modules/rtp_rtcp/source/absolute_capture_time_sender.cc +++ b/modules/rtp_rtcp/source/absolute_capture_time_sender.cc
@@ -39,17 +39,6 @@ std::optional<AbsoluteCaptureTime> AbsoluteCaptureTimeSender::OnSendPacket( uint32_t source, uint32_t rtp_timestamp, - uint32_t rtp_clock_frequency, - uint64_t absolute_capture_timestamp, - std::optional<int64_t> estimated_capture_clock_offset) { - return OnSendPacket(source, rtp_timestamp, rtp_clock_frequency, - NtpTime(absolute_capture_timestamp), - estimated_capture_clock_offset, /*force=*/false); -} - -std::optional<AbsoluteCaptureTime> AbsoluteCaptureTimeSender::OnSendPacket( - uint32_t source, - uint32_t rtp_timestamp, int rtp_clock_frequency_hz, NtpTime absolute_capture_time, std::optional<int64_t> estimated_capture_clock_offset,
diff --git a/modules/rtp_rtcp/source/absolute_capture_time_sender.h b/modules/rtp_rtcp/source/absolute_capture_time_sender.h index b7f885f..c907988 100644 --- a/modules/rtp_rtcp/source/absolute_capture_time_sender.h +++ b/modules/rtp_rtcp/source/absolute_capture_time_sender.h
@@ -75,14 +75,6 @@ std::optional<int64_t> estimated_capture_clock_offset, bool force = false); - // Returns a header extension to be sent, or `std::nullopt` if the header - // extension shouldn't be sent. - [[deprecated]] std::optional<AbsoluteCaptureTime> OnSendPacket( - uint32_t source, - uint32_t rtp_timestamp, - uint32_t rtp_clock_frequency, - uint64_t absolute_capture_timestamp, - std::optional<int64_t> estimated_capture_clock_offset); private: bool ShouldSendExtension(
diff --git a/p2p/base/ice_transport_internal.cc b/p2p/base/ice_transport_internal.cc index 000abfd..41a071d 100644 --- a/p2p/base/ice_transport_internal.cc +++ b/p2p/base/ice_transport_internal.cc
@@ -252,11 +252,6 @@ } void IceTransportInternal::SubscribeCandidateGathered( - absl::AnyInvocable<void(IceTransportInternal*, const Candidate&)> - callback) { - candidate_gathered_callbacks_.AddReceiver(std::move(callback)); -} -void IceTransportInternal::SubscribeCandidateGathered( void* tag, absl::AnyInvocable<void(IceTransportInternal*, const Candidate&)> callback) {
diff --git a/p2p/base/ice_transport_internal.h b/p2p/base/ice_transport_internal.h index ef7d1f3..d8c085c 100644 --- a/p2p/base/ice_transport_internal.h +++ b/p2p/base/ice_transport_internal.h
@@ -325,10 +325,6 @@ const Candidate& candidate) { candidate_gathered_callbacks_.Send(transport, candidate); } - [[deprecated("Use SubscribeCandidateGathered(void* tag, ...)")]] - void SubscribeCandidateGathered( - absl::AnyInvocable<void(IceTransportInternal*, const Candidate&)> - callback); void SubscribeCandidateGathered( void* tag,
diff --git a/p2p/base/packet_transport_internal.cc b/p2p/base/packet_transport_internal.cc index 7fbad1c..96318d5 100644 --- a/p2p/base/packet_transport_internal.cc +++ b/p2p/base/packet_transport_internal.cc
@@ -104,11 +104,6 @@ } void PacketTransportInternal::SubscribeReceivingState( - absl::AnyInvocable<void(PacketTransportInternal*)> callback) { - RTC_DCHECK_RUN_ON(&network_checker_); - receiving_state_callbacks_.AddReceiver(std::move(callback)); -} -void PacketTransportInternal::SubscribeReceivingState( void* tag, absl::AnyInvocable<void(PacketTransportInternal*)> callback) { RTC_DCHECK_RUN_ON(&network_checker_);
diff --git a/p2p/base/packet_transport_internal.h b/p2p/base/packet_transport_internal.h index e113d60..b9a9c61 100644 --- a/p2p/base/packet_transport_internal.h +++ b/p2p/base/packet_transport_internal.h
@@ -88,8 +88,6 @@ void NotifyReadyToSend(PacketTransportInternal* packet_transport); // Emitted when receiving state changes to true. - [[deprecated]] void SubscribeReceivingState( - absl::AnyInvocable<void(PacketTransportInternal*)> callback); void SubscribeReceivingState( void* tag, absl::AnyInvocable<void(PacketTransportInternal*)> callback);
diff --git a/p2p/base/port.cc b/p2p/base/port.cc index 0e9eb6e..df34461 100644 --- a/p2p/base/port.cc +++ b/p2p/base/port.cc
@@ -329,7 +329,7 @@ candidate_error_callback_list_.Send(this, event); } -[[deprecated]] void Port::SubscribeCandidateReadyCallback( +void Port::SubscribeCandidateReadyCallback( absl::AnyInvocable<void(Port*, const Candidate&)> callback) { RTC_DCHECK_RUN_ON(thread_); candidate_ready_callback_list_.AddReceiver(std::move(callback));
diff --git a/p2p/base/port_allocator.h b/p2p/base/port_allocator.h index 1351152..3d78fb7 100644 --- a/p2p/base/port_allocator.h +++ b/p2p/base/port_allocator.h
@@ -322,10 +322,6 @@ candidates_removed_callbacks_.Send(session, candidates); } - [[deprecated]] void SubscribeCandidatesAllocationDone( - absl::AnyInvocable<void(PortAllocatorSession*)> callback) { - candidates_allocation_done_callbacks_.AddReceiver(std::move(callback)); - } void SubscribeCandidatesAllocationDone( void* tag, absl::AnyInvocable<void(PortAllocatorSession*)> callback) {
diff --git a/p2p/dtls/dtls_transport.cc b/p2p/dtls/dtls_transport.cc index 57ccb59..fdeed2a 100644 --- a/p2p/dtls/dtls_transport.cc +++ b/p2p/dtls/dtls_transport.cc
@@ -26,7 +26,6 @@ #include "api/dtls_transport_interface.h" #include "api/environment/environment.h" #include "api/ice_transport_interface.h" -#include "api/make_ref_counted.h" #include "api/rtc_error.h" #include "api/rtc_event_log/rtc_event_log.h" #include "api/scoped_refptr.h" @@ -60,14 +59,6 @@ namespace webrtc { namespace { -// Workaround for external dependency. -class SimpleIceTransport : public IceTransportInterface { - public: - explicit SimpleIceTransport(IceTransportInternal* internal) - : internal_(internal) {} - IceTransportInternal* internal() override { return internal_; } - IceTransportInternal* const internal_; -}; HistogramDtlsVersion ToHistogramDtlsVersion(int version_bytes) { switch (version_bytes) { @@ -275,19 +266,6 @@ } } -DtlsTransportInternalImpl::DtlsTransportInternalImpl( - const Environment& env, - IceTransportInternal* ice_transport, - const CryptoOptions& crypto_options, - SSLProtocolVersion max_version, - SslStreamFactory ssl_stream_factory) - : DtlsTransportInternalImpl( - env, - make_ref_counted<SimpleIceTransport>(ice_transport), - crypto_options, - max_version, - ssl_stream_factory) {} - DtlsTransportInternalImpl::~DtlsTransportInternalImpl() { if (dtls_in_stun_) { CompleteDtlsInStun(/*success=*/false);
diff --git a/p2p/dtls/dtls_transport.h b/p2p/dtls/dtls_transport.h index 7c8b86d..559648d 100644 --- a/p2p/dtls/dtls_transport.h +++ b/p2p/dtls/dtls_transport.h
@@ -159,14 +159,6 @@ SSLProtocolVersion max_version = SSL_PROTOCOL_DTLS_12, SslStreamFactory ssl_stream_factory = nullptr); - // This is only here while there is code outside of webrtc that calls it. - [[deprecated("Using internal webrtc code from outside webrtc?")]] - DtlsTransportInternalImpl( - const Environment& env, - IceTransportInternal* ice_transport, - const CryptoOptions& crypto_options, - SSLProtocolVersion max_version = SSL_PROTOCOL_DTLS_12, - SslStreamFactory ssl_stream_factory = nullptr); ~DtlsTransportInternalImpl() override;