tree: 0ca68633593fb9e5a4d117a69be0c14326794b39 [path history] [tgz]
  1. audio/
  2. audio_codecs/
  3. call/
  4. crypto/
  5. ortc/
  6. stats/
  7. task_queue/
  8. test/
  9. transport/
  10. units/
  11. video/
  12. video_codecs/
  13. array_view.h
  14. array_view_unittest.cc
  15. async_resolver_factory.h
  16. audio_options.cc
  17. audio_options.h
  18. bitrate_constraints.h
  19. BUILD.gn
  20. candidate.cc
  21. candidate.h
  22. create_peerconnection_factory.cc
  23. create_peerconnection_factory.h
  24. crypto_params.h
  25. data_channel_interface.cc
  26. data_channel_interface.h
  27. DEPS
  28. dtls_transport_interface.h
  29. dtmf_sender_interface.h
  30. fec_controller.h
  31. ice_transport_factory.cc
  32. ice_transport_factory.h
  33. ice_transport_interface.h
  34. jsep.cc
  35. jsep.h
  36. jsep_ice_candidate.cc
  37. jsep_ice_candidate.h
  38. jsep_session_description.h
  39. media_constraints_interface.cc
  40. media_constraints_interface.h
  41. media_stream_interface.cc
  42. media_stream_interface.h
  43. media_stream_proxy.h
  44. media_stream_track_proxy.h
  45. media_transport_interface.cc
  46. media_transport_interface.h
  47. media_types.cc
  48. media_types.h
  49. notifier.h
  50. OWNERS
  51. peer_connection_factory_proxy.h
  52. peer_connection_interface.cc
  53. peer_connection_interface.h
  54. peer_connection_proxy.h
  55. proxy.cc
  56. proxy.h
  57. README.md
  58. ref_counted_base.h
  59. rtc_error.cc
  60. rtc_error.h
  61. rtc_error_unittest.cc
  62. rtc_event_log_output.h
  63. rtp_headers.cc
  64. rtp_headers.h
  65. rtp_parameters.cc
  66. rtp_parameters.h
  67. rtp_parameters_unittest.cc
  68. rtp_receiver_interface.cc
  69. rtp_receiver_interface.h
  70. rtp_sender_interface.cc
  71. rtp_sender_interface.h
  72. rtp_transceiver_interface.cc
  73. rtp_transceiver_interface.h
  74. scoped_refptr.h
  75. set_remote_description_observer_interface.h
  76. stats_types.cc
  77. stats_types.h
  78. turn_customizer.h
  79. uma_metrics.h
  80. video_track_source_proxy.h
api/README.md

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 in api/path/to/foo.h, it should be defined in api/path/to/foo.cc.
  • Headers in api/ should, if possible, not #include headers outside api/. 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 in api/, on the other hand, are free to #include headers outside api/.

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.