Index: chromeos/dbus/nfc_device_client.cc |
diff --git a/chromeos/dbus/nfc_device_client.cc b/chromeos/dbus/nfc_device_client.cc |
index e9833c96cfe28815c4bb56bd3ad0b625c2e476bf..a1976c8119ac3531684f031e10b4b216589993ca 100644 |
--- a/chromeos/dbus/nfc_device_client.cc |
+++ b/chromeos/dbus/nfc_device_client.cc |
@@ -11,6 +11,7 @@ |
#include "chromeos/dbus/nfc_adapter_client.h" |
#include "dbus/bus.h" |
#include "dbus/message.h" |
+#include "dbus/values_util.h" |
#include "third_party/cros_system_api/dbus/service_constants.h" |
using chromeos::nfc_client_helpers::DBusObjectMap; |
@@ -108,18 +109,7 @@ class NfcDeviceClientImpl : public NfcDeviceClient, |
dbus::MethodCall method_call(nfc_device::kNfcDeviceInterface, |
nfc_device::kPush); |
dbus::MessageWriter writer(&method_call); |
- dbus::MessageWriter array_writer(NULL); |
- dbus::MessageWriter dict_entry_writer(NULL); |
- writer.OpenArray("{sv}", &array_writer); |
- for (base::DictionaryValue::Iterator iter(attributes); |
- !iter.IsAtEnd(); iter.Advance()) { |
- array_writer.OpenDictEntry(&dict_entry_writer); |
- dict_entry_writer.AppendString(iter.key()); |
- nfc_client_helpers::AppendValueDataAsVariant(&dict_entry_writer, |
- iter.value()); |
- array_writer.CloseContainer(&dict_entry_writer); |
- } |
- writer.CloseContainer(&array_writer); |
+ dbus::AppendValueData(&writer, attributes); |
object_proxy->CallMethodWithErrorCallback( |
&method_call, |