keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef DBUS_PROPERTY_H_ |
| 6 | #define DBUS_PROPERTY_H_ |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 7 | |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 10 | #include <map> |
| 11 | #include <string> |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 12 | #include <utility> |
| 13 | #include <vector> |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 14 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 15 | #include "base/bind.h" |
| 16 | #include "base/callback.h" |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 17 | #include "base/macros.h" |
tfarina@chromium.org | 7928ea2 | 2012-11-05 10:56:14 +0900 | [diff] [blame] | 18 | #include "dbus/dbus_export.h" |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 19 | #include "dbus/message.h" |
| 20 | #include "dbus/object_proxy.h" |
| 21 | |
| 22 | // D-Bus objects frequently provide sets of properties accessed via a |
| 23 | // standard interface of method calls and signals to obtain the current value, |
| 24 | // set a new value and be notified of changes to the value. Unfortunately this |
| 25 | // interface makes heavy use of variants and dictionaries of variants. The |
| 26 | // classes defined here make dealing with properties in a type-safe manner |
| 27 | // possible. |
| 28 | // |
| 29 | // Client implementation classes should define a Properties structure, deriving |
| 30 | // from the PropertySet class defined here. This structure should contain a |
| 31 | // member for each property defined as an instance of the Property<> class, |
| 32 | // specifying the type to the template. Finally the structure should chain up |
| 33 | // to the PropertySet constructor, and then call RegisterProperty() for each |
| 34 | // property defined to associate them with their string name. |
| 35 | // |
| 36 | // Example: |
| 37 | // class ExampleClient { |
| 38 | // public: |
| 39 | // struct Properties : public dbus::PropertySet { |
| 40 | // dbus::Property<std::string> name; |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 41 | // dbus::Property<uint16_t> version; |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 42 | // dbus::Property<dbus::ObjectPath> parent; |
| 43 | // dbus::Property<std::vector<std::string> > children; |
| 44 | // |
| 45 | // Properties(dbus::ObjectProxy* object_proxy, |
keybuk@chromium.org | b45e529 | 2012-08-15 10:03:30 +0900 | [diff] [blame] | 46 | // const PropertyChangedCallback callback) |
keybuk@chromium.org | f63debc | 2012-02-18 01:50:42 +0900 | [diff] [blame] | 47 | // : dbus::PropertySet(object_proxy, "com.example.DBus", callback) { |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 48 | // RegisterProperty("Name", &name); |
| 49 | // RegisterProperty("Version", &version); |
| 50 | // RegisterProperty("Parent", &parent); |
| 51 | // RegisterProperty("Children", &children); |
| 52 | // } |
keybuk@chromium.org | f63debc | 2012-02-18 01:50:42 +0900 | [diff] [blame] | 53 | // virtual ~Properties() {} |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 54 | // }; |
| 55 | // |
| 56 | // The Properties structure requires a pointer to the object proxy of the |
| 57 | // actual object to track, and after construction should have signals |
| 58 | // connected to that object and initial values set by calling ConnectSignals() |
| 59 | // and GetAll(). The structure should not outlive the object proxy, so it |
| 60 | // is recommended that the lifecycle of both be managed together. |
| 61 | // |
| 62 | // Example (continued): |
| 63 | // |
keybuk@chromium.org | f63debc | 2012-02-18 01:50:42 +0900 | [diff] [blame] | 64 | // typedef std::map<std::pair<dbus::ObjectProxy*, Properties*> > Object; |
| 65 | // typedef std::map<dbus::ObjectPath, Object> ObjectMap; |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 66 | // ObjectMap object_map_; |
| 67 | // |
| 68 | // dbus::ObjectProxy* GetObjectProxy(const dbus::ObjectPath& object_path) { |
| 69 | // return GetObject(object_path).first; |
| 70 | // } |
| 71 | // |
| 72 | // Properties* GetProperties(const dbus::ObjectPath& object_path) { |
| 73 | // return GetObject(object_path).second; |
| 74 | // } |
| 75 | // |
| 76 | // Object GetObject(const dbus::ObjectPath& object_path) { |
| 77 | // ObjectMap::iterator it = object_map_.find(object_path); |
| 78 | // if (it != object_map_.end()) |
| 79 | // return it->second; |
| 80 | // |
| 81 | // dbus::ObjectProxy* object_proxy = bus->GetObjectProxy(...); |
keybuk@chromium.org | f63debc | 2012-02-18 01:50:42 +0900 | [diff] [blame] | 82 | // // connect signals, etc. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 83 | // |
| 84 | // Properties* properties = new Properties( |
| 85 | // object_proxy, |
| 86 | // base::Bind(&PropertyChanged, |
| 87 | // weak_ptr_factory_.GetWeakPtr(), |
| 88 | // object_path)); |
| 89 | // properties->ConnectSignals(); |
| 90 | // properties->GetAll(); |
| 91 | // |
keybuk@chromium.org | f63debc | 2012-02-18 01:50:42 +0900 | [diff] [blame] | 92 | // Object object = std::make_pair(object_proxy, properties); |
| 93 | // object_map_[object_path] = object; |
| 94 | // return object; |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 95 | // } |
| 96 | // }; |
| 97 | // |
| 98 | // This now allows code using the client implementation to access properties |
| 99 | // in a type-safe manner, and assuming the PropertyChanged callback is |
| 100 | // propogated up to observers, be notified of changes. A typical access of |
| 101 | // the current value of the name property would be: |
| 102 | // |
| 103 | // ExampleClient::Properties* p = example_client->GetProperties(object_path); |
| 104 | // std::string name = p->name.value(); |
| 105 | // |
| 106 | // Normally these values are updated from signals emitted by the remote object, |
| 107 | // in case an explicit round-trip is needed to obtain the current value, the |
| 108 | // Get() method can be used and indicates whether or not the value update was |
| 109 | // successful. The updated value can be obtained in the callback using the |
| 110 | // value() method. |
| 111 | // |
| 112 | // p->children.Get(base::Bind(&OnGetChildren)); |
| 113 | // |
| 114 | // A new value can be set using the Set() method, the callback indicates |
| 115 | // success only; it is up to the remote object when (and indeed if) it updates |
| 116 | // the property value, and whether it emits a signal or a Get() call is |
| 117 | // required to obtain it. |
| 118 | // |
| 119 | // p->version.Set(20, base::Bind(&OnSetVersion)) |
| 120 | |
| 121 | namespace dbus { |
| 122 | |
| 123 | // D-Bus Properties interface constants, declared here rather than |
| 124 | // in property.cc because template methods use them. |
| 125 | const char kPropertiesInterface[] = "org.freedesktop.DBus.Properties"; |
| 126 | const char kPropertiesGetAll[] = "GetAll"; |
| 127 | const char kPropertiesGet[] = "Get"; |
| 128 | const char kPropertiesSet[] = "Set"; |
| 129 | const char kPropertiesChanged[] = "PropertiesChanged"; |
| 130 | |
| 131 | class PropertySet; |
| 132 | |
| 133 | // PropertyBase is an abstract base-class consisting of the parts of |
| 134 | // the Property<> template that are not type-specific, such as the |
| 135 | // associated PropertySet, property name, and the type-unsafe parts |
| 136 | // used by PropertySet. |
derat | 3f868a4 | 2015-07-17 00:06:44 +0900 | [diff] [blame] | 137 | class CHROME_DBUS_EXPORT PropertyBase { |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 138 | public: |
derat | 3f868a4 | 2015-07-17 00:06:44 +0900 | [diff] [blame] | 139 | PropertyBase(); |
| 140 | virtual ~PropertyBase(); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 141 | |
| 142 | // Initializes the |property_set| and property |name| so that method |
| 143 | // calls may be made from this class. This method is called by |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 144 | // PropertySet::RegisterProperty() passing |this| for |property_set| so |
| 145 | // there should be no need to call it directly. If you do beware that |
| 146 | // no ownership or reference to |property_set| is taken so that object |
| 147 | // must outlive this one. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 148 | void Init(PropertySet* property_set, const std::string& name); |
| 149 | |
| 150 | // Retrieves the name of this property, this may be useful in observers |
| 151 | // to avoid specifying the name in more than once place, e.g. |
| 152 | // |
| 153 | // void Client::PropertyChanged(const dbus::ObjectPath& object_path, |
| 154 | // const std::string &property_name) { |
| 155 | // Properties& properties = GetProperties(object_path); |
| 156 | // if (property_name == properties.version.name()) { |
| 157 | // // Handle version property changing |
| 158 | // } |
| 159 | // } |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 160 | const std::string& name() const { return name_; } |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 161 | |
jpawlowski | 77e73fc | 2015-05-11 20:07:04 +0900 | [diff] [blame] | 162 | // Returns true if property is valid, false otherwise. |
| 163 | bool is_valid() const { return is_valid_; } |
| 164 | |
| 165 | // Allows to mark Property as valid or invalid. |
| 166 | void set_valid(bool is_valid) { is_valid_ = is_valid; } |
| 167 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 168 | // Method used by PropertySet to retrieve the value from a MessageReader, |
| 169 | // no knowledge of the contained type is required, this method returns |
| 170 | // true if its expected type was found, false if not. |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 171 | // Implementation provided by specialization. |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 172 | virtual bool PopValueFromReader(MessageReader* reader) = 0; |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 173 | |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 174 | // Method used by PropertySet to append the set value to a MessageWriter, |
| 175 | // no knowledge of the contained type is required. |
| 176 | // Implementation provided by specialization. |
| 177 | virtual void AppendSetValueToWriter(MessageWriter* writer) = 0; |
| 178 | |
keybuk@chromium.org | b45e529 | 2012-08-15 10:03:30 +0900 | [diff] [blame] | 179 | // Method used by test and stub implementations of dbus::PropertySet::Set |
| 180 | // to replace the property value with the set value without using a |
| 181 | // dbus::MessageReader. |
| 182 | virtual void ReplaceValueWithSetValue() = 0; |
| 183 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 184 | protected: |
| 185 | // Retrieves the associated property set. |
| 186 | PropertySet* property_set() { return property_set_; } |
| 187 | |
| 188 | private: |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 189 | // Pointer to the PropertySet instance that this instance is a member of, |
| 190 | // no ownership is taken and |property_set_| must outlive this class. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 191 | PropertySet* property_set_; |
| 192 | |
jpawlowski | 77e73fc | 2015-05-11 20:07:04 +0900 | [diff] [blame] | 193 | bool is_valid_; |
| 194 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 195 | // Name of the property. |
| 196 | std::string name_; |
| 197 | |
| 198 | DISALLOW_COPY_AND_ASSIGN(PropertyBase); |
| 199 | }; |
| 200 | |
| 201 | // PropertySet groups a collection of properties for a remote object |
| 202 | // together into a single structure, fixing their types and name such |
| 203 | // that calls made through it are type-safe. |
| 204 | // |
| 205 | // Clients always sub-class this to add the properties, and should always |
| 206 | // provide a constructor that chains up to this and then calls |
| 207 | // RegisterProperty() for each property defined. |
| 208 | // |
| 209 | // After creation, client code should call ConnectSignals() and most likely |
| 210 | // GetAll() to seed initial values and update as changes occur. |
tfarina@chromium.org | 7928ea2 | 2012-11-05 10:56:14 +0900 | [diff] [blame] | 211 | class CHROME_DBUS_EXPORT PropertySet { |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 212 | public: |
| 213 | // Callback for changes to cached values of properties, either notified |
| 214 | // via signal, or as a result of calls to Get() and GetAll(). The |name| |
| 215 | // argument specifies the name of the property changed. |
| 216 | typedef base::Callback<void(const std::string& name)> PropertyChangedCallback; |
| 217 | |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 218 | // Constructs a property set, where |object_proxy| specifies the proxy for |
| 219 | // the/ remote object that these properties are for, care should be taken to |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 220 | // ensure that this object does not outlive the lifetime of the proxy; |
| 221 | // |interface| specifies the D-Bus interface of these properties, and |
| 222 | // |property_changed_callback| specifies the callback for when properties |
| 223 | // are changed, this may be a NULL callback. |
| 224 | PropertySet(ObjectProxy* object_proxy, const std::string& interface, |
keybuk@chromium.org | b45e529 | 2012-08-15 10:03:30 +0900 | [diff] [blame] | 225 | const PropertyChangedCallback& property_changed_callback); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 226 | |
| 227 | // Destructor; we don't hold on to any references or memory that needs |
| 228 | // explicit clean-up, but clang thinks we might. |
keybuk@chromium.org | 82e082a | 2012-02-17 10:01:18 +0900 | [diff] [blame] | 229 | virtual ~PropertySet(); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 230 | |
| 231 | // Registers a property, generally called from the subclass constructor; |
| 232 | // pass the |name| of the property as used in method calls and signals, |
| 233 | // and the pointer to the |property| member of the structure. This will |
| 234 | // call the PropertyBase::Init method. |
| 235 | void RegisterProperty(const std::string& name, PropertyBase* property); |
| 236 | |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 237 | // Connects property change notification signals to the object, generally |
| 238 | // called immediately after the object is created and before calls to other |
| 239 | // methods. Sub-classes may override to use different D-Bus signals. |
| 240 | virtual void ConnectSignals(); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 241 | |
| 242 | // Methods connected by ConnectSignals() and called by dbus:: when |
| 243 | // a property is changed. Sub-classes may override if the property |
| 244 | // changed signal provides different arguments. |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 245 | virtual void ChangedReceived(Signal* signal); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 246 | virtual void ChangedConnected(const std::string& interface_name, |
| 247 | const std::string& signal_name, |
| 248 | bool success); |
| 249 | |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 250 | // Callback for Get() method, |success| indicates whether or not the |
| 251 | // value could be retrived, if true the new value can be obtained by |
| 252 | // calling value() on the property. |
| 253 | typedef base::Callback<void(bool success)> GetCallback; |
| 254 | |
| 255 | // Requests an updated value from the remote object for |property| |
| 256 | // incurring a round-trip. |callback| will be called when the new |
| 257 | // value is available. This may not be implemented by some interfaces, |
| 258 | // and may be overriden by sub-classes if interfaces use different |
| 259 | // method calls. |
| 260 | virtual void Get(PropertyBase* property, GetCallback callback); |
| 261 | virtual void OnGet(PropertyBase* property, GetCallback callback, |
| 262 | Response* response); |
| 263 | |
nywang | 80f2716 | 2015-09-29 07:46:36 +0900 | [diff] [blame] | 264 | // The synchronous version of Get(). |
| 265 | // This should never be used on an interactive thread. |
| 266 | virtual bool GetAndBlock(PropertyBase* property); |
| 267 | |
keybuk@chromium.org | f63debc | 2012-02-18 01:50:42 +0900 | [diff] [blame] | 268 | // Queries the remote object for values of all properties and updates |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 269 | // initial values. Sub-classes may override to use a different D-Bus |
| 270 | // method, or if the remote object does not support retrieving all |
| 271 | // properties, either ignore or obtain each property value individually. |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 272 | virtual void GetAll(); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 273 | virtual void OnGetAll(Response* response); |
| 274 | |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 275 | // Callback for Set() method, |success| indicates whether or not the |
| 276 | // new property value was accepted by the remote object. |
| 277 | typedef base::Callback<void(bool success)> SetCallback; |
| 278 | |
| 279 | // Requests that the remote object for |property| change the property to |
| 280 | // its new value. |callback| will be called to indicate the success or |
| 281 | // failure of the request, however the new value may not be available |
| 282 | // depending on the remote object. This method may be overridden by |
| 283 | // sub-classes if interfaces use different method calls. |
| 284 | virtual void Set(PropertyBase* property, SetCallback callback); |
| 285 | virtual void OnSet(PropertyBase* property, SetCallback callback, |
| 286 | Response* response); |
| 287 | |
nywang | 80f2716 | 2015-09-29 07:46:36 +0900 | [diff] [blame] | 288 | // The synchronous version of Set(). |
| 289 | // This should never be used on an interactive thread. |
| 290 | virtual bool SetAndBlock(PropertyBase* property); |
| 291 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 292 | // Update properties by reading an array of dictionary entries, each |
| 293 | // containing a string with the name and a variant with the value, from |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 294 | // |message_reader|. Returns false if message is in incorrect format. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 295 | bool UpdatePropertiesFromReader(MessageReader* reader); |
| 296 | |
| 297 | // Updates a single property by reading a string with the name and a |
| 298 | // variant with the value from |message_reader|. Returns false if message |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 299 | // is in incorrect format, or property type doesn't match. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 300 | bool UpdatePropertyFromReader(MessageReader* reader); |
| 301 | |
| 302 | // Calls the property changed callback passed to the constructor, used |
| 303 | // by sub-classes that do not call UpdatePropertiesFromReader() or |
| 304 | // UpdatePropertyFromReader(). Takes the |name| of the changed property. |
| 305 | void NotifyPropertyChanged(const std::string& name); |
| 306 | |
| 307 | // Retrieves the object proxy this property set was initialized with, |
| 308 | // provided for sub-classes overriding methods that make D-Bus calls |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 309 | // and for Property<>. Not permitted with const references to this class. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 310 | ObjectProxy* object_proxy() { return object_proxy_; } |
| 311 | |
| 312 | // Retrieves the interface of this property set. |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 313 | const std::string& interface() const { return interface_; } |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 314 | |
| 315 | protected: |
| 316 | // Get a weak pointer to this property set, provided so that sub-classes |
| 317 | // overriding methods that make D-Bus calls may use the existing (or |
| 318 | // override) callbacks without providing their own weak pointer factory. |
| 319 | base::WeakPtr<PropertySet> GetWeakPtr() { |
| 320 | return weak_ptr_factory_.GetWeakPtr(); |
| 321 | } |
| 322 | |
| 323 | private: |
jpawlowski | 77e73fc | 2015-05-11 20:07:04 +0900 | [diff] [blame] | 324 | // Invalidates properties by reading an array of names, from |
| 325 | // |message_reader|. Returns false if message is in incorrect format. |
| 326 | bool InvalidatePropertiesFromReader(MessageReader* reader); |
| 327 | |
keybuk@chromium.org | 683dd8c | 2012-03-23 05:34:05 +0900 | [diff] [blame] | 328 | // Pointer to object proxy for making method calls, no ownership is taken |
| 329 | // so this must outlive this class. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 330 | ObjectProxy* object_proxy_; |
| 331 | |
| 332 | // Interface of property, e.g. "org.chromium.ExampleService", this is |
| 333 | // distinct from the interface of the method call itself which is the |
| 334 | // general D-Bus Properties interface "org.freedesktop.DBus.Properties". |
| 335 | std::string interface_; |
| 336 | |
| 337 | // Callback for property changes. |
| 338 | PropertyChangedCallback property_changed_callback_; |
| 339 | |
| 340 | // Map of properties (as PropertyBase*) defined in the structure to |
| 341 | // names as used in D-Bus method calls and signals. The base pointer |
| 342 | // restricts property access via this map to type-unsafe and non-specific |
| 343 | // actions only. |
| 344 | typedef std::map<const std::string, PropertyBase*> PropertiesMap; |
| 345 | PropertiesMap properties_map_; |
| 346 | |
| 347 | // Weak pointer factory as D-Bus callbacks may last longer than these |
| 348 | // objects. |
| 349 | base::WeakPtrFactory<PropertySet> weak_ptr_factory_; |
| 350 | |
| 351 | DISALLOW_COPY_AND_ASSIGN(PropertySet); |
| 352 | }; |
| 353 | |
| 354 | // Property template, this defines the type-specific and type-safe methods |
| 355 | // of properties that can be accessed as members of a PropertySet structure. |
| 356 | // |
| 357 | // Properties provide a cached value that has an initial sensible default |
| 358 | // until the reply to PropertySet::GetAll() is retrieved and is updated by |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 359 | // all calls to that method, PropertySet::Get() and property changed signals |
| 360 | // also handled by PropertySet. It can be obtained by calling value() on the |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 361 | // property. |
| 362 | // |
| 363 | // It is recommended that this cached value be used where necessary, with |
| 364 | // code using PropertySet::PropertyChangedCallback to be notified of changes, |
| 365 | // rather than incurring a round-trip to the remote object for each property |
| 366 | // access. |
| 367 | // |
| 368 | // Where a round-trip is necessary, the Get() method is provided. And to |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 369 | // update the remote object value, the Set() method is also provided; these |
| 370 | // both simply call methods on PropertySet. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 371 | // |
| 372 | // Handling of particular D-Bus types is performed via specialization, |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 373 | // typically the PopValueFromReader() and AppendSetValueToWriter() methods |
| 374 | // will need to be provided, and in rare cases a constructor to provide a |
| 375 | // default value. Specializations for basic D-Bus types, strings, object |
| 376 | // paths and arrays are provided for you. |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 377 | template <class T> |
tzik@chromium.org | 57fd8b1 | 2014-06-27 17:10:43 +0900 | [diff] [blame] | 378 | class CHROME_DBUS_EXPORT Property : public PropertyBase { |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 379 | public: |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 380 | Property() {} |
derat | 3f868a4 | 2015-07-17 00:06:44 +0900 | [diff] [blame] | 381 | ~Property() override {} |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 382 | |
| 383 | // Retrieves the cached value. |
keybuk@chromium.org | 5b48ae4 | 2012-02-17 16:46:34 +0900 | [diff] [blame] | 384 | const T& value() const { return value_; } |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 385 | |
| 386 | // Requests an updated value from the remote object incurring a |
| 387 | // round-trip. |callback| will be called when the new value is available. |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 388 | // This may not be implemented by some interfaces. |
| 389 | virtual void Get(dbus::PropertySet::GetCallback callback) { |
| 390 | property_set()->Get(this, callback); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 391 | } |
| 392 | |
nywang | 80f2716 | 2015-09-29 07:46:36 +0900 | [diff] [blame] | 393 | // The synchronous version of Get(). |
| 394 | // This should never be used on an interactive thread. |
| 395 | virtual bool GetAndBlock() { |
| 396 | return property_set()->GetAndBlock(this); |
| 397 | } |
| 398 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 399 | // Requests that the remote object change the property value to |value|, |
| 400 | // |callback| will be called to indicate the success or failure of the |
| 401 | // request, however the new value may not be available depending on the |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 402 | // remote object. |
| 403 | virtual void Set(const T& value, dbus::PropertySet::SetCallback callback) { |
| 404 | set_value_ = value; |
| 405 | property_set()->Set(this, callback); |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 406 | } |
| 407 | |
nywang | 80f2716 | 2015-09-29 07:46:36 +0900 | [diff] [blame] | 408 | // The synchronous version of Set(). |
| 409 | // This should never be used on an interactive thread. |
nywang | f119681 | 2015-09-23 09:06:40 +0900 | [diff] [blame] | 410 | virtual bool SetAndBlock(const T& value) { |
| 411 | set_value_ = value; |
| 412 | return property_set()->SetAndBlock(this); |
| 413 | } |
| 414 | |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 415 | // Method used by PropertySet to retrieve the value from a MessageReader, |
| 416 | // no knowledge of the contained type is required, this method returns |
| 417 | // true if its expected type was found, false if not. |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 418 | bool PopValueFromReader(MessageReader* reader) override; |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 419 | |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 420 | // Method used by PropertySet to append the set value to a MessageWriter, |
| 421 | // no knowledge of the contained type is required. |
keybuk@google.com | f056b96 | 2012-03-22 08:43:45 +0900 | [diff] [blame] | 422 | // Implementation provided by specialization. |
dmichael | bc06db4 | 2014-12-20 05:52:31 +0900 | [diff] [blame] | 423 | void AppendSetValueToWriter(MessageWriter* writer) override; |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 424 | |
keybuk@chromium.org | b45e529 | 2012-08-15 10:03:30 +0900 | [diff] [blame] | 425 | // Method used by test and stub implementations of dbus::PropertySet::Set |
| 426 | // to replace the property value with the set value without using a |
| 427 | // dbus::MessageReader. |
dmichael | bc06db4 | 2014-12-20 05:52:31 +0900 | [diff] [blame] | 428 | void ReplaceValueWithSetValue() override { |
keybuk@chromium.org | c1944c6 | 2013-04-24 10:41:54 +0900 | [diff] [blame] | 429 | value_ = set_value_; |
| 430 | property_set()->NotifyPropertyChanged(name()); |
| 431 | } |
keybuk@chromium.org | b45e529 | 2012-08-15 10:03:30 +0900 | [diff] [blame] | 432 | |
| 433 | // Method used by test and stub implementations to directly set the |
| 434 | // value of a property. |
keybuk@chromium.org | c1944c6 | 2013-04-24 10:41:54 +0900 | [diff] [blame] | 435 | void ReplaceValue(const T& value) { |
| 436 | value_ = value; |
| 437 | property_set()->NotifyPropertyChanged(name()); |
| 438 | } |
keybuk@chromium.org | b45e529 | 2012-08-15 10:03:30 +0900 | [diff] [blame] | 439 | |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 440 | // Method used by test and stub implementations to directly set the |
| 441 | // |set_value_| of a property. |
| 442 | void ReplaceSetValueForTesting(const T& value) { set_value_ = value; } |
| 443 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 444 | private: |
| 445 | // Current cached value of the property. |
| 446 | T value_; |
| 447 | |
keybuk@chromium.org | 56028ac | 2012-06-29 03:43:30 +0900 | [diff] [blame] | 448 | // Replacement value of the property. |
| 449 | T set_value_; |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 450 | }; |
| 451 | |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 452 | // Clang and GCC don't agree on how attributes should work for explicitly |
| 453 | // instantiated templates. GCC ignores attributes on explicit instantiations |
| 454 | // (and emits a warning) while Clang requires the visiblity attribute on the |
| 455 | // explicit instantiations for them to be visible to other compilation units. |
| 456 | // Hopefully clang and GCC agree one day, and this can be cleaned up: |
| 457 | // https://llvm.org/bugs/show_bug.cgi?id=24815 |
| 458 | #pragma GCC diagnostic push |
| 459 | #pragma GCC diagnostic ignored "-Wattributes" |
spang | cff3883 | 2015-09-15 02:49:40 +0900 | [diff] [blame] | 460 | |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 461 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 462 | CHROME_DBUS_EXPORT Property<uint8_t>::Property(); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 463 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 464 | CHROME_DBUS_EXPORT bool Property<uint8_t>::PopValueFromReader( |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 465 | MessageReader* reader); |
| 466 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 467 | CHROME_DBUS_EXPORT void Property<uint8_t>::AppendSetValueToWriter( |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 468 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 469 | extern template class CHROME_DBUS_EXPORT Property<uint8_t>; |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 470 | |
| 471 | template <> |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 472 | CHROME_DBUS_EXPORT Property<bool>::Property(); |
| 473 | template <> |
| 474 | CHROME_DBUS_EXPORT bool Property<bool>::PopValueFromReader( |
| 475 | MessageReader* reader); |
| 476 | template <> |
| 477 | CHROME_DBUS_EXPORT void Property<bool>::AppendSetValueToWriter( |
| 478 | MessageWriter* writer); |
| 479 | extern template class CHROME_DBUS_EXPORT Property<bool>; |
| 480 | |
| 481 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 482 | CHROME_DBUS_EXPORT Property<int16_t>::Property(); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 483 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 484 | CHROME_DBUS_EXPORT bool Property<int16_t>::PopValueFromReader( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 485 | MessageReader* reader); |
| 486 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 487 | CHROME_DBUS_EXPORT void Property<int16_t>::AppendSetValueToWriter( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 488 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 489 | extern template class CHROME_DBUS_EXPORT Property<int16_t>; |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 490 | |
| 491 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 492 | CHROME_DBUS_EXPORT Property<uint16_t>::Property(); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 493 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 494 | CHROME_DBUS_EXPORT bool Property<uint16_t>::PopValueFromReader( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 495 | MessageReader* reader); |
| 496 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 497 | CHROME_DBUS_EXPORT void Property<uint16_t>::AppendSetValueToWriter( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 498 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 499 | extern template class CHROME_DBUS_EXPORT Property<uint16_t>; |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 500 | |
| 501 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 502 | CHROME_DBUS_EXPORT Property<int32_t>::Property(); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 503 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 504 | CHROME_DBUS_EXPORT bool Property<int32_t>::PopValueFromReader( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 505 | MessageReader* reader); |
| 506 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 507 | CHROME_DBUS_EXPORT void Property<int32_t>::AppendSetValueToWriter( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 508 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 509 | extern template class CHROME_DBUS_EXPORT Property<int32_t>; |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 510 | |
| 511 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 512 | CHROME_DBUS_EXPORT Property<uint32_t>::Property(); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 513 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 514 | CHROME_DBUS_EXPORT bool Property<uint32_t>::PopValueFromReader( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 515 | MessageReader* reader); |
| 516 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 517 | CHROME_DBUS_EXPORT void Property<uint32_t>::AppendSetValueToWriter( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 518 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 519 | extern template class CHROME_DBUS_EXPORT Property<uint32_t>; |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 520 | |
| 521 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 522 | CHROME_DBUS_EXPORT Property<int64_t>::Property(); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 523 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 524 | CHROME_DBUS_EXPORT bool Property<int64_t>::PopValueFromReader( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 525 | MessageReader* reader); |
| 526 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 527 | CHROME_DBUS_EXPORT void Property<int64_t>::AppendSetValueToWriter( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 528 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 529 | extern template class CHROME_DBUS_EXPORT Property<int64_t>; |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 530 | |
| 531 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 532 | CHROME_DBUS_EXPORT Property<uint64_t>::Property(); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 533 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 534 | CHROME_DBUS_EXPORT bool Property<uint64_t>::PopValueFromReader( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 535 | MessageReader* reader); |
| 536 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 537 | CHROME_DBUS_EXPORT void Property<uint64_t>::AppendSetValueToWriter( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 538 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 539 | extern template class CHROME_DBUS_EXPORT Property<uint64_t>; |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 540 | |
| 541 | template <> |
| 542 | CHROME_DBUS_EXPORT Property<double>::Property(); |
| 543 | template <> |
| 544 | CHROME_DBUS_EXPORT bool Property<double>::PopValueFromReader( |
| 545 | MessageReader* reader); |
| 546 | template <> |
| 547 | CHROME_DBUS_EXPORT void Property<double>::AppendSetValueToWriter( |
| 548 | MessageWriter* writer); |
| 549 | extern template class CHROME_DBUS_EXPORT Property<double>; |
| 550 | |
| 551 | template <> |
| 552 | CHROME_DBUS_EXPORT bool Property<std::string>::PopValueFromReader( |
| 553 | MessageReader* reader); |
| 554 | template <> |
| 555 | CHROME_DBUS_EXPORT void Property<std::string>::AppendSetValueToWriter( |
| 556 | MessageWriter* writer); |
| 557 | extern template class CHROME_DBUS_EXPORT Property<std::string>; |
| 558 | |
| 559 | template <> |
| 560 | CHROME_DBUS_EXPORT bool Property<ObjectPath>::PopValueFromReader( |
| 561 | MessageReader* reader); |
| 562 | template <> |
| 563 | CHROME_DBUS_EXPORT void Property<ObjectPath>::AppendSetValueToWriter( |
| 564 | MessageWriter* writer); |
| 565 | extern template class CHROME_DBUS_EXPORT Property<ObjectPath>; |
| 566 | |
| 567 | template <> |
| 568 | CHROME_DBUS_EXPORT bool Property<std::vector<std::string>>::PopValueFromReader( |
| 569 | MessageReader* reader); |
| 570 | template <> |
| 571 | CHROME_DBUS_EXPORT void Property< |
| 572 | std::vector<std::string>>::AppendSetValueToWriter(MessageWriter* writer); |
| 573 | extern template class CHROME_DBUS_EXPORT Property<std::vector<std::string>>; |
| 574 | |
| 575 | template <> |
| 576 | CHROME_DBUS_EXPORT bool Property<std::vector<ObjectPath>>::PopValueFromReader( |
| 577 | MessageReader* reader); |
| 578 | template <> |
| 579 | CHROME_DBUS_EXPORT void Property< |
| 580 | std::vector<ObjectPath>>::AppendSetValueToWriter(MessageWriter* writer); |
| 581 | extern template class CHROME_DBUS_EXPORT Property<std::vector<ObjectPath>>; |
| 582 | |
| 583 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 584 | CHROME_DBUS_EXPORT bool Property<std::vector<uint8_t>>::PopValueFromReader( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 585 | MessageReader* reader); |
| 586 | template <> |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 587 | CHROME_DBUS_EXPORT void Property<std::vector<uint8_t>>::AppendSetValueToWriter( |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 588 | MessageWriter* writer); |
avi | 0ad0ce0 | 2015-12-23 03:12:45 +0900 | [diff] [blame] | 589 | extern template class CHROME_DBUS_EXPORT Property<std::vector<uint8_t>>; |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 590 | |
| 591 | template <> |
| 592 | CHROME_DBUS_EXPORT bool |
| 593 | Property<std::map<std::string, std::string>>::PopValueFromReader( |
| 594 | MessageReader* reader); |
| 595 | template <> |
| 596 | CHROME_DBUS_EXPORT void |
| 597 | Property<std::map<std::string, std::string>>::AppendSetValueToWriter( |
| 598 | MessageWriter* writer); |
| 599 | extern template class CHROME_DBUS_EXPORT |
| 600 | Property<std::map<std::string, std::string>>; |
| 601 | |
| 602 | template <> |
| 603 | CHROME_DBUS_EXPORT bool |
| 604 | Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>:: |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 605 | PopValueFromReader(MessageReader* reader); |
| 606 | template <> |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 607 | CHROME_DBUS_EXPORT void |
| 608 | Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>:: |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 609 | AppendSetValueToWriter(MessageWriter* writer); |
dcheng | 52b3072 | 2015-09-19 03:29:06 +0900 | [diff] [blame] | 610 | extern template class CHROME_DBUS_EXPORT |
| 611 | Property<std::vector<std::pair<std::vector<uint8_t>, uint16_t>>>; |
| 612 | |
| 613 | #pragma GCC diagnostic pop |
dtapuska | 95f7172 | 2015-02-10 01:02:55 +0900 | [diff] [blame] | 614 | |
keybuk@chromium.org | 7e0c493 | 2012-02-15 13:21:08 +0900 | [diff] [blame] | 615 | } // namespace dbus |
| 616 | |
| 617 | #endif // DBUS_PROPERTY_H_ |