Chrome Release Bot (LUCI) 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
..
common 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
config 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
constants 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
dlcservice 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
dlp 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
init 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
machine_learning 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
missive 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
permission_broker 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
power 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
tpm_manager 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
u2f 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
BUILD.gn 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
COMMON_METADATA 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
DEPS 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
DIR_METADATA 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
OWNERS 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
README.md 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
blocking_method_caller_unittest.cc 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
native_timer_unittest.cc 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago
pipe_reader_unittest.cc 4762b62e7d Publish DEPS for 106.0.5249.13 1 year ago

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, this model no longer makes sense.

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

D-Bus Client Best Practices

An example of a relatively simple client using existing patterns can be found in src/chromeos/ash/components/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 are explicitly initialized and shut down. They provide a static getter for the single global instance. In Ash Chrome, initialization occurs in ash_dbus_helper.cc. In Lacros Chrome, initialization occurs in lacros_dbus_helper.cc.

  • Be careful when providing access to multiple processes (e.g. Ash Chrome and Lacros Chrome). Not all of the underlying daemons support multiple clients.

  • 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/ash/components/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).

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)