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

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

Issue 1847183002: Use interface associations to check function permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit and fixed Windows build. Created 4 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/usb_device_handle.h ('k') | device/usb/usb_device_handle_impl.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 5 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
6 #define DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 6 #define DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 14 matching lines...) Expand all
25 class TaskRunner; 25 class TaskRunner;
26 } 26 }
27 27
28 namespace net { 28 namespace net {
29 class IOBuffer; 29 class IOBuffer;
30 } 30 }
31 31
32 namespace device { 32 namespace device {
33 33
34 struct EndpointMapValue { 34 struct EndpointMapValue {
35 int interface_number; 35 const UsbInterfaceDescriptor* interface;
36 UsbTransferType transfer_type; 36 const UsbEndpointDescriptor* endpoint;
37 }; 37 };
38 38
39 class UsbContext; 39 class UsbContext;
40 struct UsbConfigDescriptor; 40 struct UsbConfigDescriptor;
41 class UsbDeviceImpl; 41 class UsbDeviceImpl;
42 42
43 typedef libusb_device_handle* PlatformUsbDeviceHandle; 43 typedef libusb_device_handle* PlatformUsbDeviceHandle;
44 typedef libusb_iso_packet_descriptor* PlatformUsbIsoPacketDescriptor; 44 typedef libusb_iso_packet_descriptor* PlatformUsbIsoPacketDescriptor;
45 typedef libusb_transfer* PlatformUsbTransferHandle; 45 typedef libusb_transfer* PlatformUsbTransferHandle;
46 46
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 const std::vector<uint32_t>& packet_lengths, 84 const std::vector<uint32_t>& packet_lengths,
85 unsigned int timeout, 85 unsigned int timeout,
86 const IsochronousTransferCallback& callback) override; 86 const IsochronousTransferCallback& callback) override;
87 87
88 void GenericTransfer(UsbEndpointDirection direction, 88 void GenericTransfer(UsbEndpointDirection direction,
89 uint8_t endpoint_number, 89 uint8_t endpoint_number,
90 scoped_refptr<net::IOBuffer> buffer, 90 scoped_refptr<net::IOBuffer> buffer,
91 size_t length, 91 size_t length,
92 unsigned int timeout, 92 unsigned int timeout,
93 const TransferCallback& callback) override; 93 const TransferCallback& callback) override;
94 bool FindInterfaceByEndpoint(uint8_t endpoint_address, 94 const UsbInterfaceDescriptor* FindInterfaceByEndpoint(
95 uint8_t* interface_number) override; 95 uint8_t endpoint_address) override;
96 96
97 protected: 97 protected:
98 friend class UsbDeviceImpl; 98 friend class UsbDeviceImpl;
99 99
100 // This constructor is called by UsbDeviceImpl. 100 // This constructor is called by UsbDeviceImpl.
101 UsbDeviceHandleImpl( 101 UsbDeviceHandleImpl(
102 scoped_refptr<UsbContext> context, 102 scoped_refptr<UsbContext> context,
103 scoped_refptr<UsbDeviceImpl> device, 103 scoped_refptr<UsbDeviceImpl> device,
104 PlatformUsbDeviceHandle handle, 104 PlatformUsbDeviceHandle handle,
105 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); 105 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 210 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
211 211
212 base::ThreadChecker thread_checker_; 212 base::ThreadChecker thread_checker_;
213 213
214 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandleImpl); 214 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandleImpl);
215 }; 215 };
216 216
217 } // namespace device 217 } // namespace device
218 218
219 #endif // DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_ 219 #endif // DEVICE_USB_USB_DEVICE_HANDLE_IMPL_H_
OLDNEW
« no previous file with comments | « device/usb/usb_device_handle.h ('k') | device/usb/usb_device_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698