webrtc/api/units
Henrik Boström 3710345e71 Allow webrtc::Timestamp to be negative.
Conceptually, a timestamp is just a point in time, expressed as a delta
from some "unspecified epoch". A utility helper class this generic
should not have opinions about which points in time are valid to
reference. The corresponding Chromium timestamps already allow negative.
Given that WebRTC no longer use -1 as magic value for "missing" (we use
std::optional<> these days), we can update webrtc::Timestamp to avoid
this DCHECK_GE when a negative timestamp is created:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/rtc_base/units/unit_base.h;l=98;drc=6c24069ae3996c883ea5d5886d0c013cb78f8394

This aligns the debug builds with the official Chrome builds that run
without DCHECKs enabled, where negative timestamps can sometimes already
happen today without warning.

Importantly this stops chromium.gpu.fyi bots from flaking since they
run with `dchecks_always_on` and canvas streams randomly trigger this,
see https://crbug.com/474311213#comment6.

Bug: webrtc:475251683, chromium:474311213
Change-Id: I3188899332c15c4fdb087889e7e253d37af4ea8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/442002
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46659}
2026-01-13 13:19:58 -08:00
..
BUILD.gn Allow webrtc::Timestamp to be negative. 2026-01-13 13:19:58 -08:00
data_rate_unittest.cc Delete UnitBase::Clamp and Clamped in favor of std::clamp 2025-11-07 06:15:41 -08:00
data_rate.cc Move string_builder.h to webrtc namespace 2025-02-19 06:30:53 -08:00
data_rate.h Add default constructor to relative units types 2024-11-26 17:59:08 +00:00
data_size_unittest.cc Add default constructor to relative units types 2024-11-26 17:59:08 +00:00
data_size.cc Move string_builder.h to webrtc namespace 2025-02-19 06:30:53 -08:00
data_size.h Add default constructor to relative units types 2024-11-26 17:59:08 +00:00
frequency_unittest.cc Delete UnitBase::Clamp and Clamped in favor of std::clamp 2025-11-07 06:15:41 -08:00
frequency.cc Move string_builder.h to webrtc namespace 2025-02-19 06:30:53 -08:00
frequency.h Add default constructor to relative units types 2024-11-26 17:59:08 +00:00
OWNERS
time_delta_unittest.cc Delete UnitBase::Clamp and Clamped in favor of std::clamp 2025-11-07 06:15:41 -08:00
time_delta.cc Move string_builder.h to webrtc namespace 2025-02-19 06:30:53 -08:00
time_delta.h Add default constructor to relative units types 2024-11-26 17:59:08 +00:00
timestamp_unittest.cc Allow webrtc::Timestamp to be negative. 2026-01-13 13:19:58 -08:00
timestamp.cc Move string_builder.h to webrtc namespace 2025-02-19 06:30:53 -08:00
timestamp.h Allow webrtc::Timestamp to be negative. 2026-01-13 13:19:58 -08:00