tree: 5a5a3c68b65ce0558e6b66522c79ee31f5bfbb70 [path history] [tgz]
  1. bind_utils.h
  2. diagnosticsd_core.cc
  3. diagnosticsd_core.h
  4. diagnosticsd_core_delegate_impl.cc
  5. diagnosticsd_core_delegate_impl.h
  6. diagnosticsd_core_test.cc
  7. diagnosticsd_daemon.cc
  8. diagnosticsd_daemon.h
  9. diagnosticsd_dbus_service.cc
  10. diagnosticsd_dbus_service.h
  11. diagnosticsd_dbus_service_test.cc
  12. diagnosticsd_ec_event_service.cc
  13. diagnosticsd_ec_event_service.h
  14. diagnosticsd_ec_event_service_test.cc
  15. diagnosticsd_grpc_service.cc
  16. diagnosticsd_grpc_service.h
  17. diagnosticsd_grpc_service_test.cc
  18. diagnosticsd_mojo_service.cc
  19. diagnosticsd_mojo_service.h
  20. diagnosticsd_mojo_service_test.cc
  21. ec_constants.cc
  22. ec_constants.h
  23. ec_constants_test.cc
  24. fake_browser.cc
  25. fake_browser.h
  26. fake_diagnostics_processor.cc
  27. fake_diagnostics_processor.h
  28. file_test_utils.cc
  29. file_test_utils.h
  30. json_utils.cc
  31. json_utils.h
  32. main.cc
  33. mock_mojom_diagnosticsd_client.cc
  34. mock_mojom_diagnosticsd_client.h
  35. mojo_test_utils.cc
  36. mojo_test_utils.h
  37. mojo_utils.cc
  38. mojo_utils.h
  39. mojo_utils_test.cc
  40. protobuf_test_utils.h
  41. README.md
diagnostics/diagnosticsd/README.md

diagnosticsd daemon

Please see ../README.md for general information.

IPC mechanisms

This daemon uses three IPC mechanisms:

  • gRPC - for talking to the diagnostics_processor daemon.
  • Mojo - for talking to the browser.
  • D-Bus - for receiving Mojo bootstrap requests from the browser.

Class structure

`DiagnosticsdDaemon`
 ^
 |
 v
`DiagnosticsdCore`
 ^
 |
 |   // gRPC-related members:
 +-> `DiagnosticsdGrpcService`
 |       (handles incoming gRPC requests)
 +-> `AsyncGrpcServer<grpc_api::Diagnosticsd>`
 |       (connects `DiagnosticsdGrpcService` with the actual gRPC
 |        pipe)
 +-> `AsyncGrpcClient<grpc_api::DiagnosticsProcessor>`
 |       (sends outgoing gRPC requests through the actual gRPC pipe)
 |
 |   // Mojo-related members:
 +-> `DiagnosticsdMojoService`
 |       (handles incoming Mojo requests and sends outgoing ones)
 +-> `mojo::Binding<mojom::DiagnosticsdService>`
 |       (connects `DiagnosticsdMojoService` with the actual Mojo
 |        pipe)
 |
 |   // D-Bus-related members:
 +-> `DiagnosticsdDBusService`
 |       (handles incoming D-Bus requests)
 +-> `brillo::dbus_utils::DBusObject`
         (connects `DiagnosticsdDBusService` with the actual D-Bus
          pipe)

Classes are generally organized such that they don't know about their owners or siblings in this graph. Instead, these classes are parameterized with delegate(s), which implement these cross-class calls. This allows to test each individual piece of logic separately.