tree: 4bc552d2269e30acb22463a9e35ad08768d1fa41 [path history] [tgz]
  1. adaptation/
  2. audio/
  3. audio_codecs/
  4. call/
  5. crypto/
  6. neteq/
  7. rtc_event_log/
  8. stats/
  9. task_queue/
  10. test/
  11. transport/
  12. units/
  13. video/
  14. video_codecs/
  15. voip/
  16. array_view.h
  17. array_view_unittest.cc
  18. async_resolver_factory.h
  19. audio_options.cc
  20. audio_options.h
  21. BUILD.gn
  22. candidate.cc
  23. candidate.h
  24. create_peerconnection_factory.cc
  25. create_peerconnection_factory.h
  26. crypto_params.h
  27. data_channel_interface.cc
  28. data_channel_interface.h
  29. DEPS
  30. DESIGN.md
  31. dtls_transport_interface.cc
  32. dtls_transport_interface.h
  33. dtmf_sender_interface.h
  34. fec_controller.h
  35. fec_controller_override.h
  36. frame_transformer_interface.h
  37. function_view.h
  38. function_view_unittest.cc
  39. ice_transport_factory.cc
  40. ice_transport_factory.h
  41. ice_transport_interface.h
  42. jsep.cc
  43. jsep.h
  44. jsep_ice_candidate.cc
  45. jsep_ice_candidate.h
  46. jsep_session_description.h
  47. media_stream_interface.cc
  48. media_stream_interface.h
  49. media_stream_proxy.h
  50. media_stream_track_proxy.h
  51. media_types.cc
  52. media_types.h
  53. network_state_predictor.h
  54. notifier.h
  55. OWNERS
  56. packet_socket_factory.h
  57. peer_connection_factory_proxy.h
  58. peer_connection_interface.cc
  59. peer_connection_interface.h
  60. peer_connection_proxy.h
  61. priority.h
  62. proxy.cc
  63. proxy.h
  64. README.md
  65. ref_counted_base.h
  66. rtc_error.cc
  67. rtc_error.h
  68. rtc_error_unittest.cc
  69. rtc_event_log_output.h
  70. rtc_event_log_output_file.cc
  71. rtc_event_log_output_file.h
  72. rtc_event_log_output_file_unittest.cc
  73. rtp_headers.cc
  74. rtp_headers.h
  75. rtp_packet_info.cc
  76. rtp_packet_info.h
  77. rtp_packet_info_unittest.cc
  78. rtp_packet_infos.h
  79. rtp_packet_infos_unittest.cc
  80. rtp_parameters.cc
  81. rtp_parameters.h
  82. rtp_parameters_unittest.cc
  83. rtp_receiver_interface.cc
  84. rtp_receiver_interface.h
  85. rtp_sender_interface.cc
  86. rtp_sender_interface.h
  87. rtp_transceiver_direction.h
  88. rtp_transceiver_interface.cc
  89. rtp_transceiver_interface.h
  90. scoped_refptr.h
  91. scoped_refptr_unittest.cc
  92. sctp_transport_interface.cc
  93. sctp_transport_interface.h
  94. set_local_description_observer_interface.h
  95. set_remote_description_observer_interface.h
  96. stats_types.cc
  97. stats_types.h
  98. turn_customizer.h
  99. uma_metrics.h
  100. 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.