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