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