Index: chrome/browser/usb/usb_device.h |
diff --git a/chrome/browser/usb/usb_device.h b/chrome/browser/usb/usb_device.h |
index d3dd31db8b3f5cb9a2045648aa709799d76b2245..a5283844d807fae7ad6e45f6a6e59d6c9f549547 100644 |
--- a/chrome/browser/usb/usb_device.h |
+++ b/chrome/browser/usb/usb_device.h |
@@ -55,41 +55,41 @@ class UsbDevice : public base::RefCounted<UsbDevice> { |
PlatformUsbDeviceHandle handle() { return handle_; } |
// Close the USB device and release the underlying platform device. |
- void Close(); |
- |
- void ControlTransfer(const TransferDirection direction, |
- const TransferRequestType request_type, |
- const 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); |
- |
- void BulkTransfer(const TransferDirection direction, |
- const uint8 endpoint, |
- net::IOBuffer* buffer, |
- const size_t length, |
- const unsigned int timeout, |
- const UsbTransferCallback& callback); |
- |
- void InterruptTransfer(const TransferDirection direction, |
- const uint8 endpoint, |
- net::IOBuffer* buffer, |
- const size_t length, |
- const unsigned int timeout, |
- const UsbTransferCallback& callback); |
- |
- void IsochronousTransfer(const TransferDirection 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 Close(); |
+ |
+ virtual void ControlTransfer(const TransferDirection direction, |
+ const TransferRequestType request_type, |
+ const 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 TransferDirection direction, |
+ const uint8 endpoint, |
+ net::IOBuffer* buffer, |
+ const size_t length, |
+ const unsigned int timeout, |
+ const UsbTransferCallback& callback); |
+ |
+ virtual void InterruptTransfer(const TransferDirection direction, |
+ const uint8 endpoint, |
+ net::IOBuffer* buffer, |
+ const size_t length, |
+ const unsigned int timeout, |
+ const UsbTransferCallback& callback); |
+ |
+ virtual void IsochronousTransfer(const TransferDirection 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); |
// Normal code should not call this function. It is called by the platform's |
// callback mechanism in such a way that it cannot be made private. Invokes |
@@ -97,6 +97,13 @@ class UsbDevice : public base::RefCounted<UsbDevice> { |
// in-flight transfer set. |
void TransferComplete(PlatformUsbTransferHandle transfer); |
+ protected: |
+ // This constructor variant is for use in testing only. |
+ UsbDevice(); |
+ |
+ friend class base::RefCounted<UsbDevice>; |
+ virtual ~UsbDevice(); |
+ |
private: |
struct Transfer { |
Transfer(); |
@@ -106,9 +113,6 @@ class UsbDevice : public base::RefCounted<UsbDevice> { |
UsbTransferCallback callback; |
}; |
- friend class base::RefCounted<UsbDevice>; |
- virtual ~UsbDevice(); |
- |
// Checks that the device has not yet been closed. |
void CheckDevice(); |