
This is a reland of 1a290e4495c8132e7ff2c44d78de5e1d7eefdb9e after fixing the downstream projects. Original change's description: > Remove old-style OnFailure callbacks > > Also delete default implementation of new-style OnFailure, > since it can't call the deprecated function. > > Deprecating the old-style OnFailure callback turned out to be impossible, > since one can't have the new-style callback call the old-style one. > > Bug: chromium:589455 > Change-Id: Icf529ddb02d99ad9e205095d5a1fbeb0da91dd0e > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146219 > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > Commit-Queue: Harald Alvestrand <hta@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#30570} Bug: chromium:589455 Change-Id: I7227e3c6886c504043b019b621e45658cbd6fd53 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168941 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30583}
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.