OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/utility/media_router/dial_device_description_parser_impl.h" | 5 #include "chrome/utility/media_router/dial_device_description_parser_impl.h" |
6 | 6 |
7 #include <libxml/parser.h> | 7 #include <libxml/parser.h> |
8 #include <libxml/tree.h> | 8 #include <libxml/tree.h> |
9 #include <libxml/xpath.h> | 9 #include <libxml/xpath.h> |
10 #include <utility> | 10 #include <utility> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 namespace media_router { | 49 namespace media_router { |
50 | 50 |
51 DialDeviceDescriptionParserImpl::DialDeviceDescriptionParserImpl() = default; | 51 DialDeviceDescriptionParserImpl::DialDeviceDescriptionParserImpl() = default; |
52 DialDeviceDescriptionParserImpl::~DialDeviceDescriptionParserImpl() { | 52 DialDeviceDescriptionParserImpl::~DialDeviceDescriptionParserImpl() { |
53 DCHECK(thread_checker_.CalledOnValidThread()); | 53 DCHECK(thread_checker_.CalledOnValidThread()); |
54 } | 54 } |
55 | 55 |
56 // static | 56 // static |
57 void DialDeviceDescriptionParserImpl::Create( | 57 void DialDeviceDescriptionParserImpl::Create( |
| 58 const service_manager::BindSourceInfo& source_info, |
58 chrome::mojom::DialDeviceDescriptionParserRequest request) { | 59 chrome::mojom::DialDeviceDescriptionParserRequest request) { |
59 mojo::MakeStrongBinding(base::MakeUnique<DialDeviceDescriptionParserImpl>(), | 60 mojo::MakeStrongBinding(base::MakeUnique<DialDeviceDescriptionParserImpl>(), |
60 std::move(request)); | 61 std::move(request)); |
61 } | 62 } |
62 | 63 |
63 void DialDeviceDescriptionParserImpl::ParseDialDeviceDescription( | 64 void DialDeviceDescriptionParserImpl::ParseDialDeviceDescription( |
64 const std::string& device_description_xml_data, | 65 const std::string& device_description_xml_data, |
65 const ParseDialDeviceDescriptionCallback& callback) { | 66 const ParseDialDeviceDescriptionCallback& callback) { |
66 DCHECK(thread_checker_.CalledOnValidThread()); | 67 DCHECK(thread_checker_.CalledOnValidThread()); |
67 DCHECK(!callback.is_null()); | 68 DCHECK(!callback.is_null()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 ErrorType error = Validate(*out); | 106 ErrorType error = Validate(*out); |
106 if (error != ErrorType::NONE) { | 107 if (error != ErrorType::NONE) { |
107 DLOG(WARNING) << "Device description failed to validate: " << error; | 108 DLOG(WARNING) << "Device description failed to validate: " << error; |
108 return nullptr; | 109 return nullptr; |
109 } | 110 } |
110 | 111 |
111 return out; | 112 return out; |
112 } | 113 } |
113 | 114 |
114 } // namespace media_router | 115 } // namespace media_router |
OLD | NEW |