From aaaeb29ef54828cce3f6aab4d718487640235ab5 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Thu, 31 Oct 2024 13:49:39 +0000 Subject: [PATCH] Allow single-argument StrCat and modify DEPS files accordingly. This is done in support of the decision to encourage AbslStringify. Bug: None Change-Id: I26fee77978d1dd21be6d2ef011c4dfd78a7b43e0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367204 Reviewed-by: Danil Chapovalov Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#43338} --- DEPS | 1 + api/DEPS | 4 ---- g3doc/abseil-in-webrtc.md | 5 +++++ media/DEPS | 3 --- rtc_base/DEPS | 5 ----- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index 62fa520a76..40366ea35e 100644 --- a/DEPS +++ b/DEPS @@ -2125,6 +2125,7 @@ include_rules = [ "+absl/strings/ascii.h", "+absl/strings/escaping.h", "+absl/strings/match.h", + "+absl/strings/str_cat.h", # note - allowed for single argument version only "+absl/strings/str_replace.h", "+absl/strings/string_view.h", "+absl/types/variant.h", diff --git a/api/DEPS b/api/DEPS index 93774f09ec..a03410297b 100644 --- a/api/DEPS +++ b/api/DEPS @@ -261,8 +261,4 @@ specific_include_rules = { "+video", "+third_party", ], - - "jsep_unittest\.cc": [ - "+absl/strings/str_cat.h", - ] } diff --git a/g3doc/abseil-in-webrtc.md b/g3doc/abseil-in-webrtc.md index 7798f24b21..66edbb8ac0 100644 --- a/g3doc/abseil-in-webrtc.md +++ b/g3doc/abseil-in-webrtc.md @@ -44,6 +44,7 @@ on a monolithic Abseil build target that will generate a shared library. * The macros in `absl/base/attributes.h`, `absl/base/config.h` and `absl/base/macros.h`. * `absl/numeric/bits.h` +* Single argument absl::StrCat * ABSL_FLAG is allowed in tests and tools, but disallowed in in non-test code. @@ -78,3 +79,7 @@ we will consider replacing `rtc::ArrayView` with `std::span`. These are optimized for speed, not binary size. Even `StrCat` calls with a modest number of arguments can easily add several hundred bytes to the binary. + +Exception: Single-argument absl::StrCat is allowed in order to make it +easy to use AbslStringify. See [TOTW #2015](https://abseil.io/tips/215) for +details on AbslStringify. diff --git a/media/DEPS b/media/DEPS index 12cad68da6..663bf7feef 100644 --- a/media/DEPS +++ b/media/DEPS @@ -40,7 +40,4 @@ specific_include_rules = { ".*codec\.h": [ "+absl/strings/str_format.h", ], - ".*codec_unittest\.cc": [ - "+absl/strings/str_cat.h", - ], } diff --git a/rtc_base/DEPS b/rtc_base/DEPS index a0ac9d6553..a936a22468 100644 --- a/rtc_base/DEPS +++ b/rtc_base/DEPS @@ -8,10 +8,6 @@ include_rules = [ specific_include_rules = { "checks.h": [ "+absl/strings/has_absl_stringify.h", - "+absl/strings/str_cat.h", - ], - "string_encode.h": [ - "+absl/strings/str_cat.h" ], "protobuf_utils.h": [ "+third_party/protobuf", @@ -27,7 +23,6 @@ specific_include_rules = { ], "logging.h": [ "+absl/strings/has_absl_stringify.h", - "+absl/strings/str_cat.h", ], "trace_event\.h": [ "+third_party/perfetto",