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