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