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

Unified Diff: device/bluetooth/bluetooth_device.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
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index 2f1513bf972177e2daa9c455a65ebf3f9e4d7583..fc16650ed236efab3a00a0a6f00e76bc4b0ecdae 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -203,16 +203,19 @@ bool BluetoothDevice::IsTrustable() const {
return false;
}
-void BluetoothDevice::CreateGattConnection(
+scoped_ptr<device::BluetoothGattConnection>
+BluetoothDevice::CreateGattConnection(
const GattConnectionCallback& callback,
const ConnectErrorCallback& error_callback) {
create_gatt_connection_success_callbacks_.push_back(callback);
create_gatt_connection_error_callbacks_.push_back(error_callback);
- if (IsGattConnected())
- return DidConnectGatt();
+ if (IsGattConnected()) {
+ DidConnectGatt();
+ return ExistingGattConnection().Pass();
+ }
- CreateGattConnectionImpl();
+ return CreateGattConnectionImpl().Pass();
}
std::vector<BluetoothGattService*>
@@ -289,9 +292,9 @@ BluetoothDevice::UUIDList BluetoothDevice::GetServiceDataUUIDs() const {
}
void BluetoothDevice::DidConnectGatt() {
+ VLOG(1) << "BluetoothDevice::DidConnectGatt";
for (const auto& callback : create_gatt_connection_success_callbacks_) {
- callback.Run(
- make_scoped_ptr(new BluetoothGattConnection(adapter_, GetAddress())));
+ callback.Run();
}
create_gatt_connection_success_callbacks_.clear();
create_gatt_connection_error_callbacks_.clear();
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698