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

Unified Diff: chrome/utility/media_router/dial_device_description_parser.h

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/utility/media_router/dial_device_description_parser.h
diff --git a/chrome/utility/media_router/dial_device_description_parser.h b/chrome/utility/media_router/dial_device_description_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..c598e63758996e009fb2db210c7ab921b2690dba
--- /dev/null
+++ b/chrome/utility/media_router/dial_device_description_parser.h
@@ -0,0 +1,42 @@
+// 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.
+
+#ifndef CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_H_
+#define CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "chrome/common/media_router/dial_device_description.h"
+
+namespace media_router {
+
+class DialDeviceDescriptionParser {
+ public:
+ DialDeviceDescriptionParser();
+ ~DialDeviceDescriptionParser();
+
+ // Processes the result of getting device description. Returns true and
+ // populates corresponding fields in |dial_device_description_| if processing
+ // succeeds; otherwise returns false.
+ // |xml|: The device description.
+ bool Parse(const std::string& xml);
+
+ // Removes unique identifiers and serial number from the device description
+ // for logging. |xml|: The device description.
+ std::string ScrubXmlForLogging(const std::string& xml);
+
+ const media_router::DialDeviceDescription& device_description() {
mark a. foltz 2017/03/17 19:05:47 This design means the caller has to keep the parse
zhaobin 2017/03/18 00:17:39 Done.
+ return device_description_;
+ }
+
+ private:
+ media_router::DialDeviceDescription device_description_;
+
+ DISALLOW_COPY_AND_ASSIGN(DialDeviceDescriptionParser);
+};
+
+} // namespace media_router
+
+#endif // CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_H_

Powered by Google App Engine
This is Rietveld 408576698