Cleanup: Iterative removal of matured deprecated symbols (Batch 3) This iteration removes 8 deprecated symbols that have been matured for at least 3 months and have zero usage in downstream projects. Summary of removals: 1. VoiceEngineInterface::send_codecs() 2. VoiceEngineInterface::recv_codecs() 3. IvfFileWriter::Wrap(FileWrapper, ...) (2 failures) 6. StunMessage::GetString() 7. PortAllocator::SubscribePortReady 8. PortAllocator::SubscribePortsPruned 9. PortAllocator::SubscribeCandidatesReady 10. PortAllocator::SubscribeCandidateError Also updates GEMINI.md and g3doc/todo/remove_deprecated.md with high-precision CodeSearch filters (usage: and func:) for future audits. Bug: webrtc:465197113 Change-Id: Ie5490e22df06754243c8b8dbf65df78716200fa3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/469660 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47621}
diff --git a/GEMINI.md b/GEMINI.md index 932c4fb..6659e36 100644 --- a/GEMINI.md +++ b/GEMINI.md
@@ -2,9 +2,24 @@ @agents/prompts/common.md +# Searching Downstream + +When auditing symbol usage or finding references in downstream projects, always +prefer high-precision CodeSearch filters over raw text searches: + +- **Semantic References:** Use `usage:webrtc::SymbolName` to find actual + call-sites. +- **Virtual Overrides:** Use `func:MethodName` to find overrides in downstream + implementations. +- **Exclude WebRTC Mirrors:** Always append `-file:stable/webrtc` to focus on + true downstream consumers. + # Codebase knowledge @./g3doc/abseil-in-webrtc.md + @./g3doc/how_to_write_documentation.md + @./g3doc/implementation_basics.md + @./g3doc/style-guide.md
diff --git a/api/transport/stun.h b/api/transport/stun.h index e12b01d..0d581f3 100644 --- a/api/transport/stun.h +++ b/api/transport/stun.h
@@ -555,10 +555,6 @@ // Use this function for values that are not text. std::span<uint8_t> array_view() const { return std::span(bytes_, length()); } - [[deprecated]] std::string GetString() const { - return std::string(reinterpret_cast<const char*>(bytes_), length()); - } - std::optional<std::vector<uint32_t>> GetUInt32Vector() const; void CopyBytes(std::span<const uint8_t> bytes);
diff --git a/g3doc/todo/remove_deprecated.md b/g3doc/todo/remove_deprecated.md index 249bc0a..8cab68f 100644 --- a/g3doc/todo/remove_deprecated.md +++ b/g3doc/todo/remove_deprecated.md
@@ -32,17 +32,24 @@ 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"` - - **Search Optimization:** To minimize false positives with common names - (like `kPlanB` or `local_ssrc`), prioritize searching for qualified usage - (e.g., `cs "content:SdpSemantics::kPlanB"` or `cs "content:::kPlanB"`) or - structural access (e.g., `cs "content:.local_ssrc"`) before performing - broad searches for the bare symbol name. - - *Note:* Pay special attention to virtual methods. If a symbol is overridden - in a downstream project, removing it from the WebRTC base class will break - the downstream build. +4. **Downstream Audit (CodeSearch):** For each matured symbol, perform + high-precision searches in downstream projects (outside + `third_party/webrtc`). + - **Reference Check:** Use the `usage:` filter with the fully qualified name + (including the `webrtc::` namespace) to find semantic references. + - *Example:* + `cs "usage:webrtc::PeerConnectionInterface::kPlanB -file:stable/webrtc"` + - **Override Check (Virtual Methods):** For virtual methods, use the `func:` + 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. 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
diff --git a/media/base/media_engine.h b/media/base/media_engine.h index 67cb1f7..1facc38 100644 --- a/media/base/media_engine.h +++ b/media/base/media_engine.h
@@ -119,12 +119,6 @@ // reassigned. // This function is being moved to CodecVendor // TODO: https://issues.webrtc.org/360058654 - remove when all users updated. - [[deprecated]] inline const std::vector<Codec>& send_codecs() const { - return LegacySendCodecs(); - } - [[deprecated]] inline const std::vector<Codec>& recv_codecs() const { - return LegacyRecvCodecs(); - } virtual const std::vector<Codec>& LegacySendCodecs() const = 0; virtual const std::vector<Codec>& LegacyRecvCodecs() const = 0; @@ -172,23 +166,11 @@ // reassigned. // This functionality is being moved to the CodecVendor class. // TODO: https://issues.webrtc.org/360058654 - deprecate and remove. - [[deprecated]] inline std::vector<Codec> send_codecs() const { - return LegacySendCodecs(); - } - [[deprecated]] inline std::vector<Codec> recv_codecs() const { - return LegacyRecvCodecs(); - } virtual std::vector<Codec> LegacySendCodecs() const = 0; virtual std::vector<Codec> LegacyRecvCodecs() const = 0; // As above, but if include_rtx is false, don't include RTX codecs. - [[deprecated]] inline std::vector<Codec> send_codecs(bool include_rtx) const { - return LegacySendCodecs(include_rtx); - } virtual std::vector<Codec> LegacySendCodecs(bool include_rtx) const = 0; virtual std::vector<Codec> LegacyRecvCodecs(bool include_rtx) const = 0; - [[deprecated]] inline std::vector<Codec> recv_codecs(bool include_rtx) const { - return LegacyRecvCodecs(include_rtx); - } virtual VideoEncoderFactory* encoder_factory() const = 0; virtual VideoDecoderFactory* decoder_factory() const = 0;
diff --git a/modules/video_coding/utility/ivf_file_writer.cc b/modules/video_coding/utility/ivf_file_writer.cc index 5da19fb..46f9c40 100644 --- a/modules/video_coding/utility/ivf_file_writer.cc +++ b/modules/video_coding/utility/ivf_file_writer.cc
@@ -54,12 +54,6 @@ Close(); } -std::unique_ptr<IvfFileWriter> IvfFileWriter::Wrap(FileWrapper file, - size_t byte_limit) { - return std::unique_ptr<IvfFileWriter>( - new IvfFileWriter(std::move(file), byte_limit)); -} - std::unique_ptr<IvfFileWriter> IvfFileWriter::Wrap(absl::string_view filename, size_t byte_limit, int* error /*=nullptr*/) {
diff --git a/modules/video_coding/utility/ivf_file_writer.h b/modules/video_coding/utility/ivf_file_writer.h index f2847ff..3d4d339 100644 --- a/modules/video_coding/utility/ivf_file_writer.h +++ b/modules/video_coding/utility/ivf_file_writer.h
@@ -30,8 +30,6 @@ // Close or ~IvfFileWriter. If writing a frame would take the file above the // `byte_limit` the file will be closed, the write (and all future writes) // will fail. A `byte_limit` of 0 is equivalent to no limit. - [[deprecated]] static std::unique_ptr<IvfFileWriter> Wrap(FileWrapper file, - size_t byte_limit); static std::unique_ptr<IvfFileWriter> Wrap(absl::string_view filename, size_t byte_limit, int* error = nullptr);
diff --git a/p2p/base/port_allocator.cc b/p2p/base/port_allocator.cc index 0713e7f..d400c0e 100644 --- a/p2p/base/port_allocator.cc +++ b/p2p/base/port_allocator.cc
@@ -338,11 +338,6 @@ } void PortAllocatorSession::SubscribePortReady( - absl::AnyInvocable<void(PortAllocatorSession*, PortInterface*)> callback) { - port_ready_callbacks_.AddReceiver(std::move(callback)); -} - -void PortAllocatorSession::SubscribePortReady( void* tag, absl::AnyInvocable<void(PortAllocatorSession*, PortInterface*)> callback) { port_ready_callbacks_.AddReceiver(tag, std::move(callback));
diff --git a/p2p/base/port_allocator.h b/p2p/base/port_allocator.h index 6eb699e..ca3c8cd 100644 --- a/p2p/base/port_allocator.h +++ b/p2p/base/port_allocator.h
@@ -265,9 +265,6 @@ // destroyed if no connection is using them. virtual void PruneAllPorts() {} - // This function has to be non-inlined due to usage in Chrome. - [[deprecated]] void SubscribePortReady( - absl::AnyInvocable<void(PortAllocatorSession*, PortInterface*)> callback); void SubscribePortReady( void* tag, absl::AnyInvocable<void(PortAllocatorSession*, PortInterface*)> callback); @@ -279,11 +276,6 @@ // interface is down, or because there is no connection on the interface), // or when TURN ports are pruned because a higher-priority TURN port becomes // ready(pairable). - [[deprecated]] void SubscribePortsPruned( - absl::AnyInvocable<void(PortAllocatorSession*, - const std::vector<PortInterface*>&)> callback) { - ports_pruned_callbacks_.AddReceiver(std::move(callback)); - } void SubscribePortsPruned( void* tag, absl::AnyInvocable<void(PortAllocatorSession*, @@ -295,11 +287,6 @@ ports_pruned_callbacks_.Send(session, ports); } - [[deprecated]] void SubscribeCandidatesReady( - absl::AnyInvocable<void(PortAllocatorSession*, - const std::vector<Candidate>&)> callback) { - candidates_ready_callbacks_.AddReceiver(std::move(callback)); - } void SubscribeCandidatesReady( void* tag, absl::AnyInvocable<void(PortAllocatorSession*, @@ -311,11 +298,6 @@ candidates_ready_callbacks_.Send(session, candidates); } - [[deprecated]] void SubscribeCandidateError( - absl::AnyInvocable<void(PortAllocatorSession*, - const IceCandidateErrorEvent&)> callback) { - candidate_error_callbacks_.AddReceiver(std::move(callback)); - } void SubscribeCandidateError( void* tag, absl::AnyInvocable<void(PortAllocatorSession*, @@ -343,6 +325,7 @@ const std::vector<Candidate>& candidates) { candidates_removed_callbacks_.Send(session, candidates); } + [[deprecated]] void SubscribeCandidatesAllocationDone( absl::AnyInvocable<void(PortAllocatorSession*)> callback) { candidates_allocation_done_callbacks_.AddReceiver(std::move(callback));