Cleanup: Remove 4 matured deprecated symbols with zero external usage This CL removes the first batch of deprecated symbols from the WebRTC API and internal headers. All removed symbols have zero confirmed external usage in google3 and have been deprecated for at least 3 months. This iteration successfully retires 5 matured symbols with verified zero usage across WebRTC, google3, Chromium, and WebKit: * Candidate::ToSanitizedCopy (2-arg variant) * VideoFrame::Builder::set_capture_time_identifier * RtcEventLogFactory (1-arg constructor) * VideoQualityAnalyzerInterface::OnFrameDropped (2-arg variant) Bug: webrtc:9725, webrtc:467444018 Change-Id: Ia4399107863db9f5866590a89ef290a94884b79e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/466383 Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47558}
diff --git a/api/candidate.cc b/api/candidate.cc index ce93116..f32dfad 100644 --- a/api/candidate.cc +++ b/api/candidate.cc
@@ -501,11 +501,6 @@ } Candidate Candidate::ToSanitizedCopy(bool use_hostname_address, - bool filter_related_address) const { - return ToSanitizedCopy(use_hostname_address, filter_related_address, false); -} - -Candidate Candidate::ToSanitizedCopy(bool use_hostname_address, bool filter_related_address, bool filter_ufrag) const { Candidate copy(*this);
diff --git a/api/candidate.h b/api/candidate.h index 8ae100d..4a8f3a3 100644 --- a/api/candidate.h +++ b/api/candidate.h
@@ -243,9 +243,6 @@ // candidate. // The username fragment may be filtered, e.g. for prflx candidates before // any remote ice parameters have been set. - [[deprecated("Use variant with filter_ufrag")]] Candidate ToSanitizedCopy( - bool use_hostname_address, - bool filter_related_address) const; Candidate ToSanitizedCopy(bool use_hostname_address, bool filter_related_address, bool filter_ufrag) const;
diff --git a/api/rtc_event_log/rtc_event_log_factory.h b/api/rtc_event_log/rtc_event_log_factory.h index c00821b..016b89a 100644 --- a/api/rtc_event_log/rtc_event_log_factory.h +++ b/api/rtc_event_log/rtc_event_log_factory.h
@@ -17,7 +17,6 @@ #include "api/environment/environment.h" #include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log_factory_interface.h" -#include "api/task_queue/task_queue_factory.h" #include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -25,10 +24,6 @@ class RTC_EXPORT RtcEventLogFactory : public RtcEventLogFactoryInterface { public: RtcEventLogFactory() = default; - - [[deprecated("Use default constructor")]] // - explicit RtcEventLogFactory(TaskQueueFactory* /* task_queue_factory */) {} - ~RtcEventLogFactory() override = default; absl_nonnull std::unique_ptr<RtcEventLog> Create(
diff --git a/api/test/mock_dtmf_sender.h b/api/test/mock_dtmf_sender.h index 7351ecd..f51ead7 100644 --- a/api/test/mock_dtmf_sender.h +++ b/api/test/mock_dtmf_sender.h
@@ -26,9 +26,8 @@ public: MOCK_METHOD(void, OnToneChange, - (const std::string&, const std::string&), + (const std::string& tone, const std::string& tone_buffer), (override)); - MOCK_METHOD(void, OnToneChange, (const std::string&), (override)); }; static_assert(!std::is_abstract_v<MockDtmfSenderObserver>, "");
diff --git a/api/video/video_frame.cc b/api/video/video_frame.cc index ec97aff..3910912 100644 --- a/api/video/video_frame.cc +++ b/api/video/video_frame.cc
@@ -197,12 +197,6 @@ return *this; } -VideoFrame::Builder& VideoFrame::Builder::set_capture_time_identifier( - const std::optional<Timestamp>& presentation_timestamp) { - presentation_timestamp_ = presentation_timestamp; - return *this; -} - VideoFrame::Builder& VideoFrame::Builder::set_presentation_timestamp( const std::optional<Timestamp>& presentation_timestamp) { presentation_timestamp_ = presentation_timestamp;
diff --git a/api/video/video_frame.h b/api/video/video_frame.h index 268d5e7..5ea2868 100644 --- a/api/video/video_frame.h +++ b/api/video/video_frame.h
@@ -109,9 +109,6 @@ const scoped_refptr<VideoFrameBuffer>& buffer); Builder& set_timestamp_ms(int64_t timestamp_ms); Builder& set_timestamp_us(int64_t timestamp_us); - [[deprecated("Use set_presentation_timestamp instead")]] Builder& - set_capture_time_identifier( - const std::optional<Timestamp>& presentation_timestamp); Builder& set_presentation_timestamp( const std::optional<Timestamp>& presentation_timestamp); Builder& set_reference_time(const std::optional<Timestamp>& reference_time);
diff --git a/g3doc/todo/remove_deprecated.md b/g3doc/todo/remove_deprecated.md new file mode 100644 index 0000000..dd52c2f --- /dev/null +++ b/g3doc/todo/remove_deprecated.md
@@ -0,0 +1,76 @@ +<!-- go/cmark --> + +<!--* freshness: {owner: 'hta' reviewed: '2026-04-24'} *--> + +# Plan: Iterative Removal of Deprecated Symbols + +This document outlines the iterative process for identifying and removing +deprecated symbols from the WebRTC codebase. The goal is to safely retire old +APIs that have zero footprint in internal and external downstream projects. + +## Removal Criteria + +A symbol is a candidate for removal only if it meets **all** of the following: + +1. **Zero Usage:** No references found in WebRTC internals or downstream + projects. Chromium/WebKit. +2. **Maturity:** The `[[deprecated]]` tag was added at least **3 months** ago. +3. **Batch Size:** No more than **10 symbols** are processed in a single + iteration. + +______________________________________________________________________ + +## Phase 1: Candidate Identification (Iterative) + +Perform the following steps to generate a list of exactly 10 candidates for the +current removal cycle: + +1. **Discovery:** Search the entire WebRTC codebase (excluding `third_party/`) + for the `[[deprecated]]` attribute. +2. **Age Verification:** Use `git blame` on the identified lines. Discard any + symbols where the deprecation tag was added less than 3 months ago. +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 broad + searches in downstream projects (outside `third_party/webrtc`). + - **External Usage:** `cs "content:<SymbolName> -file:stable/webrtc"` + - **Chromium Overrides:** + `cs "content:<SymbolName> file:chromium -file:third_party/webrtc"` + - *Note:* Pay special attention to virtual methods. If a symbol is overridden + in Chromium (e.g., in Blink's `RTCDTMFSenderHandler`), removing it from the + WebRTC base class will break the Chromium build. +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 + modern equivalents. + +______________________________________________________________________ + +## Phase 2: Execution and Validation + +For the 10 selected candidates: + +1. **Test Migration:** Update any internal WebRTC unit tests or regression tests + that still use the deprecated symbol. +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. +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. +6. **Gerrit Upload:** Submit the changes for review. The CL description should + not contain any information about downstream projects. + +______________________________________________________________________ + +## Phase 3: High-Usage Coordination + +Symbols that return non-zero usage in downstream projects must not be removed +using this process. Instead: + +1. Identify the owner of the consuming code. +2. File a bug against the consuming team referencing the WebRTC deprecation. +3. Wait for the consuming team to migrate before moving the symbol to Phase 1 in + a future iteration.
diff --git a/pc/dtmf_sender_unittest.cc b/pc/dtmf_sender_unittest.cc index 7e4063c..7c81ebc 100644 --- a/pc/dtmf_sender_unittest.cc +++ b/pc/dtmf_sender_unittest.cc
@@ -41,12 +41,6 @@ FakeDtmfObserver() : completed_(false) {} // Implements DtmfSenderObserverInterface. - void OnToneChange(const std::string& tone) override { - tones_from_single_argument_callback_.push_back(tone); - if (tone.empty()) { - completed_ = true; - } - } void OnToneChange(const std::string& tone, const std::string& tone_buffer) override { tones_.push_back(tone); @@ -58,17 +52,13 @@ // getters const std::vector<std::string>& tones() const { return tones_; } - const std::vector<std::string>& tones_from_single_argument_callback() const { - return tones_from_single_argument_callback_; - } std::string tones_remaining() { return tones_remaining_; } bool completed() const { return completed_; } private: - std::vector<std::string> tones_; - std::vector<std::string> tones_from_single_argument_callback_; - std::string tones_remaining_; bool completed_; + std::vector<std::string> tones_; + std::string tones_remaining_; }; class FakeDtmfProvider : public DtmfProviderInterface {
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc index 3a5803a..87646be 100644 --- a/pc/peer_connection_integrationtest.cc +++ b/pc/peer_connection_integrationtest.cc
@@ -312,7 +312,8 @@ DummyDtmfObserver() : completed_(false) {} // Implements DtmfSenderObserverInterface. - void OnToneChange(const std::string& tone) override { + void OnToneChange(const std::string& tone, + const std::string& /* tone_buffer */) override { tones_.push_back(tone); if (tone.empty()) { completed_ = true;
diff --git a/pc/slow_peer_connection_integration_test.cc b/pc/slow_peer_connection_integration_test.cc index 4a7114c..2db0e5a 100644 --- a/pc/slow_peer_connection_integration_test.cc +++ b/pc/slow_peer_connection_integration_test.cc
@@ -112,7 +112,8 @@ DummyDtmfObserver() : completed_(false) {} // Implements DtmfSenderObserverInterface. - void OnToneChange(const std::string& tone) override { + void OnToneChange(const std::string& tone, + const std::string& /* tone_buffer */) override { tones_.push_back(tone); if (tone.empty()) { completed_ = true;