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

Unified Diff: chromeos/dbus/nfc_device_client.cc

Issue 221393004: dbus/values_util.h: Add functions to append collection type values to message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed keybuk@'s comment, unmarked old functions as deprecated as they are useful. Created 6 years, 9 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/nfc_client_helpers.cc ('k') | chromeos/dbus/nfc_tag_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chromeos/dbus/nfc_client_helpers.cc ('k') | chromeos/dbus/nfc_tag_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698