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

Unified Diff: chrome/common/extensions/dial_device_description_parser_struct_traits.cc

Issue 2745653008: [Media Router] Parse device description xml in utility process (Closed)
Patch Set: use mojo instead of IPC Created 3 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
Index: chrome/common/extensions/dial_device_description_parser_struct_traits.cc
diff --git a/chrome/common/extensions/dial_device_description_parser_struct_traits.cc b/chrome/common/extensions/dial_device_description_parser_struct_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2a8d731896622fe68e6478657209b2708a0bab6a
--- /dev/null
+++ b/chrome/common/extensions/dial_device_description_parser_struct_traits.cc
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/extensions/dial_device_description_parser_struct_traits.h"
+
+namespace mojo {
+
+// static
+bool StructTraits<extensions::mojom::DialDeviceDescriptionDataView,
+ media_router::DialDeviceDescription>::
+ Read(extensions::mojom::DialDeviceDescriptionDataView data,
+ media_router::DialDeviceDescription* out) {
+ if (!data.ReadUniqueId(&out->unique_id))
+ return false;
+ if (!data.ReadFriendlyName(&out->friendly_name))
+ return false;
+ if (!data.ReadModelName(&out->model_name))
+ return false;
+ if (!data.ReadDeviceType(&out->device_type))
+ return false;
+
+ return true;
+}
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698