summaryrefslogtreecommitdiffstats
path: root/device/usb
diff options
context:
space:
mode:
Diffstat (limited to 'device/usb')
-rw-r--r--device/usb/usb_context.cc4
-rw-r--r--device/usb/usb_context_unittest.cc2
-rw-r--r--device/usb/usb_device_handle_impl.h88
-rw-r--r--device/usb/usb_device_impl.h14
-rw-r--r--device/usb/usb_service_impl.cc9
5 files changed, 57 insertions, 60 deletions
diff --git a/device/usb/usb_context.cc b/device/usb/usb_context.cc
index dac86fe..cb8214f 100644
--- a/device/usb/usb_context.cc
+++ b/device/usb/usb_context.cc
@@ -20,10 +20,10 @@ namespace device {
class UsbContext::UsbEventHandler : public base::PlatformThread::Delegate {
public:
explicit UsbEventHandler(libusb_context* context);
- virtual ~UsbEventHandler();
+ ~UsbEventHandler() override;
// base::PlatformThread::Delegate
- virtual void ThreadMain() override;
+ void ThreadMain() override;
private:
base::subtle::Atomic32 running_;
diff --git a/device/usb/usb_context_unittest.cc b/device/usb/usb_context_unittest.cc
index e00062c..e3fb017 100644
--- a/device/usb/usb_context_unittest.cc
+++ b/device/usb/usb_context_unittest.cc
@@ -20,7 +20,7 @@ class UsbContextTest : public testing::Test {
: UsbContext(context) {}
private:
- virtual ~UsbContextForTest() {}
+ ~UsbContextForTest() override {}
DISALLOW_COPY_AND_ASSIGN(UsbContextForTest);
};
};
diff --git a/device/usb/usb_device_handle_impl.h b/device/usb/usb_device_handle_impl.h
index b92f779..4488ec9 100644
--- a/device/usb/usb_device_handle_impl.h
+++ b/device/usb/usb_device_handle_impl.h
@@ -33,50 +33,48 @@ typedef libusb_transfer* PlatformUsbTransferHandle;
// UsbDeviceHandle class provides basic I/O related functionalities.
class UsbDeviceHandleImpl : public UsbDeviceHandle {
public:
- virtual scoped_refptr<UsbDevice> GetDevice() const override;
- virtual void Close() override;
- virtual bool ClaimInterface(int interface_number) override;
- virtual bool ReleaseInterface(int interface_number) override;
- virtual bool SetInterfaceAlternateSetting(int interface_number,
- int alternate_setting) override;
- virtual bool ResetDevice() override;
- virtual bool GetStringDescriptor(uint8 string_id,
- base::string16* string) override;
-
- virtual void ControlTransfer(UsbEndpointDirection direction,
- TransferRequestType request_type,
- TransferRecipient recipient,
- uint8 request,
- uint16 value,
- uint16 index,
- net::IOBuffer* buffer,
- size_t length,
- unsigned int timeout,
- const UsbTransferCallback& callback) override;
-
- virtual void BulkTransfer(UsbEndpointDirection direction,
- uint8 endpoint,
- net::IOBuffer* buffer,
- size_t length,
- unsigned int timeout,
- const UsbTransferCallback& callback) override;
-
- virtual void InterruptTransfer(UsbEndpointDirection direction,
- uint8 endpoint,
- net::IOBuffer* buffer,
- size_t length,
- unsigned int timeout,
- const UsbTransferCallback& callback) override;
-
- virtual void IsochronousTransfer(
- UsbEndpointDirection direction,
- uint8 endpoint,
- net::IOBuffer* buffer,
- size_t length,
- unsigned int packets,
- unsigned int packet_length,
- unsigned int timeout,
- const UsbTransferCallback& callback) override;
+ scoped_refptr<UsbDevice> GetDevice() const override;
+ void Close() override;
+ bool ClaimInterface(int interface_number) override;
+ bool ReleaseInterface(int interface_number) override;
+ bool SetInterfaceAlternateSetting(int interface_number,
+ int alternate_setting) override;
+ bool ResetDevice() override;
+ bool GetStringDescriptor(uint8 string_id, base::string16* string) override;
+
+ void ControlTransfer(UsbEndpointDirection direction,
+ TransferRequestType request_type,
+ TransferRecipient recipient,
+ uint8 request,
+ uint16 value,
+ uint16 index,
+ net::IOBuffer* buffer,
+ size_t length,
+ unsigned int timeout,
+ const UsbTransferCallback& callback) override;
+
+ void BulkTransfer(UsbEndpointDirection direction,
+ uint8 endpoint,
+ net::IOBuffer* buffer,
+ size_t length,
+ unsigned int timeout,
+ const UsbTransferCallback& callback) override;
+
+ void InterruptTransfer(UsbEndpointDirection direction,
+ uint8 endpoint,
+ net::IOBuffer* buffer,
+ size_t length,
+ unsigned int timeout,
+ const UsbTransferCallback& callback) override;
+
+ void IsochronousTransfer(UsbEndpointDirection direction,
+ uint8 endpoint,
+ net::IOBuffer* buffer,
+ size_t length,
+ unsigned int packets,
+ unsigned int packet_length,
+ unsigned int timeout,
+ const UsbTransferCallback& callback) override;
PlatformUsbDeviceHandle handle() const { return handle_; }
@@ -89,7 +87,7 @@ class UsbDeviceHandleImpl : public UsbDeviceHandle {
PlatformUsbDeviceHandle handle,
const UsbConfigDescriptor& config);
- virtual ~UsbDeviceHandleImpl();
+ ~UsbDeviceHandleImpl() override;
private:
class InterfaceClaimer;
diff --git a/device/usb/usb_device_impl.h b/device/usb/usb_device_impl.h
index 2718998..e962c6d 100644
--- a/device/usb/usb_device_impl.h
+++ b/device/usb/usb_device_impl.h
@@ -36,12 +36,12 @@ class UsbDeviceImpl : public UsbDevice {
int interface_id,
const base::Callback<void(bool success)>& callback) override;
#endif // OS_CHROMEOS
- virtual scoped_refptr<UsbDeviceHandle> Open() override;
- virtual bool Close(scoped_refptr<UsbDeviceHandle> handle) override;
- virtual const UsbConfigDescriptor& GetConfiguration() override;
- virtual bool GetManufacturer(base::string16* manufacturer) override;
- virtual bool GetProduct(base::string16* product) override;
- virtual bool GetSerialNumber(base::string16* serial_number) override;
+ scoped_refptr<UsbDeviceHandle> Open() override;
+ bool Close(scoped_refptr<UsbDeviceHandle> handle) override;
+ const UsbConfigDescriptor& GetConfiguration() override;
+ bool GetManufacturer(base::string16* manufacturer) override;
+ bool GetProduct(base::string16* product) override;
+ bool GetSerialNumber(base::string16* serial_number) override;
protected:
friend class UsbServiceImpl;
@@ -54,7 +54,7 @@ class UsbDeviceImpl : public UsbDevice {
uint16 product_id,
uint32 unique_id);
- virtual ~UsbDeviceImpl();
+ ~UsbDeviceImpl() override;
// Called only by UsbService.
void OnDisconnect();
diff --git a/device/usb/usb_service_impl.cc b/device/usb/usb_service_impl.cc
index e639870..215aba1 100644
--- a/device/usb/usb_service_impl.cc
+++ b/device/usb/usb_service_impl.cc
@@ -34,16 +34,15 @@ class UsbServiceImpl : public UsbService,
explicit UsbServiceImpl(
PlatformUsbContext context,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
- virtual ~UsbServiceImpl();
+ ~UsbServiceImpl() override;
private:
// device::UsbService implementation
- virtual scoped_refptr<UsbDevice> GetDeviceById(uint32 unique_id) override;
- virtual void GetDevices(
- std::vector<scoped_refptr<UsbDevice> >* devices) override;
+ scoped_refptr<UsbDevice> GetDeviceById(uint32 unique_id) override;
+ void GetDevices(std::vector<scoped_refptr<UsbDevice>>* devices) override;
// base::MessageLoop::DestructionObserver implementation.
- virtual void WillDestroyCurrentMessageLoop() override;
+ void WillDestroyCurrentMessageLoop() override;
// Enumerate USB devices from OS and update devices_ map.
void RefreshDevices();