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

Unified Diff: dbus/property.h

Issue 893663002: Enhance the DBus interface for peerd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix minor nits Created 5 years, 10 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/peer_daemon_manager_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 ea893dc6b9dcd595ab8db4451aaf1a0f162016eb..419da53dcb5e41f34da83e9646dfb1c832c12e50 100644
--- a/dbus/property.h
+++ b/dbus/property.h
@@ -7,6 +7,8 @@
#include <map>
#include <string>
+#include <utility>
+#include <vector>
#include "base/basictypes.h"
#include "base/bind.h"
@@ -158,7 +160,7 @@ class PropertyBase {
// no knowledge of the contained type is required, this method returns
// true if its expected type was found, false if not.
// Implementation provided by specialization.
- virtual bool PopValueFromReader(MessageReader*) = 0;
+ virtual bool PopValueFromReader(MessageReader* reader) = 0;
// Method used by PropertySet to append the set value to a MessageWriter,
// no knowledge of the contained type is required.
@@ -229,7 +231,7 @@ class CHROME_DBUS_EXPORT PropertySet {
// Methods connected by ConnectSignals() and called by dbus:: when
// a property is changed. Sub-classes may override if the property
// changed signal provides different arguments.
- virtual void ChangedReceived(Signal*);
+ virtual void ChangedReceived(Signal* signal);
virtual void ChangedConnected(const std::string& interface_name,
const std::string& signal_name,
bool success);
@@ -376,7 +378,7 @@ class CHROME_DBUS_EXPORT Property : public PropertyBase {
// 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.
- bool PopValueFromReader(MessageReader*) override;
+ bool PopValueFromReader(MessageReader* reader) override;
// Method used by PropertySet to append the set value to a MessageWriter,
// no knowledge of the contained type is required.
@@ -398,6 +400,10 @@ class CHROME_DBUS_EXPORT Property : public PropertyBase {
property_set()->NotifyPropertyChanged(name());
}
+ // Method used by test and stub implementations to directly set the
+ // |set_value_| of a property.
+ void ReplaceSetValueForTesting(const T& value) { set_value_ = value; }
+
private:
// Current cached value of the property.
T value_;
@@ -485,6 +491,23 @@ template <> void Property<std::vector<uint8> >::AppendSetValueToWriter(
MessageWriter* writer);
extern template class Property<std::vector<uint8> >;
+template <>
+bool Property<std::map<std::string, std::string>>::PopValueFromReader(
+ MessageReader* reader);
+template <>
+void Property<std::map<std::string, std::string>>::AppendSetValueToWriter(
+ MessageWriter* writer);
+extern template class Property<std::map<std::string, std::string>>;
+
+template <>
+bool Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>::
+ PopValueFromReader(MessageReader* reader);
+template <>
+void Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>::
+ AppendSetValueToWriter(MessageWriter* writer);
+extern template class Property<
+ std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>;
+
} // namespace dbus
#endif // DBUS_PROPERTY_H_
« no previous file with comments | « chromeos/dbus/peer_daemon_manager_client.cc ('k') | dbus/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698