summaryrefslogtreecommitdiff
path: root/dbus/property.h
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2015-09-17 11:02:03 -0700
committerNingyuan Wang <nywang@google.com>2015-09-23 12:32:47 -0700
commit1735db4f0706ec871937968301e26474db940856 (patch)
tree1e55c26676861d863f2f239952714e944c20a554 /dbus/property.h
parent75fbd09f094bc4fd8f2dda82807792a9dfb6729d (diff)
downloadlibchrome-1735db4f0706ec871937968301e26474db940856.tar.gz
libchrome: UPSTREAM: add support for synchronous PropertySet::Set to dbus
Upstram cl: https://codereview.chromium.org/1361503003/ The existing PropertySet::Set function is asynchronous. This CL adds the synchronous version of PropertySet::Set. It is defined as PropertySet::SetAndBlock. Bug: 24131409 TEST=run tests on a veyron_jaq chromebook Change-Id: Idceebeaf05e7480371286ebfa0c72222298f1d46
Diffstat (limited to 'dbus/property.h')
-rw-r--r--dbus/property.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/dbus/property.h b/dbus/property.h
index 5f36d69fde..f03f027b30 100644
--- a/dbus/property.h
+++ b/dbus/property.h
@@ -276,6 +276,10 @@ class CHROME_DBUS_EXPORT PropertySet {
// depending on the remote object. This method may be overridden by
// sub-classes if interfaces use different method calls.
virtual void Set(PropertyBase* property, SetCallback callback);
+
+ // The sychronous version of Set().
+ virtual bool SetAndBlock(PropertyBase* property);
+
virtual void OnSet(PropertyBase* property, SetCallback callback,
Response* response);
@@ -389,6 +393,12 @@ class CHROME_DBUS_EXPORT Property : public PropertyBase {
property_set()->Set(this, callback);
}
+ // The sychronous version of Set().
+ virtual bool SetAndBlock(const T& value) {
+ set_value_ = value;
+ return property_set()->SetAndBlock(this);
+ }
+
// Method used by PropertySet to retrieve the value from a MessageReader,
// no knowledge of the contained type is required, this method returns
// true if its expected type was found, false if not.