summaryrefslogtreecommitdiffstats
path: root/dbus/property.cc
Commit message (Collapse)AuthorAgeFilesLines
* READABILITY for Keybukkeybuk@chromium.org2012-03-221-5/+2
| | | | | | | | | | | | BUG=none TEST=dbus_unittests & emerge chromeos-chrome change-Id: I111b9e60a2c6c35edd9e0ea9f6976928c6c6474b Review URL: http://codereview.chromium.org/9407019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128286 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: clear array values before reading from variantkeybuk@google.com2012-03-211-0/+2
| | | | | | | | | | | | | | | | | | PopArrayFromVariant() appends values to the existing value, rather than clearing first like I expected, so using this without clear() first means the property value accumulates all values and never loses them. BUG=none TEST=unit test included Change-Id: Ie392a89190f4ad8570a905f24b2f446e1f2bed81 R=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/9809001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128108 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: slight cleanup to Property codekeybuk@chromium.org2012-02-171-3/+0
| | | | | | | | | | | | | | | | | | | | | Correct comments based on practice that worked best for the bluetooth adapter and device clients, in particular adding the virtual destructor to the struct and cleaning up the return values of GetObject() in the documentation. Drop VLOG() calls, there's no need to debug at this level, you can use dbus-monitor to see the incoming and outgoing calls to Chromium and can add logging in upper layers when there are real values to log. BUG=none TEST=built on try bots Change-Id: I2ac6b55e288626b5f9cd843935887e261d386dec Review URL: http://codereview.chromium.org/9418035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122522 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add Property handling for clientskeybuk@chromium.org2012-02-151-0/+425
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