buffet: Add ObjectManager interface to /org/chromium/Buffet
BUG=chromium:359190
TEST=`buffet_client GetManagedObjects` returns
message_type: MESSAGE_METHOD_RETURN
destination: :1.35
sender: :1.31
signature: a{oa{sa{sv}}}
serial: 10
reply_serial: 3
array [
dict entry {
object_path "/org/chromium/Buffet/Manager"
array [
dict entry {
string "org.chromium.Buffet.Manager"
array [
dict entry {
string "State"
variant string "{}"
}
]
}
]
}
]
Done.
Change-Id: I2bbcc9a3f71c7ec6ab76cb4600dad7efe1a8bb0a
Reviewed-on: https://chromium-review.googlesource.com/198963
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Ilja Friedel <ihf@chromium.org>
diff --git a/buffet/exported_property_set.h b/buffet/exported_property_set.h
index 3d7abc5..405ed7d 100644
--- a/buffet/exported_property_set.h
+++ b/buffet/exported_property_set.h
@@ -95,9 +95,10 @@
class ExportedPropertySet {
public:
typedef base::Callback<void(bool success)> OnInitFinish;
+ typedef base::Callback<void(dbus::MessageWriter* writer)> PropertyWriter;
ExportedPropertySet(dbus::Bus* bus, const dbus::ObjectPath& path);
- virtual ~ExportedPropertySet();
+ virtual ~ExportedPropertySet() = default;
// Claims the method associated with the org.freedesktop.DBus.Properties
// interface. This needs to be done after all properties are initialized to
@@ -105,8 +106,11 @@
// are exported to the DBus object. |cb| will be called on the origin
// thread.
void Init(const OnInitFinish& cb);
- base::Callback<void(dbus::MessageWriter* writer)> GetPropertyWriter(
- const std::string& interface);
+
+ // Return a callback that knows how to write this property set's properties
+ // to a message. This writer retains a weak pointer to this, and must
+ // only be invoked on the same thread as the rest of ExportedPropertySet.
+ PropertyWriter GetPropertyWriter(const std::string& interface);
protected:
void RegisterProperty(const std::string& interface_name,