Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: components/proximity_auth/ble/bluetooth_low_energy_connection.cc

Issue 1341103004: Handle change of BLE address after pairing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ***ADDED BY MISTAKE, OMMIT *** Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..839e442d2bbf53276c7bfc21c67ab84a2b90a602 100644
--- a/components/proximity_auth/ble/bluetooth_low_energy_connection.cc
+++ b/components/proximity_auth/ble/bluetooth_low_energy_connection.cc
@@ -117,7 +117,7 @@ void BluetoothLowEnergyConnection::CreateGattConnection() {
PA_LOG(INFO) << "Creating GATT connection with "
<< remote_device->GetAddress();
- remote_device->CreateGattConnection(
+ gatt_connection_ = remote_device->CreateGattConnection(
base::Bind(&BluetoothLowEnergyConnection::OnGattConnectionCreated,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&BluetoothLowEnergyConnection::OnCreateGattConnectionError,
@@ -336,8 +336,7 @@ void BluetoothLowEnergyConnection::OnCreateGattConnectionError(
Disconnect();
}
-void BluetoothLowEnergyConnection::OnGattConnectionCreated(
- scoped_ptr<device::BluetoothGattConnection> gatt_connection) {
+void BluetoothLowEnergyConnection::OnGattConnectionCreated() {
DCHECK(sub_status() == SubStatus::WAITING_GATT_CONNECTION);
PA_LOG(INFO) << "GATT connection with " << gatt_connection->GetDeviceAddress()
<< " created.";
@@ -346,7 +345,6 @@ void BluetoothLowEnergyConnection::OnGattConnectionCreated(
// Informing |bluetooth_trottler_| a new connection was established.
bluetooth_throttler_->OnConnection(this);
- gatt_connection_ = gatt_connection.Pass();
SetSubStatus(SubStatus::WAITING_CHARACTERISTICS);
characteristic_finder_.reset(CreateCharacteristicsFinder(
base::Bind(&BluetoothLowEnergyConnection::OnCharacteristicsFound,
« no previous file with comments | « components/proximity_auth/ble/bluetooth_low_energy_connection.h ('k') | content/browser/bluetooth/bluetooth_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698