| Index: chrome/browser/extensions/api/usb/usb_device_resource.h
|
| diff --git a/chrome/browser/extensions/api/usb/usb_device_resource.h b/chrome/browser/extensions/api/usb/usb_device_resource.h
|
| index 15fcca01eb9321e44c353f715919e405a1053c0e..f601a2555d52b425c746fcc212cbfcb4cc0a6477 100644
|
| --- a/chrome/browser/extensions/api/usb/usb_device_resource.h
|
| +++ b/chrome/browser/extensions/api/usb/usb_device_resource.h
|
| @@ -6,6 +6,7 @@
|
| #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
|
|
|
| #include <set>
|
| +#include <string>
|
|
|
| #include "base/basictypes.h"
|
| #include "base/memory/linked_ptr.h"
|
| @@ -25,15 +26,59 @@ class IOBuffer;
|
| namespace extensions {
|
|
|
| // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice.
|
| +// It will redirect all the requests on the FILE thread if necessary.
|
| class UsbDeviceResource : public ApiResource {
|
| public:
|
| UsbDeviceResource(const std::string& owner_extension_id,
|
| scoped_refptr<UsbDevice> device);
|
| virtual ~UsbDeviceResource();
|
|
|
| - scoped_refptr<UsbDevice> device() {
|
| - return device_;
|
| - }
|
| + virtual void Close(const base::Callback<void()>& callback);
|
| +
|
| + virtual void ListInterfaces(UsbConfigDescriptor* config,
|
| + const UsbInterfaceCallback& callback);
|
| +
|
| + virtual void ClaimInterface(const int interface_number,
|
| + const UsbInterfaceCallback& callback);
|
| +
|
| + virtual void ReleaseInterface(const int interface_number,
|
| + const UsbInterfaceCallback& callback);
|
| +
|
| + virtual void SetInterfaceAlternateSetting(
|
| + const int interface_number,
|
| + const int alternate_setting,
|
| + const UsbInterfaceCallback& callback);
|
| +
|
| + virtual void ControlTransfer(
|
| + const UsbEndpointDirection direction,
|
| + const UsbDevice::TransferRequestType request_type,
|
| + const UsbDevice::TransferRecipient recipient,
|
| + const uint8 request,
|
| + const uint16 value, const uint16 index, net::IOBuffer* buffer,
|
| + const size_t length, const unsigned int timeout,
|
| + const UsbTransferCallback& callback);
|
| +
|
| + virtual void BulkTransfer(const UsbEndpointDirection direction,
|
| + const uint8 endpoint, net::IOBuffer* buffer,
|
| + const size_t length,
|
| + const unsigned int timeout,
|
| + const UsbTransferCallback& callback);
|
| +
|
| + virtual void InterruptTransfer(const UsbEndpointDirection direction,
|
| + const uint8 endpoint, net::IOBuffer* buffer,
|
| + const size_t length,
|
| + const unsigned int timeout,
|
| + const UsbTransferCallback& callback);
|
| +
|
| + virtual void IsochronousTransfer(const UsbEndpointDirection direction,
|
| + const uint8 endpoint, net::IOBuffer* buffer,
|
| + const size_t length,
|
| + const unsigned int packets,
|
| + const unsigned int packet_length,
|
| + const unsigned int timeout,
|
| + const UsbTransferCallback& callback);
|
| +
|
| + virtual void ResetDevice(const UsbResetDeviceCallback& callback);
|
|
|
| private:
|
| friend class ApiResourceManager<UsbDeviceResource>;
|
|
|