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

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

Issue 1102473003: Unlock Chrome when a phone with Smart Lock service is found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_screen_lock
Patch Set: Prepare for review Created 5 years, 8 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_finder.cc
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc b/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
index 0fdec853b5413b4141f93d0891728f41fb6628cb..a9aea04f574a2081c13aca9355ebe45acf93c940 100644
--- a/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
+++ b/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
@@ -154,7 +154,7 @@ bool BluetoothLowEnergyConnectionFinder::HasService(
void BluetoothLowEnergyConnectionFinder::OnCreateConnectionError(
BluetoothDevice::ConnectErrorCode error_code) {
- VLOG(1) << "Error creating connection";
+ VLOG(1) << "Error creating connection: " << error_code;
}
void BluetoothLowEnergyConnectionFinder::OnConnectionCreated(
@@ -162,7 +162,10 @@ void BluetoothLowEnergyConnectionFinder::OnConnectionCreated(
VLOG(1) << "Connection created";
connected_ = true;
StopDiscoverySession();
- connection_callback_.Run(connection.Pass());
+ if (!connection_callback_.is_null()) {
+ connection_callback_.Run(connection.Pass());
+ connection_callback_.Reset();
+ }
}
void BluetoothLowEnergyConnectionFinder::CreateConnection(

Powered by Google App Engine
This is Rietveld 408576698