OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "device/usb/mojo/type_converters.h" | 5 #include "device/usb/mojo/type_converters.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "device/usb/usb_device.h" | 15 #include "device/usb/usb_device.h" |
16 #include "mojo/common/common_type_converters.h" | |
17 #include "mojo/public/cpp/bindings/array.h" | |
18 | 16 |
19 namespace mojo { | 17 namespace mojo { |
20 | 18 |
21 // static | 19 // static |
22 device::UsbDeviceFilter | 20 device::UsbDeviceFilter |
23 TypeConverter<device::UsbDeviceFilter, device::usb::DeviceFilterPtr>::Convert( | 21 TypeConverter<device::UsbDeviceFilter, device::usb::DeviceFilterPtr>::Convert( |
24 const device::usb::DeviceFilterPtr& mojo_filter) { | 22 const device::usb::DeviceFilterPtr& mojo_filter) { |
25 device::UsbDeviceFilter filter; | 23 device::UsbDeviceFilter filter; |
26 if (mojo_filter->has_vendor_id) | 24 if (mojo_filter->has_vendor_id) |
27 filter.SetVendorId(mojo_filter->vendor_id); | 25 filter.SetVendorId(mojo_filter->vendor_id); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 Convert(const device::UsbDeviceHandle::IsochronousPacket& packet) { | 244 Convert(const device::UsbDeviceHandle::IsochronousPacket& packet) { |
247 device::usb::IsochronousPacketPtr info = | 245 device::usb::IsochronousPacketPtr info = |
248 device::usb::IsochronousPacket::New(); | 246 device::usb::IsochronousPacket::New(); |
249 info->length = packet.length; | 247 info->length = packet.length; |
250 info->transferred_length = packet.transferred_length; | 248 info->transferred_length = packet.transferred_length; |
251 info->status = mojo::ConvertTo<device::usb::TransferStatus>(packet.status); | 249 info->status = mojo::ConvertTo<device::usb::TransferStatus>(packet.status); |
252 return info; | 250 return info; |
253 } | 251 } |
254 | 252 |
255 } // namespace mojo | 253 } // namespace mojo |
OLD | NEW |