tree: f292b9e5690af38391ddb95fdd0ad29c41665d6f [path history] [tgz]
  1. audio/
  2. audio_codecs/
  3. call/
  4. crypto/
  5. rtc_event_log/
  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. BUILD.gn
  19. candidate.cc
  20. candidate.h
  21. create_peerconnection_factory.cc
  22. create_peerconnection_factory.h
  23. crypto_params.h
  24. data_channel_interface.cc
  25. data_channel_interface.h
  26. DEPS
  27. DESIGN.md
  28. dtls_transport_interface.cc
  29. dtls_transport_interface.h
  30. dtmf_sender_interface.h
  31. fec_controller.h
  32. fec_controller_override.h
  33. function_view.h
  34. function_view_unittest.cc
  35. ice_transport_factory.cc
  36. ice_transport_factory.h
  37. ice_transport_interface.h
  38. jsep.cc
  39. jsep.h
  40. jsep_ice_candidate.cc
  41. jsep_ice_candidate.h
  42. jsep_session_description.h
  43. media_stream_interface.cc
  44. media_stream_interface.h
  45. media_stream_proxy.h
  46. media_stream_track_proxy.h
  47. media_types.cc
  48. media_types.h
  49. network_state_predictor.h
  50. notifier.h
  51. OWNERS
  52. packet_socket_factory.h
  53. peer_connection_factory_proxy.h
  54. peer_connection_interface.cc
  55. peer_connection_interface.h
  56. peer_connection_proxy.h
  57. proxy.cc
  58. proxy.h
  59. README.md
  60. ref_counted_base.h
  61. rtc_error.cc
  62. rtc_error.h
  63. rtc_error_unittest.cc
  64. rtc_event_log_output.h
  65. rtc_event_log_output_file.cc
  66. rtc_event_log_output_file.h
  67. rtc_event_log_output_file_unittest.cc
  68. rtp_headers.cc
  69. rtp_headers.h
  70. rtp_packet_info.cc
  71. rtp_packet_info.h
  72. rtp_packet_info_unittest.cc
  73. rtp_packet_infos.h
  74. rtp_packet_infos_unittest.cc
  75. rtp_parameters.cc
  76. rtp_parameters.h
  77. rtp_parameters_unittest.cc
  78. rtp_receiver_interface.cc
  79. rtp_receiver_interface.h
  80. rtp_sender_interface.cc
  81. rtp_sender_interface.h
  82. rtp_transceiver_interface.cc
  83. rtp_transceiver_interface.h
  84. scoped_refptr.h
  85. sctp_transport_interface.cc
  86. sctp_transport_interface.h
  87. set_remote_description_observer_interface.h
  88. stats_types.cc
  89. stats_types.h
  90. turn_customizer.h
  91. uma_metrics.h
  92. 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.