tree: b1b81546b42fae9ec871a40a01708e1c6e195e7f [path history] [tgz]
  1. audio/
  2. auth_policy/
  3. biod/
  4. constants/
  5. cros_healthd/
  6. cryptohome/
  7. cups_proxy/
  8. hammerd/
  9. kerberos/
  10. machine_learning/
  11. media_analytics/
  12. permission_broker/
  13. power/
  14. services/
  15. session_manager/
  16. shill/
  17. system_clock/
  18. upstart/
  19. util/
  20. arc_appfuse_provider_client.cc
  21. arc_appfuse_provider_client.h
  22. arc_camera_client.cc
  23. arc_camera_client.h
  24. arc_keymaster_client.cc
  25. arc_keymaster_client.h
  26. arc_midis_client.cc
  27. arc_midis_client.h
  28. arc_obb_mounter_client.cc
  29. arc_obb_mounter_client.h
  30. arc_oemcrypto_client.cc
  31. arc_oemcrypto_client.h
  32. blocking_method_caller.cc
  33. blocking_method_caller.h
  34. blocking_method_caller_unittest.cc
  35. BUILD.gn
  36. cec_service_client.cc
  37. cec_service_client.h
  38. cec_service_client_unittest.cc
  39. cicerone_client.cc
  40. cicerone_client.h
  41. concierge_client.cc
  42. concierge_client.h
  43. cros_disks_client.cc
  44. cros_disks_client.h
  45. cros_disks_client_unittest.cc
  46. dbus_client.h
  47. dbus_client_implementation_type.h
  48. dbus_clients_browser.cc
  49. dbus_clients_browser.h
  50. dbus_method_call_status.cc
  51. dbus_method_call_status.h
  52. dbus_thread_manager.cc
  53. dbus_thread_manager.h
  54. dbus_thread_manager_unittest.cc
  55. debug_daemon_client.cc
  56. debug_daemon_client.h
  57. DEPS
  58. easy_unlock_client.cc
  59. easy_unlock_client.h
  60. fake_arc_appfuse_provider_client.cc
  61. fake_arc_appfuse_provider_client.h
  62. fake_arc_camera_client.cc
  63. fake_arc_camera_client.h
  64. fake_arc_keymaster_client.cc
  65. fake_arc_keymaster_client.h
  66. fake_arc_midis_client.cc
  67. fake_arc_midis_client.h
  68. fake_arc_obb_mounter_client.cc
  69. fake_arc_obb_mounter_client.h
  70. fake_arc_oemcrypto_client.cc
  71. fake_arc_oemcrypto_client.h
  72. fake_cec_service_client.cc
  73. fake_cec_service_client.h
  74. fake_cicerone_client.cc
  75. fake_cicerone_client.h
  76. fake_concierge_client.cc
  77. fake_concierge_client.h
  78. fake_cros_disks_client.cc
  79. fake_cros_disks_client.h
  80. fake_debug_daemon_client.cc
  81. fake_debug_daemon_client.h
  82. fake_easy_unlock_client.cc
  83. fake_easy_unlock_client.h
  84. fake_easy_unlock_client_unittest.cc
  85. fake_gnubby_client.cc
  86. fake_gnubby_client.h
  87. fake_gnubby_client_unittest.cc
  88. fake_image_burner_client.cc
  89. fake_image_burner_client.h
  90. fake_image_loader_client.cc
  91. fake_image_loader_client.h
  92. fake_lorgnette_manager_client.cc
  93. fake_lorgnette_manager_client.h
  94. fake_oobe_configuration_client.cc
  95. fake_oobe_configuration_client.h
  96. fake_runtime_probe_client.cc
  97. fake_runtime_probe_client.h
  98. fake_seneschal_client.cc
  99. fake_seneschal_client.h
  100. fake_smb_provider_client.cc
  101. fake_smb_provider_client.h
  102. fake_update_engine_client.cc
  103. fake_update_engine_client.h
  104. fake_virtual_file_provider_client.cc
  105. fake_virtual_file_provider_client.h
  106. fake_vm_plugin_dispatcher_client.cc
  107. fake_vm_plugin_dispatcher_client.h
  108. fake_wilco_dtc_supportd_client.cc
  109. fake_wilco_dtc_supportd_client.h
  110. gnubby_client.cc
  111. gnubby_client.h
  112. image_burner_client.cc
  113. image_burner_client.h
  114. image_loader_client.cc
  115. image_loader_client.h
  116. initialize_dbus_client.h
  117. lorgnette_manager_client.cc
  118. lorgnette_manager_client.h
  119. native_timer_unittest.cc
  120. oobe_configuration_client.cc
  121. oobe_configuration_client.h
  122. oobe_configuration_client_unittest.cc
  123. OWNERS
  124. pipe_reader.cc
  125. pipe_reader.h
  126. pipe_reader_unittest.cc
  127. README.md
  128. runtime_probe_client.cc
  129. runtime_probe_client.h
  130. seneschal_client.cc
  131. seneschal_client.h
  132. smb_provider_client.cc
  133. smb_provider_client.h
  134. update_engine_client.cc
  135. update_engine_client.h
  136. update_engine_client_unittest.cc
  137. virtual_file_provider_client.cc
  138. virtual_file_provider_client.h
  139. vm_plugin_dispatcher_client.cc
  140. vm_plugin_dispatcher_client.h
  141. wilco_dtc_supportd_client.cc
  142. wilco_dtc_supportd_client.h
chromeos/dbus/README.md

src/chromeos/dbus

This directory contains client libraries for communication with Chrome OS system service daemons over D-Bus.

For more information, see Chrome OS D-Bus Usage in Chrome.

DBusThreadManager

The DBusThreadManager class was originally created to both own the D-Bus base::Thread, the system dbus::Bus instance, and all of the D-Bus clients.

With the significantly increased number of clients and upcoming Mash effort splitting Chrome and Ash into separate processes, this model no longer makes sense.

New clients should not be added to DBusThreadManager but instead should follow the pattern described below. DBusThreadManager will eventually be deprecated.

D-Bus Client Best Practices

An example of a relatively simple client using existing patterns can be found in src/chromeos/dbus/kerberos.

  • Create a subdirectory under src/chromeos/dbus for new clients or use an existing directory. Do not add new clients to this directory.

  • D-Bus clients should only be accessed by a single process, e.g. Chrome or Ash (preferably Ash), not both. Use a mojo interface to communicate between Chrome and Ash where necessary.

  • D-Bus clients are explicitly initialized and shut down. They provide a static getter for the single global instance. In Chrome, initialization occurs in dbus_helper.cc. In Ash it occurs in ash_service.cc.

  • For new clients, if test methods are required, create a TestInterface in the base class with a virtual GetTestInterface() method and implement it only in the fake (return null in the real implementation). See src/chromeos/dbus/kerberos for an example.

    (Many existing clients provide additional test functionality in the fake implementation, however this complicates tests and the fake implementation).

  • These clients do not have any dependency on FeatureList, and care should be taken regarding initialization order if such dependencies are added (see BluezDBusManager for an example of such client).

Shill clients

Shill clients will eventually only be available to Chrome. As such, the DBusThreadManager::GetShill*Client() methods have been left intact for now. However, the clients are no longer owned by DBusThreadManager so that they can be initialized independently.

New code should prefer Shill*Client::Get() over the DBusThreadManager accessors.

Older clients that have been removed:

  • Amplifier (amplifier_client.cc)
  • Audio DSP (audio_dsp_client.cc)
  • Introspection (introspectable_client.cc)
  • NFC (nfc_manager_client.cc)
  • peerd (peer_daemon_manager_client.cc)
  • privetd (privet_daemon_manager_client.cc)
  • Wi-Fi AP manager (ap_manager_client.cc)