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}