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 WebUSBDevice_h | 5 #ifndef WebUSBDevice_h |
6 #define WebUSBDevice_h | 6 #define WebUSBDevice_h |
7 | 7 |
8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
9 #include "public/platform/WebPassOwnPtr.h" | |
10 #include "public/platform/WebVector.h" | 9 #include "public/platform/WebVector.h" |
11 | 10 |
| 11 #include <memory> |
| 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 struct WebUSBDeviceInfo; | 15 struct WebUSBDeviceInfo; |
15 struct WebUSBError; | 16 struct WebUSBError; |
16 struct WebUSBTransferInfo; | 17 struct WebUSBTransferInfo; |
17 | 18 |
18 using WebUSBDeviceOpenCallbacks = WebCallbacks<void, const WebUSBError&>; | 19 using WebUSBDeviceOpenCallbacks = WebCallbacks<void, const WebUSBError&>; |
19 using WebUSBDeviceCloseCallbacks = WebCallbacks<void, const WebUSBError&>; | 20 using WebUSBDeviceCloseCallbacks = WebCallbacks<void, const WebUSBError&>; |
20 using WebUSBDeviceSetConfigurationCallbacks = WebCallbacks<void, const WebUSBErr
or&>; | 21 using WebUSBDeviceSetConfigurationCallbacks = WebCallbacks<void, const WebUSBErr
or&>; |
21 using WebUSBDeviceClaimInterfaceCallbacks = WebCallbacks<void, const WebUSBError
&>; | 22 using WebUSBDeviceClaimInterfaceCallbacks = WebCallbacks<void, const WebUSBError
&>; |
22 using WebUSBDeviceReleaseInterfaceCallbacks = WebCallbacks<void, const WebUSBErr
or&>; | 23 using WebUSBDeviceReleaseInterfaceCallbacks = WebCallbacks<void, const WebUSBErr
or&>; |
23 using WebUSBDeviceResetCallbacks = WebCallbacks<void, const WebUSBError&>; | 24 using WebUSBDeviceResetCallbacks = WebCallbacks<void, const WebUSBError&>; |
24 using WebUSBDeviceSetInterfaceAlternateSettingCallbacks = WebCallbacks<void, con
st WebUSBError&>; | 25 using WebUSBDeviceSetInterfaceAlternateSettingCallbacks = WebCallbacks<void, con
st WebUSBError&>; |
25 using WebUSBDeviceClearHaltCallbacks = WebCallbacks<void, const WebUSBError&>; | 26 using WebUSBDeviceClearHaltCallbacks = WebCallbacks<void, const WebUSBError&>; |
26 using WebUSBDeviceTransferCallbacks = WebCallbacks<WebPassOwnPtr<WebUSBTransferI
nfo>, const WebUSBError&>; | 27 using WebUSBDeviceTransferCallbacks = WebCallbacks<std::unique_ptr<WebUSBTransfe
rInfo>, const WebUSBError&>; |
27 | 28 |
28 class WebUSBDevice { | 29 class WebUSBDevice { |
29 public: | 30 public: |
30 enum class TransferDirection { | 31 enum class TransferDirection { |
31 In, | 32 In, |
32 Out, | 33 Out, |
33 }; | 34 }; |
34 | 35 |
35 enum class RequestType { | 36 enum class RequestType { |
36 Standard, | 37 Standard, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 virtual void isochronousTransfer(TransferDirection, uint8_t endpointNumber,
uint8_t* data, size_t dataSize, WebVector<unsigned> packetLengths, unsigned time
out, WebUSBDeviceTransferCallbacks*) = 0; | 100 virtual void isochronousTransfer(TransferDirection, uint8_t endpointNumber,
uint8_t* data, size_t dataSize, WebVector<unsigned> packetLengths, unsigned time
out, WebUSBDeviceTransferCallbacks*) = 0; |
100 | 101 |
101 // Resets the device. | 102 // Resets the device. |
102 // Ownership of the WebUSBDeviceResetCallbacks is transferred to the client. | 103 // Ownership of the WebUSBDeviceResetCallbacks is transferred to the client. |
103 virtual void reset(WebUSBDeviceResetCallbacks*) = 0; | 104 virtual void reset(WebUSBDeviceResetCallbacks*) = 0; |
104 }; | 105 }; |
105 | 106 |
106 } // namespace blink | 107 } // namespace blink |
107 | 108 |
108 #endif // WebUSBDevice_h | 109 #endif // WebUSBDevice_h |
OLD | NEW |