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 "modules/webusb/USBConfiguration.h" | 5 #include "modules/webusb/USBConfiguration.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "device/usb/public/interfaces/device.mojom-blink.h" | 8 #include "device/usb/public/interfaces/device.mojom-blink.h" |
9 #include "modules/webusb/USBDevice.h" | 9 #include "modules/webusb/USBDevice.h" |
10 #include "modules/webusb/USBInterface.h" | 10 #include "modules/webusb/USBInterface.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 const USBDevice* USBConfiguration::Device() const { | 38 const USBDevice* USBConfiguration::Device() const { |
39 return device_; | 39 return device_; |
40 } | 40 } |
41 | 41 |
42 size_t USBConfiguration::Index() const { | 42 size_t USBConfiguration::Index() const { |
43 return configuration_index_; | 43 return configuration_index_; |
44 } | 44 } |
45 | 45 |
46 const device::usb::blink::ConfigurationInfo& USBConfiguration::Info() const { | 46 const device::mojom::blink::UsbConfigurationInfo& USBConfiguration::Info() |
| 47 const { |
47 return *device_->Info().configurations[configuration_index_]; | 48 return *device_->Info().configurations[configuration_index_]; |
48 } | 49 } |
49 | 50 |
50 HeapVector<Member<USBInterface>> USBConfiguration::interfaces() const { | 51 HeapVector<Member<USBInterface>> USBConfiguration::interfaces() const { |
51 HeapVector<Member<USBInterface>> interfaces; | 52 HeapVector<Member<USBInterface>> interfaces; |
52 for (size_t i = 0; i < Info().interfaces.size(); ++i) | 53 for (size_t i = 0; i < Info().interfaces.size(); ++i) |
53 interfaces.push_back(USBInterface::Create(this, i)); | 54 interfaces.push_back(USBInterface::Create(this, i)); |
54 return interfaces; | 55 return interfaces; |
55 } | 56 } |
56 | 57 |
57 DEFINE_TRACE(USBConfiguration) { | 58 DEFINE_TRACE(USBConfiguration) { |
58 visitor->Trace(device_); | 59 visitor->Trace(device_); |
59 } | 60 } |
60 | 61 |
61 } // namespace blink | 62 } // namespace blink |
OLD | NEW |