libchromeos: Add D-Bus Property class that handles any data type
libchrome's D-Bus library provides dbus::Property<T> class in
<dbus/property.h> header file for implementing D-Bus property support
in object proxies. Unfortunately it provides specializations only for
a limited number of data types, such as basic D-Bus types (int, string,
bool, etc.) as well as just a few common arrays: std::vector<std::string>,
std::vector<dbus::ObjectPath>, std::vector<uint8>. None of the
other array types, STUCTs or DICTs are supported.
It is very difficult to add generic specializations to Property<T>
for other array and map types, as well as tuple<> for STRUCT data.
As a work-around, re-implement only the top-level Property<T> on
libchromeos side using its extensive data serialization framework.
The code in chromeos/dbus_dbus_property.h is almost the 1-for-1 copy
of that from <dbus/property.h> except for additional implementaion
of PopValueFromReader and AppendSetValueToWriter.
Also updated buffet with using the new class and therefore removed
the specialization of Property for VariantDictionary type.
command_property_set.cc is left empty for now and will be removed
completely in a follow-up CL when D-Bus proxy generator adds support
for D-Bus properties.
BUG=chromium:431737
TEST=FEATURES=test emerge-link libchromeos buffet
Change-Id: I06659fd6569898275fa2d16cd643ceda9058ffc2
Reviewed-on: https://chromium-review.googlesource.com/231995
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Anton Muhin <antonm@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
3 files changed
tree: 053b833efd72fbcce53cc0992ab10f6e1eca2ccc
- buffet/