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