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

Unified Diff: dbus/property.h

Issue 10823301: bluetooth: Create stub manager, adapter and device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 4 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 | « chromeos/dbus/bluetooth_node_client.cc ('k') | 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 a3fb5ca76e0c5de85f1ad865615c6c1590a92975..2d98b74496db2b5a5ca5b890c870042d785e11ae 100644
--- a/dbus/property.h
+++ b/dbus/property.h
@@ -38,7 +38,7 @@
// dbus::Property<std::vector<std::string> > children;
//
// Properties(dbus::ObjectProxy* object_proxy,
-// PropertyChangedCallback callback)
+// const PropertyChangedCallback callback)
// : dbus::PropertySet(object_proxy, "com.example.DBus", callback) {
// RegisterProperty("Name", &name);
// RegisterProperty("Version", &version);
@@ -164,6 +164,11 @@ class PropertyBase {
// Implementation provided by specialization.
virtual void AppendSetValueToWriter(MessageWriter* writer) = 0;
+ // Method used by test and stub implementations of dbus::PropertySet::Set
+ // to replace the property value with the set value without using a
+ // dbus::MessageReader.
+ virtual void ReplaceValueWithSetValue() = 0;
+
protected:
// Retrieves the associated property set.
PropertySet* property_set() { return property_set_; }
@@ -203,7 +208,7 @@ class PropertySet {
// |property_changed_callback| specifies the callback for when properties
// are changed, this may be a NULL callback.
PropertySet(ObjectProxy* object_proxy, const std::string& interface,
- PropertyChangedCallback property_changed_callback);
+ const PropertyChangedCallback& property_changed_callback);
// Destructor; we don't hold on to any references or memory that needs
// explicit clean-up, but clang thinks we might.
@@ -377,6 +382,15 @@ class Property : public PropertyBase {
// Implementation provided by specialization.
virtual void AppendSetValueToWriter(MessageWriter* writer);
+ // Method used by test and stub implementations of dbus::PropertySet::Set
+ // to replace the property value with the set value without using a
+ // dbus::MessageReader.
+ virtual void ReplaceValueWithSetValue() { value_ = set_value_; }
+
+ // Method used by test and stub implementations to directly set the
+ // value of a property.
+ void ReplaceValue(const T& value) { value_ = value; }
+
private:
// Current cached value of the property.
T value_;
« no previous file with comments | « chromeos/dbus/bluetooth_node_client.cc ('k') | dbus/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698