| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_DBUS_NFC_CLIENT_HELPERS_H_ | 5 #ifndef CHROMEOS_DBUS_NFC_CLIENT_HELPERS_H_ |
| 6 #define CHROMEOS_DBUS_NFC_CLIENT_HELPERS_H_ | 6 #define CHROMEOS_DBUS_NFC_CLIENT_HELPERS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Called when a response for a successful method call is received. | 39 // Called when a response for a successful method call is received. |
| 40 CHROMEOS_EXPORT void OnSuccess(const base::Closure& callback, | 40 CHROMEOS_EXPORT void OnSuccess(const base::Closure& callback, |
| 41 dbus::Response* response); | 41 dbus::Response* response); |
| 42 | 42 |
| 43 // Extracts the error data from |response| and invokes |error_callback| with | 43 // Extracts the error data from |response| and invokes |error_callback| with |
| 44 // the resulting error name and error message. | 44 // the resulting error name and error message. |
| 45 CHROMEOS_EXPORT void OnError(const ErrorCallback& error_callback, | 45 CHROMEOS_EXPORT void OnError(const ErrorCallback& error_callback, |
| 46 dbus::ErrorResponse* response); | 46 dbus::ErrorResponse* response); |
| 47 | 47 |
| 48 // Appends any value (basic types and nested types) represented by |value| to | |
| 49 // the writer |writer| as a variant type. | |
| 50 // TODO(armansito): Consider moving this to dbus/values_util.h" | |
| 51 CHROMEOS_EXPORT void AppendValueDataAsVariant(dbus::MessageWriter* writer, | |
| 52 const base::Value& value); | |
| 53 | |
| 54 // DBusObjectMap is a simple data structure that facilitates keeping track of | 48 // DBusObjectMap is a simple data structure that facilitates keeping track of |
| 55 // D-Bus object proxies and properties. It maintains a mapping from object | 49 // D-Bus object proxies and properties. It maintains a mapping from object |
| 56 // paths to object proxy - property structure pairs. | 50 // paths to object proxy - property structure pairs. |
| 57 // TODO(armansito): This is only needed until neard implements the D-Bus | 51 // TODO(armansito): This is only needed until neard implements the D-Bus |
| 58 // org.freedesktop.DBus.ObjectManager interface. Remove this once we upgrade | 52 // org.freedesktop.DBus.ObjectManager interface. Remove this once we upgrade |
| 59 // to neard-0.14. | 53 // to neard-0.14. |
| 60 class CHROMEOS_EXPORT DBusObjectMap { | 54 class CHROMEOS_EXPORT DBusObjectMap { |
| 61 public: | 55 public: |
| 62 // DBusObjectMap::Delegate must be implemented by classes that use an | 56 // DBusObjectMap::Delegate must be implemented by classes that use an |
| 63 // instance of DBusObjectMap to manage object proxies. | 57 // instance of DBusObjectMap to manage object proxies. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 typedef std::map<dbus::ObjectPath, DBusObjectMap*> PathsToObjectMapsType; | 197 typedef std::map<dbus::ObjectPath, DBusObjectMap*> PathsToObjectMapsType; |
| 204 PathsToObjectMapsType paths_to_object_maps_; | 198 PathsToObjectMapsType paths_to_object_maps_; |
| 205 | 199 |
| 206 DISALLOW_COPY_AND_ASSIGN(ObjectProxyTree); | 200 DISALLOW_COPY_AND_ASSIGN(ObjectProxyTree); |
| 207 }; | 201 }; |
| 208 | 202 |
| 209 } // namespace nfc_client_helpers | 203 } // namespace nfc_client_helpers |
| 210 } // namespace chromeos | 204 } // namespace chromeos |
| 211 | 205 |
| 212 #endif // CHROMEOS_DBUS_NFC_CLIENT_HELPERS_H_ | 206 #endif // CHROMEOS_DBUS_NFC_CLIENT_HELPERS_H_ |
| OLD | NEW |