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