This reverts commit 7f1c58938db72b1508e383d94a0e59dd70ff306e. Reason for revert: this has been temporarily postponed. Original change's description: > Adding new top-level directory crypto/ > > Adding the crypto root directory to WebRTC. The goal with this change is to > centralize the management of crypto code into a single location. > > Currently we have cryptography code scattered across pc/ and rtc_base/ > which makes it difficult audit and maintain. > > By having a crypto/ directory we gain: > 1. A clear first point of contact for auditing the cryptography in WebRTC. > 2. Fine grain ownership to cryptography maintainers, we can include BoringSSL > maintainers in this directory. > 3. It improves maintanability of crypto code as we have improved modularization. > It will not be deeply nested in all different parts of WebRTC. > 4. Improved testability. We can cleanly build crypto libraries which plug into > pc/ which we can more easily mock. > 5. Enforce stricter rules. For example we may want to enforce ZeroOnFreeBuffer > for all sensitive material. This is easier to enforce in a single directory. > > Bug: webrtc:9600 > Change-Id: I8e76332c7dcdac0a45a470ba2e930196e1ccf395 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125142 > Commit-Queue: Benjamin Wright <benwright@webrtc.org> > Reviewed-by: Niels Moller <nisse@webrtc.org> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#27028} TBR=steveanton@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,benwright@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:9600 Change-Id: I3c99e733d53d76071179f0ff9ffdec965d20829d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147871 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Benjamin Wright <benwright@webrtc.org> Commit-Queue: Benjamin Wright <benwright@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28750}
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.