| 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_IMPL_H_ |
| 6 #define CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/common/media_router/dial_device_description_parser.mojom.h" |
| 10 |
| 11 namespace media_router { |
| 12 |
| 13 // Implementation of Mojo DialDeviceDescriptionParser. It accepts device |
| 14 // description parsing request from browser process, and handles it in utility |
| 15 // process. Class must be created and destroyed on utility thread. |
| 16 class DialDeviceDescriptionParserImpl |
| 17 : public chrome::mojom::DialDeviceDescriptionParser { |
| 18 public: |
| 19 DialDeviceDescriptionParserImpl(); |
| 20 ~DialDeviceDescriptionParserImpl() override; |
| 21 |
| 22 static void Create(chrome::mojom::DialDeviceDescriptionParserRequest request); |
| 23 |
| 24 private: |
| 25 friend class DialDeviceDescriptionParserImplTest; |
| 26 |
| 27 // extensions::mojom::DialDeviceDescriptionParser: |
| 28 void ParseDialDeviceDescription( |
| 29 const std::string& device_description_xml_data, |
| 30 const ParseDialDeviceDescriptionCallback& callback) override; |
| 31 |
| 32 // Processes the result of getting device description. Returns valid |
| 33 // DialDeviceDescriptionPtr if processing succeeds; otherwise returns nullptr. |
| 34 // |xml|: The device description xml text. |
| 35 chrome::mojom::DialDeviceDescriptionPtr Parse(const std::string& xml); |
| 36 |
| 37 base::ThreadChecker thread_checker_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(DialDeviceDescriptionParserImpl); |
| 40 }; |
| 41 |
| 42 } // namespace media_router |
| 43 |
| 44 #endif // CHROME_UTILITY_MEDIA_ROUTER_DIAL_DEVICE_DESCRIPTION_PARSER_IMPL_H_ |
| OLD | NEW |