Review abseil-in-webrtc for freshness

Remove mention of absl_deps - it is history already.
Rewrite motiviation of banning absl::Span to be up to date with c++20 state.
Remove motivation of banning absl::Mutex as it likely no longer accurate, and that ban might be re-evaluated.
Ensure allow list matches what is in root DEPS

No-Try: True
Bug: b/363943024, webrtc:342905193
Change-Id: I890a87511bafac7c51355d8f49e0237352eee7b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361302
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42914}
This commit is contained in:
Danil Chapovalov 2024-09-02 18:23:21 +02:00 committed by WebRTC LUCI CQ
parent 86ac1df5ae
commit 04ab497275
3 changed files with 6 additions and 20 deletions

1
DEPS
View File

@ -2457,7 +2457,6 @@ include_rules = [
"+absl/strings/match.h", "+absl/strings/match.h",
"+absl/strings/str_replace.h", "+absl/strings/str_replace.h",
"+absl/strings/string_view.h", "+absl/strings/string_view.h",
"+absl/types/optional.h",
"+absl/types/variant.h", "+absl/types/variant.h",
# Abseil flags are allowed in tests and tools. # Abseil flags are allowed in tests and tools.

View File

@ -1,8 +1,4 @@
specific_include_rules = { specific_include_rules = {
".*\.h": [
"+third_party/absl/types/optional.h",
],
"voip_engine_factory.h": [ "voip_engine_factory.h": [
"+modules/audio_device/include/audio_device.h", "+modules/audio_device/include/audio_device.h",
"+modules/audio_processing/include/audio_processing.h", "+modules/audio_processing/include/audio_processing.h",

View File

@ -1,5 +1,5 @@
<!-- go/cmark --> <!-- go/cmark -->
<!--* freshness: {owner: 'danilchap' reviewed: '2021-05-12'} *--> <!--* freshness: {owner: 'danilchap' reviewed: '2024-09-02'} *-->
# Using Abseil in WebRTC # Using Abseil in WebRTC
@ -22,8 +22,6 @@ The GN templates will take care of generating the proper dependency when
used within Chromium or standalone. In that build mode, WebRTC will depend used within Chromium or standalone. In that build mode, WebRTC will depend
on a monolithic Abseil build target that will generate a shared library. on a monolithic Abseil build target that will generate a shared library.
Previously, `absl_deps` was used but been deprecated in May 2024.
## **Allowed** ## **Allowed**
* `absl::AnyInvocable` * `absl::AnyInvocable`
@ -47,6 +45,8 @@ Previously, `absl_deps` was used but been deprecated in May 2024.
`absl/base/macros.h`. `absl/base/macros.h`.
* `absl/numeric/bits.h` * `absl/numeric/bits.h`
* ABSL_FLAG is allowed in tests and tools, but disallowed in in non-test code.
## **Disallowed** ## **Disallowed**
@ -58,12 +58,6 @@ Previously, `absl_deps` was used but been deprecated in May 2024.
*Use `webrtc::Mutex` instead.* *Use `webrtc::Mutex` instead.*
Chromium has a ban on new static initializers, and `absl::Mutex` uses
one. To make `absl::Mutex` available, we would need to nicely ask the
Abseil team to remove that initializer (like they already did for a
spinlock initializer). Additionally, `absl::Mutex` handles time in a
way that may not be compatible with the rest of WebRTC.
### `absl::optional` ### `absl::optional`
*Use `std::optional` instead.* *Use `std::optional` instead.*
@ -73,12 +67,9 @@ way that may not be compatible with the rest of WebRTC.
*Use `rtc::ArrayView` instead.* *Use `rtc::ArrayView` instead.*
`absl::Span` differs from `rtc::ArrayView` on several points, and both `absl::Span` differs from `rtc::ArrayView` on several points, and both
of them differ from the `std::span` that was voted into of them differ from the `std::span` introduced in C++20. We should just keep
C++20&mdash;and `std::span` is likely to undergo further changes using `rtc::ArrayView` and avoid `absl::Span`. When WebRTC switches to C++20,
before C++20 is finalized. We should just keep using `rtc::ArrayView` we will consider replacing `rtc::ArrayView` with `std::span`.
and avoid `absl::Span` until C++20 is finalized and the Abseil team
has decided if they will change `absl::Span` to match.
[Bug](https://bugs.webrtc.org/9214).
### `absl::StrCat`, `absl::StrAppend`, `absl::StrJoin`, `absl::StrSplit` ### `absl::StrCat`, `absl::StrAppend`, `absl::StrJoin`, `absl::StrSplit`