summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-10-22 16:07:52 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-22 23:08:15 +0000
commitb5aaf402eb4783b9f62de3ae8485edec343866cc (patch)
treee9f30bd26479007ce31da6833f81743109eba9b4
parent9cee6105930e94ad2abf2c004efb1d65c0759a0f (diff)
downloadchromium_src-b5aaf402eb4783b9f62de3ae8485edec343866cc.zip
chromium_src-b5aaf402eb4783b9f62de3ae8485edec343866cc.tar.gz
chromium_src-b5aaf402eb4783b9f62de3ae8485edec343866cc.tar.bz2
Standardize usage of virtual/override/final in device/
The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. BUG=417463 TBR=keybuk@chromium.org Review URL: https://codereview.chromium.org/663203007 Cr-Commit-Position: refs/heads/master@{#300790}
-rw-r--r--device/bluetooth/bluetooth_adapter_mac.h56
-rw-r--r--device/bluetooth/bluetooth_adapter_unittest.cc112
-rw-r--r--device/bluetooth/bluetooth_device_mac.h73
-rw-r--r--device/bluetooth/bluetooth_discovery_manager_mac.mm8
-rw-r--r--device/bluetooth/bluetooth_l2cap_channel_mac.h12
-rw-r--r--device/bluetooth/bluetooth_rfcomm_channel_mac.h12
-rw-r--r--device/bluetooth/bluetooth_socket_mac.h25
-rw-r--r--device/bluetooth/bluetooth_socket_net.h21
-rw-r--r--device/hid/hid_connection_mac.h23
-rw-r--r--device/hid/hid_service.cc4
-rw-r--r--device/hid/hid_service_mac.h6
-rw-r--r--device/nfc/nfc_tag_technology.h4
-rw-r--r--device/serial/data_receiver.cc10
-rw-r--r--device/serial/data_receiver.h6
-rw-r--r--device/serial/data_sender.h8
-rw-r--r--device/serial/data_sink_receiver.cc10
-rw-r--r--device/serial/data_sink_receiver.h8
-rw-r--r--device/serial/data_source_sender.cc10
-rw-r--r--device/serial/data_source_sender.h8
-rw-r--r--device/serial/serial_connection.h20
-rw-r--r--device/serial/serial_connection_unittest.cc4
-rw-r--r--device/serial/serial_device_enumerator_mac.h4
-rw-r--r--device/serial/serial_io_handler_posix.h28
-rw-r--r--device/serial/serial_service_impl.h18
-rw-r--r--device/serial/serial_service_unittest.cc10
-rw-r--r--device/serial/test_serial_io_handler.h25
-rw-r--r--device/test/usb_test_gadget_impl.cc18
-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
32 files changed, 304 insertions, 356 deletions
diff --git a/device/bluetooth/bluetooth_adapter_mac.h b/device/bluetooth/bluetooth_adapter_mac.h
index 7f1cc51..38002eb 100644
--- a/device/bluetooth/bluetooth_adapter_mac.h
+++ b/device/bluetooth/bluetooth_adapter_mac.h
@@ -38,62 +38,58 @@ class BluetoothAdapterMac : public BluetoothAdapter,
static base::WeakPtr<BluetoothAdapter> CreateAdapter();
// BluetoothAdapter:
- virtual void AddObserver(BluetoothAdapter::Observer* observer) override;
- virtual void RemoveObserver(BluetoothAdapter::Observer* observer) override;
- virtual std::string GetAddress() const override;
- virtual std::string GetName() const override;
- virtual void SetName(const std::string& name,
+ void AddObserver(BluetoothAdapter::Observer* observer) override;
+ void RemoveObserver(BluetoothAdapter::Observer* observer) override;
+ std::string GetAddress() const override;
+ std::string GetName() const override;
+ void SetName(const std::string& name,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
+ bool IsInitialized() const override;
+ bool IsPresent() const override;
+ bool IsPowered() const override;
+ void SetPowered(bool powered,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
+ bool IsDiscoverable() const override;
+ void SetDiscoverable(bool discoverable,
const base::Closure& callback,
const ErrorCallback& error_callback) override;
- virtual bool IsInitialized() const override;
- virtual bool IsPresent() const override;
- virtual bool IsPowered() const override;
- virtual void SetPowered(
- bool powered,
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
- virtual bool IsDiscoverable() const override;
- virtual void SetDiscoverable(
- bool discoverable,
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
- virtual bool IsDiscovering() const override;
- virtual void CreateRfcommService(
+ bool IsDiscovering() const override;
+ void CreateRfcommService(
const BluetoothUUID& uuid,
const ServiceOptions& options,
const CreateServiceCallback& callback,
const CreateServiceErrorCallback& error_callback) override;
- virtual void CreateL2capService(
+ void CreateL2capService(
const BluetoothUUID& uuid,
const ServiceOptions& options,
const CreateServiceCallback& callback,
const CreateServiceErrorCallback& error_callback) override;
// BluetoothDiscoveryManagerMac::Observer overrides
- virtual void DeviceFound(IOBluetoothDevice* device) override;
- virtual void DiscoveryStopped(bool unexpected) override;
+ void DeviceFound(IOBluetoothDevice* device) override;
+ void DiscoveryStopped(bool unexpected) override;
// Registers that a new |device| has connected to the local host.
void DeviceConnected(IOBluetoothDevice* device);
protected:
// BluetoothAdapter:
- virtual void RemovePairingDelegateInternal(
+ void RemovePairingDelegateInternal(
device::BluetoothDevice::PairingDelegate* pairing_delegate) override;
private:
friend class BluetoothAdapterMacTest;
BluetoothAdapterMac();
- virtual ~BluetoothAdapterMac();
+ ~BluetoothAdapterMac() override;
// BluetoothAdapter:
- virtual void AddDiscoverySession(
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
- virtual void RemoveDiscoverySession(
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
+ void AddDiscoverySession(const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
+ void RemoveDiscoverySession(const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
void Init();
void InitForTest(scoped_refptr<base::SequencedTaskRunner> ui_task_runner);
diff --git a/device/bluetooth/bluetooth_adapter_unittest.cc b/device/bluetooth/bluetooth_adapter_unittest.cc
index 88d94c9..8e9e114 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -17,108 +17,74 @@ class TestBluetoothAdapter : public BluetoothAdapter {
TestBluetoothAdapter() {
}
- virtual void AddObserver(BluetoothAdapter::Observer* observer) override {
- }
+ void AddObserver(BluetoothAdapter::Observer* observer) override {}
- virtual void RemoveObserver(BluetoothAdapter::Observer* observer) override {
+ void RemoveObserver(BluetoothAdapter::Observer* observer) override {}
- }
+ std::string GetAddress() const override { return ""; }
- virtual std::string GetAddress() const override {
- return "";
- }
+ std::string GetName() const override { return ""; }
- virtual std::string GetName() const override {
- return "";
- }
+ void SetName(const std::string& name,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {}
- virtual void SetName(const std::string& name,
- const base::Closure& callback,
- const ErrorCallback& error_callback) override {
- }
+ bool IsInitialized() const override { return false; }
- virtual bool IsInitialized() const override {
- return false;
- }
+ bool IsPresent() const override { return false; }
- virtual bool IsPresent() const override {
- return false;
- }
+ bool IsPowered() const override { return false; }
- virtual bool IsPowered() const override {
- return false;
- }
+ void SetPowered(bool powered,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {}
- virtual void SetPowered(
- bool powered,
- const base::Closure& callback,
- const ErrorCallback& error_callback) override {
- }
+ bool IsDiscoverable() const override { return false; }
- virtual bool IsDiscoverable() const override {
- return false;
- }
+ void SetDiscoverable(bool discoverable,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {}
- virtual void SetDiscoverable(
- bool discoverable,
- const base::Closure& callback,
- const ErrorCallback& error_callback) override {
- }
+ bool IsDiscovering() const override { return false; }
- virtual bool IsDiscovering() const override {
- return false;
- }
-
- virtual void StartDiscoverySession(
- const DiscoverySessionCallback& callback,
- const ErrorCallback& error_callback) override {
- }
+ void StartDiscoverySession(const DiscoverySessionCallback& callback,
+ const ErrorCallback& error_callback) override {}
- virtual void CreateRfcommService(
+ void CreateRfcommService(
const BluetoothUUID& uuid,
const ServiceOptions& options,
const CreateServiceCallback& callback,
- const CreateServiceErrorCallback& error_callback) override {
- }
+ const CreateServiceErrorCallback& error_callback) override {}
- virtual void CreateL2capService(
+ void CreateL2capService(
const BluetoothUUID& uuid,
const ServiceOptions& options,
const CreateServiceCallback& callback,
- const CreateServiceErrorCallback& error_callback) override {
- }
+ const CreateServiceErrorCallback& error_callback) override {}
protected:
- virtual ~TestBluetoothAdapter() {}
+ ~TestBluetoothAdapter() override {}
- virtual void AddDiscoverySession(
- const base::Closure& callback,
- const ErrorCallback& error_callback) override {
- }
+ void AddDiscoverySession(const base::Closure& callback,
+ const ErrorCallback& error_callback) override {}
- virtual void RemoveDiscoverySession(
- const base::Closure& callback,
- const ErrorCallback& error_callback) override {
- }
+ void RemoveDiscoverySession(const base::Closure& callback,
+ const ErrorCallback& error_callback) override {}
- virtual void RemovePairingDelegateInternal(
- BluetoothDevice::PairingDelegate* pairing_delegate) override {
- }
+ void RemovePairingDelegateInternal(
+ BluetoothDevice::PairingDelegate* pairing_delegate) override {}
};
class TestPairingDelegate : public BluetoothDevice::PairingDelegate {
public:
- virtual void RequestPinCode(BluetoothDevice* device) override {}
- virtual void RequestPasskey(BluetoothDevice* device) override {}
- virtual void DisplayPinCode(BluetoothDevice* device,
- const std::string& pincode) override {}
- virtual void DisplayPasskey(BluetoothDevice* device,
- uint32 passkey) override {}
- virtual void KeysEntered(BluetoothDevice* device,
- uint32 entered) override {}
- virtual void ConfirmPasskey(BluetoothDevice* device,
- uint32 passkey) override {}
- virtual void AuthorizePairing(BluetoothDevice* device) override {}
+ void RequestPinCode(BluetoothDevice* device) override {}
+ void RequestPasskey(BluetoothDevice* device) override {}
+ void DisplayPinCode(BluetoothDevice* device,
+ const std::string& pincode) override {}
+ void DisplayPasskey(BluetoothDevice* device, uint32 passkey) override {}
+ void KeysEntered(BluetoothDevice* device, uint32 entered) override {}
+ void ConfirmPasskey(BluetoothDevice* device, uint32 passkey) override {}
+ void AuthorizePairing(BluetoothDevice* device) override {}
};
diff --git a/device/bluetooth/bluetooth_device_mac.h b/device/bluetooth/bluetooth_device_mac.h
index 299fe91..8f0ed08 100644
--- a/device/bluetooth/bluetooth_device_mac.h
+++ b/device/bluetooth/bluetooth_device_mac.h
@@ -21,53 +21,50 @@ namespace device {
class BluetoothDeviceMac : public BluetoothDevice {
public:
explicit BluetoothDeviceMac(IOBluetoothDevice* device);
- virtual ~BluetoothDeviceMac();
+ ~BluetoothDeviceMac() override;
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const override;
- virtual std::string GetAddress() const override;
- virtual VendorIDSource GetVendorIDSource() const override;
- virtual uint16 GetVendorID() const override;
- virtual uint16 GetProductID() const override;
- virtual uint16 GetDeviceID() const override;
- virtual int GetRSSI() const override;
- virtual int GetCurrentHostTransmitPower() const override;
- virtual int GetMaximumHostTransmitPower() const override;
- virtual bool IsPaired() const override;
- virtual bool IsConnected() const override;
- virtual bool IsConnectable() const override;
- virtual bool IsConnecting() const override;
- virtual UUIDList GetUUIDs() const override;
- virtual bool ExpectingPinCode() const override;
- virtual bool ExpectingPasskey() const override;
- virtual bool ExpectingConfirmation() const override;
- virtual void Connect(
- PairingDelegate* pairing_delegate,
- const base::Closure& callback,
- const ConnectErrorCallback& error_callback) override;
- virtual void SetPinCode(const std::string& pincode) override;
- virtual void SetPasskey(uint32 passkey) override;
- virtual void ConfirmPairing() override;
- virtual void RejectPairing() override;
- virtual void CancelPairing() override;
- virtual void Disconnect(
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
- virtual void Forget(const ErrorCallback& error_callback) override;
- virtual void ConnectToService(
+ uint32 GetBluetoothClass() const override;
+ std::string GetAddress() const override;
+ VendorIDSource GetVendorIDSource() const override;
+ uint16 GetVendorID() const override;
+ uint16 GetProductID() const override;
+ uint16 GetDeviceID() const override;
+ int GetRSSI() const override;
+ int GetCurrentHostTransmitPower() const override;
+ int GetMaximumHostTransmitPower() const override;
+ bool IsPaired() const override;
+ bool IsConnected() const override;
+ bool IsConnectable() const override;
+ bool IsConnecting() const override;
+ UUIDList GetUUIDs() const override;
+ bool ExpectingPinCode() const override;
+ bool ExpectingPasskey() const override;
+ bool ExpectingConfirmation() const override;
+ void Connect(PairingDelegate* pairing_delegate,
+ const base::Closure& callback,
+ const ConnectErrorCallback& error_callback) override;
+ void SetPinCode(const std::string& pincode) override;
+ void SetPasskey(uint32 passkey) override;
+ void ConfirmPairing() override;
+ void RejectPairing() override;
+ void CancelPairing() override;
+ void Disconnect(const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
+ void Forget(const ErrorCallback& error_callback) override;
+ void ConnectToService(
const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) override;
- virtual void ConnectToServiceInsecurely(
+ void ConnectToServiceInsecurely(
const BluetoothUUID& uuid,
const ConnectToServiceCallback& callback,
const ConnectToServiceErrorCallback& error_callback) override;
- virtual void CreateGattConnection(
+ void CreateGattConnection(
const GattConnectionCallback& callback,
const ConnectErrorCallback& error_callback) override;
- virtual void StartConnectionMonitor(
- const base::Closure& callback,
- const ErrorCallback& error_callback) override;
+ void StartConnectionMonitor(const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
// Returns the timestamp when the device was last seen during an inquiry.
// Returns nil if the device has never been seen during an inquiry.
@@ -79,7 +76,7 @@ class BluetoothDeviceMac : public BluetoothDevice {
protected:
// BluetoothDevice override
- virtual std::string GetDeviceName() const override;
+ std::string GetDeviceName() const override;
private:
friend class BluetoothAdapterMac;
diff --git a/device/bluetooth/bluetooth_discovery_manager_mac.mm b/device/bluetooth/bluetooth_discovery_manager_mac.mm
index abc9cd8..1555c6f 100644
--- a/device/bluetooth/bluetooth_discovery_manager_mac.mm
+++ b/device/bluetooth/bluetooth_discovery_manager_mac.mm
@@ -44,13 +44,13 @@ class BluetoothDiscoveryManagerMacClassic
inquiry_([[IOBluetoothDeviceInquiry alloc]
initWithDelegate:inquiry_delegate_]) {}
- virtual ~BluetoothDiscoveryManagerMacClassic() {}
+ ~BluetoothDiscoveryManagerMacClassic() override {}
// BluetoothDiscoveryManagerMac override.
- virtual bool IsDiscovering() const override { return should_do_discovery_; }
+ bool IsDiscovering() const override { return should_do_discovery_; }
// BluetoothDiscoveryManagerMac override.
- virtual bool StartDiscovery() override {
+ bool StartDiscovery() override {
DVLOG(1) << "Bluetooth Classic: StartDiscovery";
DCHECK(!should_do_discovery_);
@@ -78,7 +78,7 @@ class BluetoothDiscoveryManagerMacClassic
}
// BluetoothDiscoveryManagerMac override.
- virtual bool StopDiscovery() override {
+ bool StopDiscovery() override {
DVLOG(1) << "Bluetooth Classic: StopDiscovery";
DCHECK(should_do_discovery_);
diff --git a/device/bluetooth/bluetooth_l2cap_channel_mac.h b/device/bluetooth/bluetooth_l2cap_channel_mac.h
index eafe8f5..de085e6 100644
--- a/device/bluetooth/bluetooth_l2cap_channel_mac.h
+++ b/device/bluetooth/bluetooth_l2cap_channel_mac.h
@@ -24,7 +24,7 @@ class BluetoothL2capChannelMac : public BluetoothChannelMac {
// NOTE: The |channel| is expected to already be retained.
BluetoothL2capChannelMac(BluetoothSocketMac* socket,
IOBluetoothL2CAPChannel* channel);
- virtual ~BluetoothL2capChannelMac();
+ ~BluetoothL2capChannelMac() override;
// Opens a new L2CAP channel with Channel ID |channel_id| to the target
// |device|. Returns the opened channel and sets |status| to kIOReturnSuccess
@@ -37,12 +37,10 @@ class BluetoothL2capChannelMac : public BluetoothChannelMac {
IOReturn* status);
// BluetoothChannelMac:
- virtual void SetSocket(BluetoothSocketMac* socket) override;
- virtual IOBluetoothDevice* GetDevice() override;
- virtual uint16_t GetOutgoingMTU() override;
- virtual IOReturn WriteAsync(void* data,
- uint16_t length,
- void* refcon) override;
+ void SetSocket(BluetoothSocketMac* socket) override;
+ IOBluetoothDevice* GetDevice() override;
+ uint16_t GetOutgoingMTU() override;
+ IOReturn WriteAsync(void* data, uint16_t length, void* refcon) override;
void OnChannelOpenComplete(IOBluetoothL2CAPChannel* channel,
IOReturn status);
diff --git a/device/bluetooth/bluetooth_rfcomm_channel_mac.h b/device/bluetooth/bluetooth_rfcomm_channel_mac.h
index 665e2d3..5f98f27 100644
--- a/device/bluetooth/bluetooth_rfcomm_channel_mac.h
+++ b/device/bluetooth/bluetooth_rfcomm_channel_mac.h
@@ -24,7 +24,7 @@ class BluetoothRfcommChannelMac : public BluetoothChannelMac {
// NOTE: The |channel| is expected to already be retained.
BluetoothRfcommChannelMac(BluetoothSocketMac* socket,
IOBluetoothRFCOMMChannel* channel);
- virtual ~BluetoothRfcommChannelMac();
+ ~BluetoothRfcommChannelMac() override;
// Opens a new RFCOMM channel with Channel ID |channel_id| to the target
// |device|. Returns the opened channel and sets |status| to kIOReturnSuccess
@@ -37,12 +37,10 @@ class BluetoothRfcommChannelMac : public BluetoothChannelMac {
IOReturn* status);
// BluetoothChannelMac:
- virtual void SetSocket(BluetoothSocketMac* socket) override;
- virtual IOBluetoothDevice* GetDevice() override;
- virtual uint16_t GetOutgoingMTU() override;
- virtual IOReturn WriteAsync(void* data,
- uint16_t length,
- void* refcon) override;
+ void SetSocket(BluetoothSocketMac* socket) override;
+ IOBluetoothDevice* GetDevice() override;
+ uint16_t GetOutgoingMTU() override;
+ IOReturn WriteAsync(void* data, uint16_t length, void* refcon) override;
void OnChannelOpenComplete(IOBluetoothRFCOMMChannel* channel,
IOReturn status);
diff --git a/device/bluetooth/bluetooth_socket_mac.h b/device/bluetooth/bluetooth_socket_mac.h
index f51f252..768b850 100644
--- a/device/bluetooth/bluetooth_socket_mac.h
+++ b/device/bluetooth/bluetooth_socket_mac.h
@@ -75,18 +75,17 @@ class BluetoothSocketMac : public BluetoothSocket {
const ErrorCompletionCallback& error_callback);
// BluetoothSocket:
- virtual void Close() override;
- virtual void Disconnect(const base::Closure& callback) override;
- virtual void Receive(
- int /* buffer_size */,
- const ReceiveCompletionCallback& success_callback,
- const ReceiveErrorCompletionCallback& error_callback) override;
- virtual void Send(scoped_refptr<net::IOBuffer> buffer,
- int buffer_size,
- const SendCompletionCallback& success_callback,
- const ErrorCompletionCallback& error_callback) override;
- virtual void Accept(const AcceptCompletionCallback& success_callback,
- const ErrorCompletionCallback& error_callback) override;
+ void Close() override;
+ void Disconnect(const base::Closure& callback) override;
+ void Receive(int /* buffer_size */,
+ const ReceiveCompletionCallback& success_callback,
+ const ReceiveErrorCompletionCallback& error_callback) override;
+ void Send(scoped_refptr<net::IOBuffer> buffer,
+ int buffer_size,
+ const SendCompletionCallback& success_callback,
+ const ErrorCompletionCallback& error_callback) override;
+ void Accept(const AcceptCompletionCallback& success_callback,
+ const ErrorCompletionCallback& error_callback) override;
// Callback that is invoked when the OS completes an SDP query.
// |status| is the returned status from the SDP query, |device| is the
@@ -145,7 +144,7 @@ class BluetoothSocketMac : public BluetoothSocket {
};
BluetoothSocketMac();
- virtual ~BluetoothSocketMac();
+ ~BluetoothSocketMac() override;
// Accepts a single incoming connection.
void AcceptConnectionRequest();
diff --git a/device/bluetooth/bluetooth_socket_net.h b/device/bluetooth/bluetooth_socket_net.h
index ed6323a..7411776 100644
--- a/device/bluetooth/bluetooth_socket_net.h
+++ b/device/bluetooth/bluetooth_socket_net.h
@@ -31,21 +31,20 @@ namespace device {
class BluetoothSocketNet : public BluetoothSocket {
public:
// BluetoothSocket:
- virtual void Close() override;
- virtual void Disconnect(const base::Closure& callback) override;
- virtual void Receive(int buffer_size,
- const ReceiveCompletionCallback& success_callback,
- const ReceiveErrorCompletionCallback& error_callback)
- override;
- virtual void Send(scoped_refptr<net::IOBuffer> buffer,
- int buffer_size,
- const SendCompletionCallback& success_callback,
- const ErrorCompletionCallback& error_callback) override;
+ void Close() override;
+ void Disconnect(const base::Closure& callback) override;
+ void Receive(int buffer_size,
+ const ReceiveCompletionCallback& success_callback,
+ const ReceiveErrorCompletionCallback& error_callback) override;
+ void Send(scoped_refptr<net::IOBuffer> buffer,
+ int buffer_size,
+ const SendCompletionCallback& success_callback,
+ const ErrorCompletionCallback& error_callback) override;
protected:
BluetoothSocketNet(scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
scoped_refptr<BluetoothSocketThread> socket_thread);
- virtual ~BluetoothSocketNet();
+ ~BluetoothSocketNet() override;
// Resets locally held data after a socket is closed. Default implementation
// does nothing, subclasses may override.
diff --git a/device/hid/hid_connection_mac.h b/device/hid/hid_connection_mac.h
index 2da606d..daac83b 100644
--- a/device/hid/hid_connection_mac.h
+++ b/device/hid/hid_connection_mac.h
@@ -32,20 +32,19 @@ class HidConnectionMac : public HidConnection {
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
private:
- virtual ~HidConnectionMac();
+ ~HidConnectionMac() override;
// HidConnection implementation.
- virtual void PlatformClose() override;
- virtual void PlatformRead(const ReadCallback& callback) override;
- virtual void PlatformWrite(scoped_refptr<net::IOBuffer> buffer,
- size_t size,
- const WriteCallback& callback) override;
- virtual void PlatformGetFeatureReport(uint8_t report_id,
- const ReadCallback& callback) override;
- virtual void PlatformSendFeatureReport(
- scoped_refptr<net::IOBuffer> buffer,
- size_t size,
- const WriteCallback& callback) override;
+ void PlatformClose() override;
+ void PlatformRead(const ReadCallback& callback) override;
+ void PlatformWrite(scoped_refptr<net::IOBuffer> buffer,
+ size_t size,
+ const WriteCallback& callback) override;
+ void PlatformGetFeatureReport(uint8_t report_id,
+ const ReadCallback& callback) override;
+ void PlatformSendFeatureReport(scoped_refptr<net::IOBuffer> buffer,
+ size_t size,
+ const WriteCallback& callback) override;
static void InputReportCallback(void* context,
IOReturn result,
diff --git a/device/hid/hid_service.cc b/device/hid/hid_service.cc
index 12ea582..d2ccaa3 100644
--- a/device/hid/hid_service.cc
+++ b/device/hid/hid_service.cc
@@ -30,11 +30,11 @@ class HidService::Destroyer : public base::MessageLoop::DestructionObserver {
public:
explicit Destroyer(HidService* hid_service)
: hid_service_(hid_service) {}
- virtual ~Destroyer() {}
+ ~Destroyer() override {}
private:
// base::MessageLoop::DestructionObserver implementation.
- virtual void WillDestroyCurrentMessageLoop() override {
+ void WillDestroyCurrentMessageLoop() override {
base::MessageLoop::current()->RemoveDestructionObserver(this);
delete hid_service_;
delete this;
diff --git a/device/hid/hid_service_mac.h b/device/hid/hid_service_mac.h
index 44f63d4..bfb58bd 100644
--- a/device/hid/hid_service_mac.h
+++ b/device/hid/hid_service_mac.h
@@ -27,11 +27,11 @@ class HidServiceMac : public HidService {
public:
HidServiceMac(scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
- virtual void Connect(const HidDeviceId& device_id,
- const ConnectCallback& connect) override;
+ void Connect(const HidDeviceId& device_id,
+ const ConnectCallback& connect) override;
private:
- virtual ~HidServiceMac();
+ ~HidServiceMac() override;
// IOService matching callbacks.
static void FirstMatchCallback(void* context, io_iterator_t iterator);
diff --git a/device/nfc/nfc_tag_technology.h b/device/nfc/nfc_tag_technology.h
index 45b3146..8ada39b 100644
--- a/device/nfc/nfc_tag_technology.h
+++ b/device/nfc/nfc_tag_technology.h
@@ -71,7 +71,7 @@ class NfcNdefTagTechnology : public NfcTagTechnology {
// The ErrorCallback is used by methods to asynchronously report errors.
typedef base::Closure ErrorCallback;
- virtual ~NfcNdefTagTechnology();
+ ~NfcNdefTagTechnology() override;
// Interface for observing changes from NFC tags related to NDEF records.
class Observer {
@@ -93,7 +93,7 @@ class NfcNdefTagTechnology : public NfcTagTechnology {
virtual void RemoveObserver(Observer* observer) = 0;
// NfcTagTechnology override.
- virtual bool IsSupportedByTag() const override;
+ bool IsSupportedByTag() const override;
// Returns all NDEF records that were received from the tag in the form of an
// NDEF message. If the returned NDEF message contains no records, this only
diff --git a/device/serial/data_receiver.cc b/device/serial/data_receiver.cc
index b6e44a9..d7a47fa 100644
--- a/device/serial/data_receiver.cc
+++ b/device/serial/data_receiver.cc
@@ -63,13 +63,13 @@ class DataReceiver::PendingReceive::Buffer : public ReadOnlyBuffer {
PendingReceive* receive,
const char* buffer,
uint32_t buffer_size);
- virtual ~Buffer();
+ ~Buffer() override;
// ReadOnlyBuffer overrides.
- virtual const char* GetData() override;
- virtual uint32_t GetSize() override;
- virtual void Done(uint32_t bytes_consumed) override;
- virtual void DoneWithError(uint32_t bytes_consumed, int32_t error) override;
+ const char* GetData() override;
+ uint32_t GetSize() override;
+ void Done(uint32_t bytes_consumed) override;
+ void DoneWithError(uint32_t bytes_consumed, int32_t error) override;
private:
// The DataReceiver whose data pipe we are providing a view.
diff --git a/device/serial/data_receiver.h b/device/serial/data_receiver.h
index df37018..79121f7 100644
--- a/device/serial/data_receiver.h
+++ b/device/serial/data_receiver.h
@@ -43,14 +43,14 @@ class DataReceiver : public base::RefCounted<DataReceiver>,
struct PendingError;
friend class base::RefCounted<DataReceiver>;
- virtual ~DataReceiver();
+ ~DataReceiver() override;
// serial::DataSourceClient override. Invoked by the DataSource to report
// errors.
- virtual void OnError(uint32_t bytes_since_last_error, int32_t error) override;
+ void OnError(uint32_t bytes_since_last_error, int32_t error) override;
// mojo::ErrorHandler override. Calls ShutDown().
- virtual void OnConnectionError() override;
+ void OnConnectionError() override;
// Invoked by the PendingReceive to report that the user is done with the
// receive buffer, having read |bytes_read| bytes from it.
diff --git a/device/serial/data_sender.h b/device/serial/data_sender.h
index 6e5c89e..89f729c 100644
--- a/device/serial/data_sender.h
+++ b/device/serial/data_sender.h
@@ -33,7 +33,7 @@ class DataSender : public serial::DataSinkClient, public mojo::ErrorHandler {
uint32_t buffer_size,
int32_t fatal_error_value);
- virtual ~DataSender();
+ ~DataSender() override;
// Starts an asynchronous send of |data|. If the send completes successfully,
// |callback| will be called. Otherwise, |error_callback| will be called with
@@ -53,14 +53,14 @@ class DataSender : public serial::DataSinkClient, public mojo::ErrorHandler {
class PendingSend;
// serial::DataSinkClient overrides.
- virtual void ReportBytesSent(uint32_t bytes_sent) override;
- virtual void ReportBytesSentAndError(
+ void ReportBytesSent(uint32_t bytes_sent) override;
+ void ReportBytesSentAndError(
uint32_t bytes_sent,
int32_t error,
const mojo::Callback<void(uint32_t)>& callback) override;
// mojo::ErrorHandler override.
- virtual void OnConnectionError() override;
+ void OnConnectionError() override;
// Copies data from |pending_sends_| into the data pipe and starts |waiter_|
// waiting if the pipe is full. When a PendingSend in |pending_sends_| has
diff --git a/device/serial/data_sink_receiver.cc b/device/serial/data_sink_receiver.cc
index 767f036..3d52e48 100644
--- a/device/serial/data_sink_receiver.cc
+++ b/device/serial/data_sink_receiver.cc
@@ -44,15 +44,15 @@ class DataSinkReceiver::Buffer : public ReadOnlyBuffer {
Buffer(scoped_refptr<DataSinkReceiver> receiver,
const char* buffer,
uint32_t buffer_size);
- virtual ~Buffer();
+ ~Buffer() override;
void Cancel(int32_t error);
// ReadOnlyBuffer overrides.
- virtual const char* GetData() override;
- virtual uint32_t GetSize() override;
- virtual void Done(uint32_t bytes_read) override;
- virtual void DoneWithError(uint32_t bytes_read, int32_t error) override;
+ const char* GetData() override;
+ uint32_t GetSize() override;
+ void Done(uint32_t bytes_read) override;
+ void DoneWithError(uint32_t bytes_read, int32_t error) override;
private:
// The DataSinkReceiver whose data pipe we are providing a view.
diff --git a/device/serial/data_sink_receiver.h b/device/serial/data_sink_receiver.h
index 75d85e6..711650b 100644
--- a/device/serial/data_sink_receiver.h
+++ b/device/serial/data_sink_receiver.h
@@ -46,12 +46,12 @@ class DataSinkReceiver : public base::RefCounted<DataSinkReceiver>,
class PendingFlush;
friend class base::RefCounted<DataSinkReceiver>;
- virtual ~DataSinkReceiver();
+ ~DataSinkReceiver() override;
// mojo::InterfaceImpl<serial::DataSink> overrides.
- virtual void Init(mojo::ScopedDataPipeConsumerHandle handle) override;
- virtual void Cancel(int32_t error) override;
- virtual void OnConnectionError() override;
+ void Init(mojo::ScopedDataPipeConsumerHandle handle) override;
+ void Cancel(int32_t error) override;
+ void OnConnectionError() override;
// Starts waiting for |handle_| to be ready for reads.
void StartWaiting();
diff --git a/device/serial/data_source_sender.cc b/device/serial/data_source_sender.cc
index 4eaee75..0738e3c 100644
--- a/device/serial/data_source_sender.cc
+++ b/device/serial/data_source_sender.cc
@@ -49,13 +49,13 @@ class DataSourceSender::PendingSend::Buffer : public WritableBuffer {
PendingSend* send,
char* buffer,
uint32_t buffer_size);
- virtual ~Buffer();
+ ~Buffer() override;
// WritableBuffer overrides.
- virtual char* GetData() override;
- virtual uint32_t GetSize() override;
- virtual void Done(uint32_t bytes_written) override;
- virtual void DoneWithError(uint32_t bytes_written, int32_t error) override;
+ char* GetData() override;
+ uint32_t GetSize() override;
+ void Done(uint32_t bytes_written) override;
+ void DoneWithError(uint32_t bytes_written, int32_t error) override;
private:
// The DataSourceSender whose data pipe we are providing a view.
diff --git a/device/serial/data_source_sender.h b/device/serial/data_source_sender.h
index 59782aa..9020a97 100644
--- a/device/serial/data_source_sender.h
+++ b/device/serial/data_source_sender.h
@@ -38,13 +38,13 @@ class DataSourceSender : public base::RefCounted<DataSourceSender>,
friend class base::RefCounted<DataSourceSender>;
class PendingSend;
- virtual ~DataSourceSender();
+ ~DataSourceSender() override;
// mojo::InterfaceImpl<serial::DataSourceSender> overrides.
- virtual void Init(mojo::ScopedDataPipeProducerHandle handle) override;
- virtual void Resume() override;
+ void Init(mojo::ScopedDataPipeProducerHandle handle) override;
+ void Resume() override;
// Invoked in the event of a connection error. Calls DispatchFatalError().
- virtual void OnConnectionError() override;
+ void OnConnectionError() override;
// Starts waiting for |handle_| to be ready for writes.
void StartWaiting();
diff --git a/device/serial/serial_connection.h b/device/serial/serial_connection.h
index c578a9d..66f9c54 100644
--- a/device/serial/serial_connection.h
+++ b/device/serial/serial_connection.h
@@ -23,19 +23,19 @@ class SerialConnection : public mojo::InterfaceImpl<serial::Connection> {
SerialConnection(scoped_refptr<SerialIoHandler> io_handler,
mojo::InterfaceRequest<serial::DataSink> sink,
mojo::InterfaceRequest<serial::DataSource> source);
- virtual ~SerialConnection();
+ ~SerialConnection() override;
// mojo::InterfaceImpl<serial::Connection> overrides.
- virtual void GetInfo(
+ void GetInfo(
const mojo::Callback<void(serial::ConnectionInfoPtr)>& callback) override;
- virtual void SetOptions(serial::ConnectionOptionsPtr options,
- const mojo::Callback<void(bool)>& callback) override;
- virtual void SetControlSignals(
- serial::HostControlSignalsPtr signals,
- const mojo::Callback<void(bool)>& callback) override;
- virtual void GetControlSignals(const mojo::Callback<
- void(serial::DeviceControlSignalsPtr)>& callback) override;
- virtual void Flush(const mojo::Callback<void(bool)>& callback) override;
+ void SetOptions(serial::ConnectionOptionsPtr options,
+ const mojo::Callback<void(bool)>& callback) override;
+ void SetControlSignals(serial::HostControlSignalsPtr signals,
+ const mojo::Callback<void(bool)>& callback) override;
+ void GetControlSignals(
+ const mojo::Callback<void(serial::DeviceControlSignalsPtr)>& callback)
+ override;
+ void Flush(const mojo::Callback<void(bool)>& callback) override;
private:
void OnSendPipeReady(scoped_ptr<ReadOnlyBuffer> buffer);
diff --git a/device/serial/serial_connection_unittest.cc b/device/serial/serial_connection_unittest.cc
index b18e95e..4b69158e 100644
--- a/device/serial/serial_connection_unittest.cc
+++ b/device/serial/serial_connection_unittest.cc
@@ -24,7 +24,7 @@ namespace device {
namespace {
class FakeSerialDeviceEnumerator : public SerialDeviceEnumerator {
- virtual mojo::Array<serial::DeviceInfoPtr> GetDevices() override {
+ mojo::Array<serial::DeviceInfoPtr> GetDevices() override {
mojo::Array<serial::DeviceInfoPtr> devices(1);
devices[0] = serial::DeviceInfo::New();
devices[0]->path = "device";
@@ -168,7 +168,7 @@ class SerialConnectionTest : public testing::Test, public mojo::ErrorHandler {
EventReceived(EVENT_RECEIVE_ERROR);
}
- virtual void OnConnectionError() override {
+ void OnConnectionError() override {
EventReceived(EVENT_ERROR);
FAIL() << "Connection error";
}
diff --git a/device/serial/serial_device_enumerator_mac.h b/device/serial/serial_device_enumerator_mac.h
index ad4d674..125b4bf 100644
--- a/device/serial/serial_device_enumerator_mac.h
+++ b/device/serial/serial_device_enumerator_mac.h
@@ -13,10 +13,10 @@ namespace device {
class SerialDeviceEnumeratorMac : public SerialDeviceEnumerator {
public:
SerialDeviceEnumeratorMac();
- virtual ~SerialDeviceEnumeratorMac();
+ ~SerialDeviceEnumeratorMac() override;
// Implementation for SerialDeviceEnumerator.
- virtual mojo::Array<serial::DeviceInfoPtr> GetDevices() override;
+ mojo::Array<serial::DeviceInfoPtr> GetDevices() override;
private:
DISALLOW_COPY_AND_ASSIGN(SerialDeviceEnumeratorMac);
diff --git a/device/serial/serial_io_handler_posix.h b/device/serial/serial_io_handler_posix.h
index 7a6d97c..aacd883 100644
--- a/device/serial/serial_io_handler_posix.h
+++ b/device/serial/serial_io_handler_posix.h
@@ -14,21 +14,21 @@ class SerialIoHandlerPosix : public SerialIoHandler,
public base::MessageLoopForIO::Watcher {
protected:
// SerialIoHandler impl.
- virtual void ReadImpl() override;
- virtual void WriteImpl() override;
- virtual void CancelReadImpl() override;
- virtual void CancelWriteImpl() override;
- virtual bool Flush() const override;
- virtual serial::DeviceControlSignalsPtr GetControlSignals() const override;
- virtual bool SetControlSignals(
+ void ReadImpl() override;
+ void WriteImpl() override;
+ void CancelReadImpl() override;
+ void CancelWriteImpl() override;
+ bool Flush() const override;
+ serial::DeviceControlSignalsPtr GetControlSignals() const override;
+ bool SetControlSignals(
const serial::HostControlSignals& control_signals) override;
- virtual bool ConfigurePort(const serial::ConnectionOptions& options) override;
- virtual serial::ConnectionInfoPtr GetPortInfo() const override;
- virtual void RequestAccess(
+ bool ConfigurePort(const serial::ConnectionOptions& options) override;
+ serial::ConnectionInfoPtr GetPortInfo() const override;
+ void RequestAccess(
const std::string& port,
scoped_refptr<base::MessageLoopProxy> file_message_loop,
scoped_refptr<base::MessageLoopProxy> ui_message_loop) override;
- virtual bool PostOpen() override;
+ bool PostOpen() override;
private:
friend class SerialIoHandler;
@@ -36,11 +36,11 @@ class SerialIoHandlerPosix : public SerialIoHandler,
SerialIoHandlerPosix(
scoped_refptr<base::MessageLoopProxy> file_thread_message_loop,
scoped_refptr<base::MessageLoopProxy> ui_thread_message_loop);
- virtual ~SerialIoHandlerPosix();
+ ~SerialIoHandlerPosix() override;
// base::MessageLoopForIO::Watcher implementation.
- virtual void OnFileCanWriteWithoutBlocking(int fd) override;
- virtual void OnFileCanReadWithoutBlocking(int fd) override;
+ void OnFileCanWriteWithoutBlocking(int fd) override;
+ void OnFileCanReadWithoutBlocking(int fd) override;
void EnsureWatchingReads();
void EnsureWatchingWrites();
diff --git a/device/serial/serial_service_impl.h b/device/serial/serial_service_impl.h
index 796a1d4..ea48e46 100644
--- a/device/serial/serial_service_impl.h
+++ b/device/serial/serial_service_impl.h
@@ -21,7 +21,7 @@ class SerialServiceImpl : public mojo::InterfaceImpl<serial::SerialService> {
scoped_refptr<SerialConnectionFactory> connection_factory);
SerialServiceImpl(scoped_refptr<SerialConnectionFactory> connection_factory,
scoped_ptr<SerialDeviceEnumerator> device_enumerator);
- virtual ~SerialServiceImpl();
+ ~SerialServiceImpl() override;
static void Create(scoped_refptr<base::MessageLoopProxy> io_message_loop,
scoped_refptr<base::MessageLoopProxy> ui_message_loop,
@@ -33,14 +33,14 @@ class SerialServiceImpl : public mojo::InterfaceImpl<serial::SerialService> {
mojo::InterfaceRequest<serial::SerialService> request);
// mojo::InterfaceImpl<SerialService> overrides.
- virtual void GetDevices(const mojo::Callback<
- void(mojo::Array<serial::DeviceInfoPtr>)>& callback) override;
- virtual void Connect(
- const mojo::String& path,
- serial::ConnectionOptionsPtr options,
- mojo::InterfaceRequest<serial::Connection> connection_request,
- mojo::InterfaceRequest<serial::DataSink> sink,
- mojo::InterfaceRequest<serial::DataSource> source) override;
+ void GetDevices(
+ const mojo::Callback<void(mojo::Array<serial::DeviceInfoPtr>)>& callback)
+ override;
+ void Connect(const mojo::String& path,
+ serial::ConnectionOptionsPtr options,
+ mojo::InterfaceRequest<serial::Connection> connection_request,
+ mojo::InterfaceRequest<serial::DataSink> sink,
+ mojo::InterfaceRequest<serial::DataSource> source) override;
private:
SerialDeviceEnumerator* GetDeviceEnumerator();
diff --git a/device/serial/serial_service_unittest.cc b/device/serial/serial_service_unittest.cc
index 24558ae..489d88e 100644
--- a/device/serial/serial_service_unittest.cc
+++ b/device/serial/serial_service_unittest.cc
@@ -17,7 +17,7 @@ namespace device {
namespace {
class FakeSerialDeviceEnumerator : public SerialDeviceEnumerator {
- virtual mojo::Array<serial::DeviceInfoPtr> GetDevices() override {
+ mojo::Array<serial::DeviceInfoPtr> GetDevices() override {
mojo::Array<serial::DeviceInfoPtr> devices(1);
devices[0] = serial::DeviceInfo::New();
devices[0]->path = "device";
@@ -27,13 +27,13 @@ class FakeSerialDeviceEnumerator : public SerialDeviceEnumerator {
class FailToOpenIoHandler : public TestSerialIoHandler {
public:
- virtual void Open(const std::string& port,
- const OpenCompleteCallback& callback) override {
+ void Open(const std::string& port,
+ const OpenCompleteCallback& callback) override {
callback.Run(false);
}
protected:
- virtual ~FailToOpenIoHandler() {}
+ ~FailToOpenIoHandler() override {}
};
} // namespace
@@ -47,7 +47,7 @@ class SerialServiceTest : public testing::Test, public mojo::ErrorHandler {
StopMessageLoop();
}
- virtual void OnConnectionError() override {
+ void OnConnectionError() override {
StopMessageLoop();
EXPECT_TRUE(expecting_error_);
}
diff --git a/device/serial/test_serial_io_handler.h b/device/serial/test_serial_io_handler.h
index 3633555..dfa27db 100644
--- a/device/serial/test_serial_io_handler.h
+++ b/device/serial/test_serial_io_handler.h
@@ -20,18 +20,17 @@ class TestSerialIoHandler : public SerialIoHandler {
static scoped_refptr<SerialIoHandler> Create();
// SerialIoHandler overrides.
- virtual void Open(const std::string& port,
- const OpenCompleteCallback& callback) override;
- virtual bool ConfigurePort(const serial::ConnectionOptions& options) override;
- virtual void ReadImpl() override;
- virtual void CancelReadImpl() override;
- virtual void WriteImpl() override;
- virtual void CancelWriteImpl() override;
- virtual serial::DeviceControlSignalsPtr GetControlSignals() const override;
- virtual serial::ConnectionInfoPtr GetPortInfo() const override;
- virtual bool Flush() const override;
- virtual bool SetControlSignals(
- const serial::HostControlSignals& signals) override;
+ void Open(const std::string& port,
+ const OpenCompleteCallback& callback) override;
+ bool ConfigurePort(const serial::ConnectionOptions& options) override;
+ void ReadImpl() override;
+ void CancelReadImpl() override;
+ void WriteImpl() override;
+ void CancelWriteImpl() override;
+ serial::DeviceControlSignalsPtr GetControlSignals() const override;
+ serial::ConnectionInfoPtr GetPortInfo() const override;
+ bool Flush() const override;
+ bool SetControlSignals(const serial::HostControlSignals& signals) override;
serial::ConnectionInfo* connection_info() { return &info_; }
serial::DeviceControlSignals* device_control_signals() {
@@ -47,7 +46,7 @@ class TestSerialIoHandler : public SerialIoHandler {
}
protected:
- virtual ~TestSerialIoHandler();
+ ~TestSerialIoHandler() override;
private:
bool opened_;
diff --git a/device/test/usb_test_gadget_impl.cc b/device/test/usb_test_gadget_impl.cc
index 5fa8e9f..d2272df 100644
--- a/device/test/usb_test_gadget_impl.cc
+++ b/device/test/usb_test_gadget_impl.cc
@@ -64,14 +64,14 @@ static const struct UsbTestGadgetConfiguration kConfigurations[] = {
class UsbTestGadgetImpl : public UsbTestGadget {
public:
- virtual ~UsbTestGadgetImpl();
+ ~UsbTestGadgetImpl() override;
- virtual bool Unclaim() override;
- virtual bool Disconnect() override;
- virtual bool Reconnect() override;
- virtual bool SetType(Type type) override;
- virtual UsbDevice* GetDevice() const override;
- virtual std::string GetSerialNumber() const override;
+ bool Unclaim() override;
+ bool Disconnect() override;
+ bool Reconnect() override;
+ bool SetType(Type type) override;
+ UsbDevice* GetDevice() const override;
+ std::string GetSerialNumber() const override;
protected:
UsbTestGadgetImpl();
@@ -93,13 +93,13 @@ class UsbTestGadgetImpl : public UsbTestGadget {
class Delegate : public net::URLFetcherDelegate {
public:
Delegate() {}
- virtual ~Delegate() {}
+ ~Delegate() override {}
void WaitForCompletion() {
run_loop_.Run();
}
- virtual void OnURLFetchComplete(const net::URLFetcher* source) override {
+ void OnURLFetchComplete(const net::URLFetcher* source) override {
run_loop_.Quit();
}
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();