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/USBAlternateInterface.h" | 5 #include "modules/webusb/USBAlternateInterface.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "modules/webusb/USBEndpoint.h" | 8 #include "modules/webusb/USBEndpoint.h" |
9 #include "modules/webusb/USBInterface.h" | 9 #include "modules/webusb/USBInterface.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 USBAlternateInterface::USBAlternateInterface(const USBInterface* interface, size
_t alternateIndex) | 29 USBAlternateInterface::USBAlternateInterface(const USBInterface* interface, size
_t alternateIndex) |
30 : m_interface(interface) | 30 : m_interface(interface) |
31 , m_alternateIndex(alternateIndex) | 31 , m_alternateIndex(alternateIndex) |
32 { | 32 { |
33 ASSERT(m_interface); | 33 ASSERT(m_interface); |
34 ASSERT(m_alternateIndex < m_interface->info().alternates.size()); | 34 ASSERT(m_alternateIndex < m_interface->info().alternates.size()); |
35 } | 35 } |
36 | 36 |
37 const device::usb::wtf::AlternateInterfaceInfo& USBAlternateInterface::info() co
nst | 37 const device::usb::blink::AlternateInterfaceInfo& USBAlternateInterface::info()
const |
38 { | 38 { |
39 const device::usb::wtf::InterfaceInfo& interfaceInfo = m_interface->info(); | 39 const device::usb::blink::InterfaceInfo& interfaceInfo = m_interface->info()
; |
40 ASSERT(m_alternateIndex < interfaceInfo.alternates.size()); | 40 ASSERT(m_alternateIndex < interfaceInfo.alternates.size()); |
41 return *interfaceInfo.alternates[m_alternateIndex]; | 41 return *interfaceInfo.alternates[m_alternateIndex]; |
42 } | 42 } |
43 | 43 |
44 HeapVector<Member<USBEndpoint>> USBAlternateInterface::endpoints() const | 44 HeapVector<Member<USBEndpoint>> USBAlternateInterface::endpoints() const |
45 { | 45 { |
46 HeapVector<Member<USBEndpoint>> endpoints; | 46 HeapVector<Member<USBEndpoint>> endpoints; |
47 for (size_t i = 0; i < info().endpoints.size(); ++i) | 47 for (size_t i = 0; i < info().endpoints.size(); ++i) |
48 endpoints.append(USBEndpoint::create(this, i)); | 48 endpoints.append(USBEndpoint::create(this, i)); |
49 return endpoints; | 49 return endpoints; |
50 } | 50 } |
51 | 51 |
52 DEFINE_TRACE(USBAlternateInterface) | 52 DEFINE_TRACE(USBAlternateInterface) |
53 { | 53 { |
54 visitor->trace(m_interface); | 54 visitor->trace(m_interface); |
55 } | 55 } |
56 | 56 |
57 } // namespace blink | 57 } // namespace blink |
OLD | NEW |