Index: components/proximity_auth/ble/bluetooth_low_energy_connection.cc |
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_connection.cc b/components/proximity_auth/ble/bluetooth_low_energy_connection.cc |
index 52af29b32bf4fc1c35bb2133c6c32e93eb149a23..063d6de5df9c94ef4883507a8c38a48968ce0717 100644 |
--- a/components/proximity_auth/ble/bluetooth_low_energy_connection.cc |
+++ b/components/proximity_auth/ble/bluetooth_low_energy_connection.cc |
@@ -76,7 +76,6 @@ BluetoothLowEnergyConnection::BluetoothLowEnergyConnection( |
} |
BluetoothLowEnergyConnection::~BluetoothLowEnergyConnection() { |
- PA_LOG(INFO) << "Connection destroyed."; |
Disconnect(); |
if (adapter_) { |
adapter_->RemoveObserver(this); |
@@ -127,7 +126,7 @@ void BluetoothLowEnergyConnection::CreateGattConnection() { |
void BluetoothLowEnergyConnection::Disconnect() { |
if (sub_status() != SubStatus::DISCONNECTED) { |
- ClearWriteRequestsQueue(); |
+ weak_ptr_factory_.InvalidateWeakPtrs(); |
StopNotifySession(); |
characteristic_finder_.reset(); |
if (gatt_connection_) { |
@@ -318,8 +317,7 @@ BluetoothLowEnergyConnection::WriteRequest::WriteRequest( |
number_of_failed_attempts(0) { |
} |
-BluetoothLowEnergyConnection::WriteRequest::~WriteRequest() { |
-} |
+BluetoothLowEnergyConnection::WriteRequest::~WriteRequest() {} |
void BluetoothLowEnergyConnection::CompleteConnection() { |
PA_LOG(INFO) << "Connection completed. Time elapsed: " |
@@ -535,11 +533,6 @@ BluetoothLowEnergyConnection::BuildWriteRequest( |
return WriteRequest(value, is_last_write_for_wire_message); |
} |
-void BluetoothLowEnergyConnection::ClearWriteRequestsQueue() { |
- while (!write_requests_queue_.empty()) |
- write_requests_queue_.pop(); |
-} |
- |
void BluetoothLowEnergyConnection::PrintTimeElapsed() { |
PA_LOG(INFO) << "Time elapsed: " << base::TimeTicks::Now() - start_time_; |
} |