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