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

Unified Diff: chromeos/dbus/nfc_tag_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_device_client.cc ('k') | dbus/values_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/nfc_tag_client.cc
diff --git a/chromeos/dbus/nfc_tag_client.cc b/chromeos/dbus/nfc_tag_client.cc
index 6c439fa47c082a59889e4114445ca5adf5a1a187..eae3ef9077823c7b3351b701f2d3fb53e31a3af6 100644
--- a/chromeos/dbus/nfc_tag_client.cc
+++ b/chromeos/dbus/nfc_tag_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;
@@ -109,18 +110,7 @@ class NfcTagClientImpl : public NfcTagClient,
// Create the arguments.
dbus::MethodCall method_call(nfc_tag::kNfcTagInterface, nfc_tag::kWrite);
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_device_client.cc ('k') | dbus/values_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698