tree: 3b06d08b9d7b7d3154b42a837af648de7f147b8b [path history] [tgz]
  1. BUILD.gn
  2. DEPS
  3. OWNERS
  4. README.md
  5. array_view.h
  6. array_view_unittest.cc
  7. async_resolver_factory.h
  8. audio/
  9. audio_codecs/
  10. audio_options.cc
  11. audio_options.h
  12. bitrate_constraints.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.h
  23. dtmf_sender_interface.h
  24. fec_controller.h
  25. ice_transport_factory.cc
  26. ice_transport_factory.h
  27. ice_transport_interface.h
  28. jsep.cc
  29. jsep.h
  30. jsep_ice_candidate.cc
  31. jsep_ice_candidate.h
  32. jsep_session_description.h
  33. media_stream_interface.cc
  34. media_stream_interface.h
  35. media_stream_proxy.h
  36. media_stream_track_proxy.h
  37. media_transport_interface.cc
  38. media_transport_interface.h
  39. media_types.cc
  40. media_types.h
  41. notifier.h
  42. ortc/
  43. peer_connection_factory_proxy.h
  44. peer_connection_interface.cc
  45. peer_connection_interface.h
  46. peer_connection_proxy.h
  47. proxy.cc
  48. proxy.h
  49. ref_counted_base.h
  50. rtc_error.cc
  51. rtc_error.h
  52. rtc_error_unittest.cc
  53. rtc_event_log_output.h
  54. rtp_headers.cc
  55. rtp_headers.h
  56. rtp_parameters.cc
  57. rtp_parameters.h
  58. rtp_parameters_unittest.cc
  59. rtp_receiver_interface.cc
  60. rtp_receiver_interface.h
  61. rtp_sender_interface.cc
  62. rtp_sender_interface.h
  63. rtp_transceiver_interface.cc
  64. rtp_transceiver_interface.h
  65. scoped_refptr.h
  66. set_remote_description_observer_interface.h
  67. stats/
  68. stats_types.cc
  69. stats_types.h
  70. task_queue/
  71. test/
  72. transport/
  73. turn_customizer.h
  74. uma_metrics.h
  75. units/
  76. video/
  77. video_codecs/
  78. 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.