This reverts commit 80cb3f6db622442b6360e67851e8903aa0d06d03. Reason for revert: Performance regression on downstream project. Original change's description: > Remove the injectable bitrate allocation strategy API. > > This removes PeerConnectionInterface::SetBitrateAllocationStrategy() > plus a ton of now-dead code. > > Bug: webrtc:10556 > Change-Id: Icfae3bdd011588552934d9db4df16000847db7c3 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133169 > Reviewed-by: Henrik Andreassson <henrika@webrtc.org> > Reviewed-by: Niels Moller <nisse@webrtc.org> > Reviewed-by: Sebastian Jansson <srte@webrtc.org> > Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#28523} TBR=henrika@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,srte@webrtc.org,alexnarest@webrtc.org,jonasolsson@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:10556 Change-Id: Ife905d661e7b1a227662395c729a9336c62fd2d7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145338 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28560}
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.