| 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 #ifndef USBDevice_h | 5 #ifndef USBDevice_h |
| 6 #define USBDevice_h | 6 #define USBDevice_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ArrayBufferOrArrayBufferView.h" | 8 #include "bindings/core/v8/ArrayBufferOrArrayBufferView.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 void asyncOpen(ScriptPromiseResolver*, device::usb::blink::OpenDeviceError); | 95 void asyncOpen(ScriptPromiseResolver*, device::usb::blink::OpenDeviceError); |
| 96 void asyncClose(ScriptPromiseResolver*); | 96 void asyncClose(ScriptPromiseResolver*); |
| 97 void onDeviceOpenedOrClosed(bool); | 97 void onDeviceOpenedOrClosed(bool); |
| 98 void asyncSelectConfiguration(size_t configurationIndex, ScriptPromiseResolv
er*, bool success); | 98 void asyncSelectConfiguration(size_t configurationIndex, ScriptPromiseResolv
er*, bool success); |
| 99 void onConfigurationSelected(bool success, size_t configurationIndex); | 99 void onConfigurationSelected(bool success, size_t configurationIndex); |
| 100 void asyncClaimInterface(size_t interfaceIndex, ScriptPromiseResolver*, bool
success); | 100 void asyncClaimInterface(size_t interfaceIndex, ScriptPromiseResolver*, bool
success); |
| 101 void asyncReleaseInterface(size_t interfaceIndex, ScriptPromiseResolver*, bo
ol success); | 101 void asyncReleaseInterface(size_t interfaceIndex, ScriptPromiseResolver*, bo
ol success); |
| 102 void onInterfaceClaimedOrUnclaimed(bool claimed, size_t interfaceIndex); | 102 void onInterfaceClaimedOrUnclaimed(bool claimed, size_t interfaceIndex); |
| 103 void asyncSelectAlternateInterface(size_t interfaceIndex, size_t alternateIn
dex, ScriptPromiseResolver*, bool success); | 103 void asyncSelectAlternateInterface(size_t interfaceIndex, size_t alternateIn
dex, ScriptPromiseResolver*, bool success); |
| 104 void asyncControlTransferIn(ScriptPromiseResolver*, device::usb::blink::Tran
sferStatus, mojo::WTFArray<uint8_t>); | 104 void asyncControlTransferIn(ScriptPromiseResolver*, device::usb::blink::Tran
sferStatus, const Optional<Vector<uint8_t>>&); |
| 105 void asyncControlTransferOut(unsigned, ScriptPromiseResolver*, device::usb::
blink::TransferStatus); | 105 void asyncControlTransferOut(unsigned, ScriptPromiseResolver*, device::usb::
blink::TransferStatus); |
| 106 void asyncClearHalt(ScriptPromiseResolver*, bool success); | 106 void asyncClearHalt(ScriptPromiseResolver*, bool success); |
| 107 void asyncTransferIn(ScriptPromiseResolver*, device::usb::blink::TransferSta
tus, mojo::WTFArray<uint8_t>); | 107 void asyncTransferIn(ScriptPromiseResolver*, device::usb::blink::TransferSta
tus, const Optional<Vector<uint8_t>>&); |
| 108 void asyncTransferOut(unsigned, ScriptPromiseResolver*, device::usb::blink::
TransferStatus); | 108 void asyncTransferOut(unsigned, ScriptPromiseResolver*, device::usb::blink::
TransferStatus); |
| 109 void asyncIsochronousTransferIn(ScriptPromiseResolver*, mojo::WTFArray<uint8
_t>, mojo::WTFArray<device::usb::blink::IsochronousPacketPtr>); | 109 void asyncIsochronousTransferIn(ScriptPromiseResolver*, const Optional<Vecto
r<uint8_t>>&, Vector<device::usb::blink::IsochronousPacketPtr>); |
| 110 void asyncIsochronousTransferOut(ScriptPromiseResolver*, mojo::WTFArray<devi
ce::usb::blink::IsochronousPacketPtr>); | 110 void asyncIsochronousTransferOut(ScriptPromiseResolver*, Vector<device::usb:
:blink::IsochronousPacketPtr>); |
| 111 void asyncReset(ScriptPromiseResolver*, bool success); | 111 void asyncReset(ScriptPromiseResolver*, bool success); |
| 112 | 112 |
| 113 void onConnectionError(); | 113 void onConnectionError(); |
| 114 bool markRequestComplete(ScriptPromiseResolver*); | 114 bool markRequestComplete(ScriptPromiseResolver*); |
| 115 | 115 |
| 116 device::usb::blink::DeviceInfoPtr m_deviceInfo; | 116 device::usb::blink::DeviceInfoPtr m_deviceInfo; |
| 117 device::usb::blink::DevicePtr m_device; | 117 device::usb::blink::DevicePtr m_device; |
| 118 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceRequests; | 118 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceRequests; |
| 119 bool m_opened; | 119 bool m_opened; |
| 120 bool m_deviceStateChangeInProgress; | 120 bool m_deviceStateChangeInProgress; |
| 121 int m_configurationIndex; | 121 int m_configurationIndex; |
| 122 WTF::BitVector m_claimedInterfaces; | 122 WTF::BitVector m_claimedInterfaces; |
| 123 WTF::BitVector m_interfaceStateChangeInProgress; | 123 WTF::BitVector m_interfaceStateChangeInProgress; |
| 124 WTF::Vector<size_t> m_selectedAlternates; | 124 WTF::Vector<size_t> m_selectedAlternates; |
| 125 WTF::BitVector m_inEndpoints; | 125 WTF::BitVector m_inEndpoints; |
| 126 WTF::BitVector m_outEndpoints; | 126 WTF::BitVector m_outEndpoints; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace blink | 129 } // namespace blink |
| 130 | 130 |
| 131 #endif // USBDevice_h | 131 #endif // USBDevice_h |
| OLD | NEW |