
This reverts commit 385eb9714daa80306d2f92d36678c42892dab555. Reason for revert: Causes problems downstream: # # Fatal error in: rtc_base/units/unit_base.h, line 122 # last system error: 0 # Check failed: value >= 0 (-234 vs. 0) Original change's description: > Represent RtpPacketToSend::capture_time with Timestamp > > Bug: webrtc:13757 > Change-Id: I0ede22cd34e3a59afe1477d8edd495dce64e3242 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252586 > Reviewed-by: Erik Språng <sprang@webrtc.org> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#36083} Bug: webrtc:13757 Change-Id: I8442abd438be8726cf671d0f372d50ecfac6847e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252720 Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36087}
How to write code in the api/
directory
Mostly, just follow the regular style guide, but:
- Note that
api/
code is not exempt from the “.h
and.cc
files come in pairs” rule, so if you declare something inapi/path/to/foo.h
, it should be defined inapi/path/to/foo.cc
. - Headers in
api/
should, if possible, not#include
headers outsideapi/
. It’s not always possible to avoid this, but be aware that it adds to a small mountain of technical debt that we’re trying to shrink. .cc
files inapi/
, on the other hand, are free to#include
headers outsideapi/
.
That is, the preferred way for api/
code to access non-api/
code is to call
it from a .cc
file, so that users of our API headers won’t transitively
#include
non-public headers.
For headers in api/
that need to refer to non-public types, forward
declarations are often a lesser evil than including non-public header files. The
usual rules still apply, though.
.cc
files in api/
should preferably be kept reasonably small. If a
substantial implementation is needed, consider putting it with our non-public
code, and just call it from the api/
.cc
file.