Chromium Code Reviews| 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_ |