chromeos-dbus-bindings: Redesign due to underlying DBusObject change.

DBusObject method handlers have been changed to allow for async
method handlers. D-Bus proxy generator is changing accordingly
to reflect the underlying implementation change.

Now it is possible to generate asyc-ready method handlers by
adding annotations to the method elements in the source XML file.
With the "org.chromium.DBus.Method.Kind" attribute on a method
description element, you can now control which of the four
supported method handers are to be used:

- "normal" (default): the handler signature is as follows:

  bool Handler(ErrorPtr* error, const Type1& in1, const Type2& in2, ...
               Type3* out1, Type4* out2, ...);

- "simple": the handler does not fail and hence does not return
  any error information. One of the following two signatures:

  RetType Handler(const Type1& in1, const Type2& in2, ...);
  void Handler(const Type1& in1, const Type2& in2, ...,
               Type3* out1, Type4* out2, ...);

- "async": is a possibly asynchronous method handler:

  void Handler(scoped_ptr<DBusMethodResponse> response,
               const Type1& in1, const Type2& in2, ...);

- "raw": the fully custom specialty handler that allows
  raw implementation of D-Bus method with no additional framework:

  void Handler(dbus::MethodCall* method_call, ResponseSender sender);

As part of this change, it was also possible to provide implementations
for methods returning more than one value.

A method element can also specify that the method handler can be
marked as 'const' in the C++ adapter by adding the following attribute
with the value of "true": "org.chromium.DBus.Method.Const"

Another significant change to the D-Bus binding generator is the
support of multiple interfaces per D-Bus object. Now the XML file
can list multiple <interface> tags for a class node. This makes the
generator to create the abstract C++ interface adaptors that contain
protorypes for all the methods, signals and properties for that interface.

The final interface implementation class derives from one or more adaptor(s)
and implements the actual interface methods.

Finally, updated lorgnette to use the new generated adaptor for its
D-Bus interfaces.

BUG=chromium:419271, chromium:420925, chromium:428390
TEST=FEATURES=test emerge-link chromeos-dbus-bindings

Change-Id: I02d1fc2e21a230e0f4c959c54ed7c71490945b12
Reviewed-on: https://chromium-review.googlesource.com/227281
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
16 files changed
tree: 66f335624af7de6436aaac780bd40dce477ebbde
  1. chromeos-dbus-bindings/