Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_H_ | |
| 6 #define CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "chrome/common/media_router/dial_device_description.h" | |
| 12 | |
| 13 namespace media_router { | |
| 14 | |
| 15 class DialDeviceDescriptionParser { | |
| 16 public: | |
| 17 DialDeviceDescriptionParser(); | |
| 18 ~DialDeviceDescriptionParser(); | |
| 19 | |
| 20 // Processes the result of getting device description. Returns true and | |
| 21 // populates corresponding fields in |dial_device_description_| if processing | |
| 22 // succeeds; otherwise returns false. | |
| 23 // |xml|: The device description. | |
| 24 bool Parse(const std::string& xml); | |
| 25 | |
| 26 // Removes unique identifiers and serial number from the device description | |
| 27 // for logging. |xml|: The device description. | |
| 28 std::string ScrubXmlForLogging(const std::string& xml); | |
| 29 | |
| 30 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.
| |
| 31 return device_description_; | |
| 32 } | |
| 33 | |
| 34 private: | |
| 35 media_router::DialDeviceDescription device_description_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(DialDeviceDescriptionParser); | |
| 38 }; | |
| 39 | |
| 40 } // namespace media_router | |
| 41 | |
| 42 #endif // CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_H_ | |
| OLD | NEW |