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

Side by Side Diff: components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc

Issue 1114843002: Fix crash when Proximity Auth BLE stops the discovery session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h " 5 #include "components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h "
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 void BluetoothLowEnergyConnectionFinder::StopDiscoverySession() { 123 void BluetoothLowEnergyConnectionFinder::StopDiscoverySession() {
124 VLOG(1) << "Stopping discovery sesison"; 124 VLOG(1) << "Stopping discovery sesison";
125 125
126 if (!adapter_) { 126 if (!adapter_) {
127 VLOG(1) << "Adapter not initialized"; 127 VLOG(1) << "Adapter not initialized";
128 return; 128 return;
129 } 129 }
130 if (!discovery_session_ || !discovery_session_->IsActive()) { 130 if (!discovery_session_ || !discovery_session_->IsActive()) {
131 VLOG(1) << "No Active discovery session"; 131 VLOG(1) << "No Active discovery session";
132 return;
132 } 133 }
133 134
134 discovery_session_->Stop( 135 discovery_session_->Stop(
135 base::Bind(&BluetoothLowEnergyConnectionFinder::OnDiscoverySessionStopped, 136 base::Bind(&BluetoothLowEnergyConnectionFinder::OnDiscoverySessionStopped,
136 weak_ptr_factory_.GetWeakPtr()), 137 weak_ptr_factory_.GetWeakPtr()),
137 base::Bind( 138 base::Bind(
138 &BluetoothLowEnergyConnectionFinder::OnStopDiscoverySessionError, 139 &BluetoothLowEnergyConnectionFinder::OnStopDiscoverySessionError,
139 weak_ptr_factory_.GetWeakPtr())); 140 weak_ptr_factory_.GetWeakPtr()));
140 } 141 }
141 142
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 << "device = " << remote_device->GetAddress() 176 << "device = " << remote_device->GetAddress()
176 << ", name = " << remote_device->GetName(); 177 << ", name = " << remote_device->GetName();
177 remote_device->CreateGattConnection( 178 remote_device->CreateGattConnection(
178 base::Bind(&BluetoothLowEnergyConnectionFinder::OnConnectionCreated, 179 base::Bind(&BluetoothLowEnergyConnectionFinder::OnConnectionCreated,
179 weak_ptr_factory_.GetWeakPtr()), 180 weak_ptr_factory_.GetWeakPtr()),
180 base::Bind(&BluetoothLowEnergyConnectionFinder::OnCreateConnectionError, 181 base::Bind(&BluetoothLowEnergyConnectionFinder::OnCreateConnectionError,
181 weak_ptr_factory_.GetWeakPtr())); 182 weak_ptr_factory_.GetWeakPtr()));
182 } 183 }
183 184
184 } // namespace proximity_auth 185 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698