Skip to content

Commit

Permalink
Run clang-tidy modernize-use-equals-{delete,default} on //device
Browse files Browse the repository at this point in the history
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8

This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md

In some cases the the tool leaves behind a string of commas where it
replaced a member initializer list
(https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up with:
  git diff --name-only | \
    xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/'

BUG=778959,778957

Change-Id: I62ef8d753b19c4e3e5010ccccfd682cbdb44eb24
Reviewed-on: https://chromium-review.googlesource.com/789722
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Chris Watkins <watk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520463}
  • Loading branch information
Chris Watkins authored and Commit Bot committed Nov 30, 2017
1 parent 00911dd commit 52eb868
Show file tree
Hide file tree
Showing 156 changed files with 300 additions and 312 deletions.
4 changes: 2 additions & 2 deletions device/base/mock_device_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

namespace device {

MockDeviceClient::MockDeviceClient() {}
MockDeviceClient::MockDeviceClient() = default;

MockDeviceClient::~MockDeviceClient() {}
MockDeviceClient::~MockDeviceClient() = default;

UsbService* MockDeviceClient::GetUsbService() {
return usb_service();
Expand Down
2 changes: 1 addition & 1 deletion device/base/synchronization/one_writer_seqlock_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct TestData {

class BasicSeqLockTestThread : public base::PlatformThread::Delegate {
public:
BasicSeqLockTestThread() {}
BasicSeqLockTestThread() = default;

void Init(OneWriterSeqLock* seqlock,
TestData* data,
Expand Down
2 changes: 1 addition & 1 deletion device/bluetooth/adapter_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace bluetooth {

AdapterFactory::AdapterFactory() : weak_ptr_factory_(this) {}
AdapterFactory::~AdapterFactory() {}
AdapterFactory::~AdapterFactory() = default;

// static
void AdapterFactory::Create(mojom::AdapterFactoryRequest request) {
Expand Down
9 changes: 3 additions & 6 deletions device/bluetooth/bluetooth_adapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@

namespace device {

BluetoothAdapter::ServiceOptions::ServiceOptions() {
}
BluetoothAdapter::ServiceOptions::~ServiceOptions() {
}
BluetoothAdapter::ServiceOptions::ServiceOptions() = default;
BluetoothAdapter::ServiceOptions::~ServiceOptions() = default;

#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && !defined(OS_MACOSX) && \
!defined(OS_WIN) && !defined(OS_LINUX)
Expand Down Expand Up @@ -287,8 +285,7 @@ void BluetoothAdapter::NotifyGattDescriptorValueChanged(
BluetoothAdapter::BluetoothAdapter() : weak_ptr_factory_(this) {
}

BluetoothAdapter::~BluetoothAdapter() {
}
BluetoothAdapter::~BluetoothAdapter() = default;

void BluetoothAdapter::OnStartDiscoverySession(
std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter,
Expand Down
7 changes: 4 additions & 3 deletions device/bluetooth/bluetooth_adapter_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void RunAdapterCallbacks() {

} // namespace

BluetoothAdapterFactory::~BluetoothAdapterFactory() {}
BluetoothAdapterFactory::~BluetoothAdapterFactory() = default;

// static
BluetoothAdapterFactory& BluetoothAdapterFactory::Get() {
Expand Down Expand Up @@ -154,7 +154,8 @@ bool BluetoothAdapterFactory::HasSharedInstanceForTesting() {
BluetoothAdapterFactory::GlobalValuesForTesting::GlobalValuesForTesting()
: weak_ptr_factory_(this) {}

BluetoothAdapterFactory::GlobalValuesForTesting::~GlobalValuesForTesting() {}
BluetoothAdapterFactory::GlobalValuesForTesting::~GlobalValuesForTesting() =
default;

base::WeakPtr<BluetoothAdapterFactory::GlobalValuesForTesting>
BluetoothAdapterFactory::GlobalValuesForTesting::GetWeakPtr() {
Expand All @@ -168,6 +169,6 @@ BluetoothAdapterFactory::InitGlobalValuesForTesting() {
return v;
}

BluetoothAdapterFactory::BluetoothAdapterFactory() {}
BluetoothAdapterFactory::BluetoothAdapterFactory() = default;

} // namespace device
5 changes: 2 additions & 3 deletions device/bluetooth/bluetooth_adapter_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ namespace device {

class TestBluetoothAdapter : public BluetoothAdapter {
public:
TestBluetoothAdapter() {
}
TestBluetoothAdapter() = default;

std::string GetAddress() const override { return ""; }

Expand Down Expand Up @@ -138,7 +137,7 @@ class TestBluetoothAdapter : public BluetoothAdapter {
}

protected:
~TestBluetoothAdapter() override {}
~TestBluetoothAdapter() override = default;

void AddDiscoverySession(
BluetoothDiscoveryFilter* discovery_filter,
Expand Down
9 changes: 3 additions & 6 deletions device/bluetooth/bluetooth_advertisement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ BluetoothAdvertisement::Data::Data(AdvertisementType type)
: type_(type), include_tx_power_(false) {
}

BluetoothAdvertisement::Data::~Data() {
}
BluetoothAdvertisement::Data::~Data() = default;

BluetoothAdvertisement::Data::Data()
: type_(ADVERTISEMENT_TYPE_BROADCAST), include_tx_power_(false) {
Expand All @@ -29,9 +28,7 @@ void BluetoothAdvertisement::RemoveObserver(
observers_.RemoveObserver(observer);
}

BluetoothAdvertisement::BluetoothAdvertisement() {
}
BluetoothAdvertisement::~BluetoothAdvertisement() {
}
BluetoothAdvertisement::BluetoothAdvertisement() = default;
BluetoothAdvertisement::~BluetoothAdvertisement() = default;

} // namespace device
2 changes: 1 addition & 1 deletion device/bluetooth/bluetooth_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ BluetoothDevice::ConnectionInfo::ConnectionInfo(
transmit_power(transmit_power),
max_transmit_power(max_transmit_power) {}

BluetoothDevice::ConnectionInfo::~ConnectionInfo() {}
BluetoothDevice::ConnectionInfo::~ConnectionInfo() = default;

base::string16 BluetoothDevice::GetNameForDisplay() const {
base::Optional<std::string> name = GetName();
Expand Down
3 changes: 1 addition & 2 deletions device/bluetooth/bluetooth_discovery_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ BluetoothDiscoveryFilter::BluetoothDiscoveryFilter(
SetTransport(transport);
}

BluetoothDiscoveryFilter::~BluetoothDiscoveryFilter() {
}
BluetoothDiscoveryFilter::~BluetoothDiscoveryFilter() = default;

bool BluetoothDiscoveryFilter::GetRSSI(int16_t* out_rssi) const {
DCHECK(out_rssi);
Expand Down
4 changes: 2 additions & 2 deletions device/bluetooth/bluetooth_gatt_characteristic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

namespace device {

BluetoothGattCharacteristic::BluetoothGattCharacteristic() {}
BluetoothGattCharacteristic::BluetoothGattCharacteristic() = default;

BluetoothGattCharacteristic::~BluetoothGattCharacteristic() {}
BluetoothGattCharacteristic::~BluetoothGattCharacteristic() = default;

} // namespace device
6 changes: 2 additions & 4 deletions device/bluetooth/bluetooth_gatt_descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ BluetoothGattDescriptor::CharacteristicAggregateFormatUuid() {
return g_uuids.Get().uuids_[5];
}

BluetoothGattDescriptor::BluetoothGattDescriptor() {
}
BluetoothGattDescriptor::BluetoothGattDescriptor() = default;

BluetoothGattDescriptor::~BluetoothGattDescriptor() {
}
BluetoothGattDescriptor::~BluetoothGattDescriptor() = default;

} // namespace device
6 changes: 2 additions & 4 deletions device/bluetooth/bluetooth_gatt_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

namespace device {

BluetoothGattService::BluetoothGattService() {
}
BluetoothGattService::BluetoothGattService() = default;

BluetoothGattService::~BluetoothGattService() {
}
BluetoothGattService::~BluetoothGattService() = default;

} // namespace device
4 changes: 2 additions & 2 deletions device/bluetooth/bluetooth_local_gatt_characteristic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ BluetoothLocalGattCharacteristic::Create(const BluetoothUUID& uuid,
}
#endif

BluetoothLocalGattCharacteristic::BluetoothLocalGattCharacteristic() {}
BluetoothLocalGattCharacteristic::BluetoothLocalGattCharacteristic() = default;

BluetoothLocalGattCharacteristic::~BluetoothLocalGattCharacteristic() {}
BluetoothLocalGattCharacteristic::~BluetoothLocalGattCharacteristic() = default;

} // namespace device
4 changes: 2 additions & 2 deletions device/bluetooth/bluetooth_local_gatt_descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ BluetoothLocalGattDescriptor::Create(
}
#endif

BluetoothLocalGattDescriptor::BluetoothLocalGattDescriptor() {}
BluetoothLocalGattDescriptor::BluetoothLocalGattDescriptor() = default;

BluetoothLocalGattDescriptor::~BluetoothLocalGattDescriptor() {}
BluetoothLocalGattDescriptor::~BluetoothLocalGattDescriptor() = default;

} // namespace device
4 changes: 2 additions & 2 deletions device/bluetooth/bluetooth_local_gatt_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ base::WeakPtr<BluetoothLocalGattService> BluetoothLocalGattService::Create(
}
#endif

BluetoothLocalGattService::BluetoothLocalGattService() {}
BluetoothLocalGattService::BluetoothLocalGattService() = default;

BluetoothLocalGattService::~BluetoothLocalGattService() {}
BluetoothLocalGattService::~BluetoothLocalGattService() = default;

} // namespace device
2 changes: 1 addition & 1 deletion device/bluetooth/bluetooth_remote_gatt_characteristic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BluetoothRemoteGattCharacteristic::NotifySessionCommand::NotifySessionCommand(
: execute_callback_(execute_callback), cancel_callback_(cancel_callback) {}

BluetoothRemoteGattCharacteristic::NotifySessionCommand::
~NotifySessionCommand() {}
~NotifySessionCommand() = default;

void BluetoothRemoteGattCharacteristic::NotifySessionCommand::Execute() {
execute_callback_.Run(COMMAND_NONE, RESULT_SUCCESS,
Expand Down
4 changes: 2 additions & 2 deletions device/bluetooth/bluetooth_remote_gatt_descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

namespace device {

BluetoothRemoteGattDescriptor::BluetoothRemoteGattDescriptor() {}
BluetoothRemoteGattDescriptor::BluetoothRemoteGattDescriptor() = default;

BluetoothRemoteGattDescriptor::~BluetoothRemoteGattDescriptor() {}
BluetoothRemoteGattDescriptor::~BluetoothRemoteGattDescriptor() = default;

} // namespace device
4 changes: 2 additions & 2 deletions device/bluetooth/bluetooth_remote_gatt_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace device {

BluetoothRemoteGattService::BluetoothRemoteGattService() {}
BluetoothRemoteGattService::BluetoothRemoteGattService() = default;

BluetoothRemoteGattService::~BluetoothRemoteGattService() {}
BluetoothRemoteGattService::~BluetoothRemoteGattService() = default;

std::vector<BluetoothRemoteGattCharacteristic*>
BluetoothRemoteGattService::GetCharacteristicsByUUID(
Expand Down
2 changes: 1 addition & 1 deletion device/bluetooth/bluetooth_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

namespace device {

BluetoothSocket::~BluetoothSocket() {}
BluetoothSocket::~BluetoothSocket() = default;

} // namespace device
2 changes: 1 addition & 1 deletion device/bluetooth/bluetooth_socket_net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace device {
BluetoothSocketNet::WriteRequest::WriteRequest()
: buffer_size(0) {}

BluetoothSocketNet::WriteRequest::~WriteRequest() {}
BluetoothSocketNet::WriteRequest::~WriteRequest() = default;

BluetoothSocketNet::BluetoothSocketNet(
scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
Expand Down
3 changes: 1 addition & 2 deletions device/bluetooth/bluetooth_uuid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ BluetoothUUID::BluetoothUUID(const std::string& uuid) {
BluetoothUUID::BluetoothUUID() : format_(kFormatInvalid) {
}

BluetoothUUID::~BluetoothUUID() {
}
BluetoothUUID::~BluetoothUUID() = default;

bool BluetoothUUID::IsValid() const {
return format_ != kFormatInvalid;
Expand Down
2 changes: 1 addition & 1 deletion device/bluetooth/bluez/bluetooth_adapter_profile_bluez.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ BluetoothAdapterProfileBlueZ::BluetoothAdapterProfileBlueZ(
DCHECK(profile_.get());
}

BluetoothAdapterProfileBlueZ::~BluetoothAdapterProfileBlueZ() {}
BluetoothAdapterProfileBlueZ::~BluetoothAdapterProfileBlueZ() = default;

bool BluetoothAdapterProfileBlueZ::SetDelegate(
const dbus::ObjectPath& device_path,
Expand Down
4 changes: 2 additions & 2 deletions device/bluetooth/bluez/bluetooth_bluez_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int GetDeviceIndexByAddress(const BluetoothAdapter::DeviceList& devices,
class FakeBluetoothProfileServiceProviderDelegate
: public bluez::BluetoothProfileServiceProvider::Delegate {
public:
FakeBluetoothProfileServiceProviderDelegate() {}
FakeBluetoothProfileServiceProviderDelegate() = default;

// bluez::BluetoothProfileServiceProvider::Delegate:
void Released() override {}
Expand Down Expand Up @@ -100,7 +100,7 @@ class TestPairingDelegate : public BluetoothDevice::PairingDelegate {
authorize_pairing_count_(0),
last_passkey_(9999999U),
last_entered_(999U) {}
~TestPairingDelegate() override {}
~TestPairingDelegate() override = default;

void RequestPinCode(BluetoothDevice* device) override {
++call_count_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BluetoothGattCharacteristicBlueZ::BluetoothGattCharacteristicBlueZ(
dbus::ObjectPath object_path)
: object_path_(object_path), weak_ptr_factory_(this) {}

BluetoothGattCharacteristicBlueZ::~BluetoothGattCharacteristicBlueZ() {}
BluetoothGattCharacteristicBlueZ::~BluetoothGattCharacteristicBlueZ() = default;

std::string BluetoothGattCharacteristicBlueZ::GetIdentifier() const {
return object_path_.value();
Expand Down
2 changes: 1 addition & 1 deletion device/bluetooth/bluez/bluetooth_gatt_descriptor_bluez.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BluetoothGattDescriptorBlueZ::BluetoothGattDescriptorBlueZ(
const dbus::ObjectPath& object_path)
: object_path_(object_path) {}

BluetoothGattDescriptorBlueZ::~BluetoothGattDescriptorBlueZ() {}
BluetoothGattDescriptorBlueZ::~BluetoothGattDescriptorBlueZ() = default;

std::string BluetoothGattDescriptorBlueZ::GetIdentifier() const {
return object_path_.value();
Expand Down
2 changes: 1 addition & 1 deletion device/bluetooth/bluez/bluetooth_gatt_service_bluez.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BluetoothGattServiceBlueZ::BluetoothGattServiceBlueZ(
DCHECK(adapter_);
}

BluetoothGattServiceBlueZ::~BluetoothGattServiceBlueZ() {}
BluetoothGattServiceBlueZ::~BluetoothGattServiceBlueZ() = default;

std::string BluetoothGattServiceBlueZ::GetIdentifier() const {
return object_path_.value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ BluetoothLocalGattCharacteristicBlueZ::BluetoothLocalGattCharacteristicBlueZ(
}

BluetoothLocalGattCharacteristicBlueZ::
~BluetoothLocalGattCharacteristicBlueZ() {}
~BluetoothLocalGattCharacteristicBlueZ() = default;

device::BluetoothUUID BluetoothLocalGattCharacteristicBlueZ::GetUUID() const {
return uuid_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ BluetoothLocalGattDescriptorBlueZ::BluetoothLocalGattDescriptorBlueZ(
characteristic->AddDescriptor(base::WrapUnique(this));
}

BluetoothLocalGattDescriptorBlueZ::~BluetoothLocalGattDescriptorBlueZ() {}
BluetoothLocalGattDescriptorBlueZ::~BluetoothLocalGattDescriptorBlueZ() =
default;

device::BluetoothUUID BluetoothLocalGattDescriptorBlueZ::GetUUID() const {
return uuid_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BluetoothLocalGattServiceBlueZ::BluetoothLocalGattServiceBlueZ(
adapter->AddLocalGattService(base::WrapUnique(this));
}

BluetoothLocalGattServiceBlueZ::~BluetoothLocalGattServiceBlueZ() {}
BluetoothLocalGattServiceBlueZ::~BluetoothLocalGattServiceBlueZ() = default;

device::BluetoothUUID BluetoothLocalGattServiceBlueZ::GetUUID() const {
return uuid_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ BluetoothRemoteGattDescriptorBlueZ::BluetoothRemoteGattDescriptorBlueZ(
<< GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
}

BluetoothRemoteGattDescriptorBlueZ::~BluetoothRemoteGattDescriptorBlueZ() {}
BluetoothRemoteGattDescriptorBlueZ::~BluetoothRemoteGattDescriptorBlueZ() =
default;

device::BluetoothUUID BluetoothRemoteGattDescriptorBlueZ::GetUUID() const {
bluez::BluetoothGattDescriptorClient::Properties* properties =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ operator=(const BluetoothServiceAttributeValueBlueZ& attribute) {
return *this;
}

BluetoothServiceAttributeValueBlueZ::~BluetoothServiceAttributeValueBlueZ() {}
BluetoothServiceAttributeValueBlueZ::~BluetoothServiceAttributeValueBlueZ() =
default;

} // namespace bluez
4 changes: 2 additions & 2 deletions device/bluetooth/bluez/bluetooth_service_record_bluez.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

namespace bluez {

BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ() {}
BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ() = default;

BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ(
const BluetoothServiceRecordBlueZ& record) {
this->attributes_ = record.attributes_;
}

BluetoothServiceRecordBlueZ::~BluetoothServiceRecordBlueZ() {}
BluetoothServiceRecordBlueZ::~BluetoothServiceRecordBlueZ() = default;

const std::vector<uint16_t> BluetoothServiceRecordBlueZ::GetAttributeIds()
const {
Expand Down
Loading

0 comments on commit 52eb868

Please sign in to comment.