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