This reverts commit 74c5b0ac239141606b3c09022088d440941bfe3b. Reason for revert: downstream code adjusted Original change's description: > Revert "Delete legacy DataSize and DataRate factories" > > This reverts commit 70490aa3a0b08c9342ea9a12d5ac1fa9666fb7fb. > > Reason for revert: Breaks downstream project. > > Original change's description: > > Delete legacy DataSize and DataRate factories > > > > Bug: webrtc:9709 > > Change-Id: Ia9464893ec9868c51d72eedaee8efc82b0c17b28 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168722 > > Reviewed-by: Sebastian Jansson <srte@webrtc.org> > > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#30564} > > TBR=danilchap@webrtc.org,srte@webrtc.org > > Change-Id: I3f5a8b4ec473bd2af80ca3acfe0e9c82f25a12ba > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9709 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168940 > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#30574} TBR=danilchap@webrtc.org,mbonadei@webrtc.org,srte@webrtc.org Change-Id: If05a6b2aa3d4c50caac52f50c13ba56c1e2c810d Bug: webrtc:9709 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168960 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30589}
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 “.hand.ccfiles 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#includeheaders 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. .ccfiles inapi/, on the other hand, are free to#includeheaders 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.