summaryrefslogtreecommitdiffstats
path: root/dbus/property.h
diff options
context:
space:
mode:
authorjpawlowski <jpawlowski@chromium.org>2015-05-11 04:07:04 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-11 11:07:21 +0000
commited276547b74f0110856c7613f9b4ebb05b13cfe5 (patch)
tree38c2583fa08d71aa297d48aa55ea166aef63a204 /dbus/property.h
parent5dd6bb023fc593463c7b28214873495a88116218 (diff)
downloadchromium_src-ed276547b74f0110856c7613f9b4ebb05b13cfe5.zip
chromium_src-ed276547b74f0110856c7613f9b4ebb05b13cfe5.tar.gz
chromium_src-ed276547b74f0110856c7613f9b4ebb05b13cfe5.tar.bz2
Implement invalidation of Dbus properties
BUG=481247 R=armansito@chromium.org Review URL: https://codereview.chromium.org/1086363004 Cr-Commit-Position: refs/heads/master@{#329142}
Diffstat (limited to 'dbus/property.h')
-rw-r--r--dbus/property.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/dbus/property.h b/dbus/property.h
index 419da53..321f4dbd 100644
--- a/dbus/property.h
+++ b/dbus/property.h
@@ -134,7 +134,7 @@ class PropertySet;
// used by PropertySet.
class PropertyBase {
public:
- PropertyBase() : property_set_(NULL) {}
+ PropertyBase() : property_set_(nullptr), is_valid_(false) {}
// Initializes the |property_set| and property |name| so that method
// calls may be made from this class. This method is called by
@@ -156,6 +156,12 @@ class PropertyBase {
// }
const std::string& name() const { return name_; }
+ // Returns true if property is valid, false otherwise.
+ bool is_valid() const { return is_valid_; }
+
+ // Allows to mark Property as valid or invalid.
+ void set_valid(bool is_valid) { is_valid_ = is_valid; }
+
// 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.
@@ -181,6 +187,8 @@ class PropertyBase {
// no ownership is taken and |property_set_| must outlive this class.
PropertySet* property_set_;
+ bool is_valid_;
+
// Name of the property.
std::string name_;
@@ -302,6 +310,10 @@ class CHROME_DBUS_EXPORT PropertySet {
}
private:
+ // Invalidates properties by reading an array of names, from
+ // |message_reader|. Returns false if message is in incorrect format.
+ bool InvalidatePropertiesFromReader(MessageReader* reader);
+
// Pointer to object proxy for making method calls, no ownership is taken
// so this must outlive this class.
ObjectProxy* object_proxy_;