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