diff options
author | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-15 04:21:08 +0000 |
---|---|---|
committer | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-15 04:21:08 +0000 |
commit | cf910da2d3cb23ac300968212dc8a196a64b2726 (patch) | |
tree | b7975c349ab6aeccee275e630b2ece900000d387 /dbus/dbus.gyp | |
parent | c401049c2ed235c156292b632f43198c44641b65 (diff) | |
download | chromium_src-cf910da2d3cb23ac300968212dc8a196a64b2726.zip chromium_src-cf910da2d3cb23ac300968212dc8a196a64b2726.tar.gz chromium_src-cf910da2d3cb23ac300968212dc8a196a64b2726.tar.bz2 |
dbus: add Property handling for clients
D-Bus properties can be tricky to handle due to their reliance on variants,
and since they use a common interface, result in a lot of copy and paste
code to deal with.
Add an API that simplifies matters somewhat; detailed documentation is in
dbus/property.h, but fundamentally you add a struct Properties to the client
implementation derived from dbus::PropertySet, and in it declare members of
dbus::Property<property type> and connect them in the constructor with
RegisterProperty(name, ptr).
The API works on two levels, from a higher-level each member of the structure
is a type-safe way to obtain the current value of the property, update the
value, and set a new value.
From the lower-level, it uses a generic reader/writer based interface so that
the parent structure's GetAll and signal handling methods can update the
values without requiring knowledge of the contained type.
BUG=chromium:109194
TEST=unit tests included in CL
change-Id: I111b9e60a2c6c35edd9e0ea9f6976928c6c6474b
Review URL: http://codereview.chromium.org/9380053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/dbus.gyp')
-rw-r--r-- | dbus/dbus.gyp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dbus/dbus.gyp b/dbus/dbus.gyp index 8a3cb22..296ac53 100644 --- a/dbus/dbus.gyp +++ b/dbus/dbus.gyp @@ -29,6 +29,8 @@ 'object_path.h', 'object_proxy.cc', 'object_proxy.h', + 'property.cc', + 'property.h', 'scoped_dbus_error.h', ], }, @@ -83,6 +85,7 @@ 'end_to_end_sync_unittest.cc', 'message_unittest.cc', 'mock_unittest.cc', + 'property_unittest.cc', 'test_service.cc', 'test_service.h', ], |