Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1174)

Unified Diff: dbus/property.h

Issue 1368713002: dbus: add support for synchronous PropertySet::Get (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch set 2 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dbus/property.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/property.h
diff --git a/dbus/property.h b/dbus/property.h
index 940ef715d86ba6656a063a99452d1544b58d5668..60aa8e9eb279d7a7a6377c7de7cb7f6bb19b33dc 100644
--- a/dbus/property.h
+++ b/dbus/property.h
@@ -259,6 +259,9 @@ class CHROME_DBUS_EXPORT PropertySet {
virtual void OnGet(PropertyBase* property, GetCallback callback,
Response* response);
+ // The synchronous version of Get().
stevenjb 2015/09/28 20:24:54 I assume this is for use outside of Chrome? I wou
nywang 2015/09/28 20:45:33 Thanks. Yes this is used outside Chrome. It is fo
+ virtual bool GetAndBlock(PropertyBase* property);
+
// Queries the remote object for values of all properties and updates
// initial values. Sub-classes may override to use a different D-Bus
// method, or if the remote object does not support retrieving all
@@ -276,11 +279,12 @@ 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);
+ // The synchronous version of Set().
stevenjb 2015/09/28 20:24:54 We should add a warning here too.
+ virtual bool SetAndBlock(PropertyBase* property);
+
// Update properties by reading an array of dictionary entries, each
// containing a string with the name and a variant with the value, from
// |message_reader|. Returns false if message is in incorrect format.
@@ -382,6 +386,11 @@ class CHROME_DBUS_EXPORT Property : public PropertyBase {
property_set()->Get(this, callback);
}
+ // The synchronous version of Get().
+ virtual bool GetAndBlock() {
+ return property_set()->GetAndBlock(this);
+ }
+
// Requests that the remote object change the property value to |value|,
// |callback| will be called to indicate the success or failure of the
// request, however the new value may not be available depending on the
@@ -391,7 +400,7 @@ class CHROME_DBUS_EXPORT Property : public PropertyBase {
property_set()->Set(this, callback);
}
- // The sychronous version of Set().
+ // The synchronous version of Set().
virtual bool SetAndBlock(const T& value) {
set_value_ = value;
return property_set()->SetAndBlock(this);
« no previous file with comments | « no previous file | dbus/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698