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