Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(844)

Side by Side Diff: device/usb/fake_usb_device_handle.h

Issue 2821813002: Use Mojo enum types in the C++ USB interface (Closed)
Patch Set: Fix up //device/usb dependencies in //extensions/browser/api Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/usb/BUILD.gn ('k') | device/usb/fake_usb_device_handle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/usb_device_handle.h" 5 #include "device/usb/usb_device_handle.h"
6 6
7 namespace device { 7 namespace device {
8 8
9 // This class implements a fake USB device handle that will handle control 9 // This class implements a fake USB device handle that will handle control
10 // requests by responding with data out of the provided buffer. The format of 10 // requests by responding with data out of the provided buffer. The format of
(...skipping 19 matching lines...) Expand all
30 void ClaimInterface(int interface_number, 30 void ClaimInterface(int interface_number,
31 const ResultCallback& callback) override; 31 const ResultCallback& callback) override;
32 void ReleaseInterface(int interface_number, 32 void ReleaseInterface(int interface_number,
33 const ResultCallback& callback) override; 33 const ResultCallback& callback) override;
34 void SetInterfaceAlternateSetting(int interface_number, 34 void SetInterfaceAlternateSetting(int interface_number,
35 int alternate_setting, 35 int alternate_setting,
36 const ResultCallback& callback) override; 36 const ResultCallback& callback) override;
37 void ResetDevice(const ResultCallback& callback) override; 37 void ResetDevice(const ResultCallback& callback) override;
38 void ClearHalt(uint8_t endpoint, const ResultCallback& callback) override; 38 void ClearHalt(uint8_t endpoint, const ResultCallback& callback) override;
39 39
40 void ControlTransfer(UsbEndpointDirection direction, 40 void ControlTransfer(UsbTransferDirection direction,
41 TransferRequestType request_type, 41 UsbControlTransferType request_type,
42 TransferRecipient recipient, 42 UsbControlTransferRecipient recipient,
43 uint8_t request, 43 uint8_t request,
44 uint16_t value, 44 uint16_t value,
45 uint16_t index, 45 uint16_t index,
46 scoped_refptr<net::IOBuffer> buffer, 46 scoped_refptr<net::IOBuffer> buffer,
47 size_t length, 47 size_t length,
48 unsigned int timeout, 48 unsigned int timeout,
49 const TransferCallback& callback) override; 49 const TransferCallback& callback) override;
50 50
51 void IsochronousTransferIn( 51 void IsochronousTransferIn(
52 uint8_t endpoint, 52 uint8_t endpoint,
53 const std::vector<uint32_t>& packet_lengths, 53 const std::vector<uint32_t>& packet_lengths,
54 unsigned int timeout, 54 unsigned int timeout,
55 const IsochronousTransferCallback& callback) override; 55 const IsochronousTransferCallback& callback) override;
56 56
57 void IsochronousTransferOut( 57 void IsochronousTransferOut(
58 uint8_t endpoint, 58 uint8_t endpoint,
59 scoped_refptr<net::IOBuffer> buffer, 59 scoped_refptr<net::IOBuffer> buffer,
60 const std::vector<uint32_t>& packet_lengths, 60 const std::vector<uint32_t>& packet_lengths,
61 unsigned int timeout, 61 unsigned int timeout,
62 const IsochronousTransferCallback& callback) override; 62 const IsochronousTransferCallback& callback) override;
63 63
64 void GenericTransfer(UsbEndpointDirection direction, 64 void GenericTransfer(UsbTransferDirection direction,
65 uint8_t endpoint_number, 65 uint8_t endpoint_number,
66 scoped_refptr<net::IOBuffer> buffer, 66 scoped_refptr<net::IOBuffer> buffer,
67 size_t length, 67 size_t length,
68 unsigned int timeout, 68 unsigned int timeout,
69 const TransferCallback& callback) override; 69 const TransferCallback& callback) override;
70 const UsbInterfaceDescriptor* FindInterfaceByEndpoint( 70 const UsbInterfaceDescriptor* FindInterfaceByEndpoint(
71 uint8_t endpoint_address) override; 71 uint8_t endpoint_address) override;
72 72
73 private: 73 private:
74 ~FakeUsbDeviceHandle() override; 74 ~FakeUsbDeviceHandle() override;
75 75
76 const uint8_t* const data_; 76 const uint8_t* const data_;
77 const size_t size_; 77 const size_t size_;
78 size_t position_; 78 size_t position_;
79 }; 79 };
80 80
81 } // namespace device 81 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/BUILD.gn ('k') | device/usb/fake_usb_device_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698