Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc |
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
index 7335a7bc3d930780eb598e663a90bda5bfefb499..30d468b300e1ca6ef5e6691e9e62699cd2452547 100644 |
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
@@ -273,6 +273,7 @@ struct BluetoothDispatcherHost::RequestDeviceSession { |
void BluetoothDispatcherHost::set_adapter( |
scoped_refptr<device::BluetoothAdapter> adapter) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ connections_.clear(); |
if (adapter_.get()) |
adapter_->RemoveObserver(this); |
adapter_ = adapter; |
@@ -841,8 +842,7 @@ void BluetoothDispatcherHost::OnGATTConnectionCreated( |
base::TimeTicks start_time, |
scoped_ptr<device::BluetoothGattConnection> connection) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
- // TODO(ortuno): Save the BluetoothGattConnection so we can disconnect |
- // from it. |
+ connections_.push_back(connection.Pass()); |
RecordConnectGATTTimeSuccess(base::TimeTicks::Now() - start_time); |
RecordConnectGATTOutcome(UMAConnectGATTOutcome::SUCCESS); |
Send(new BluetoothMsg_ConnectGATTSuccess(thread_id, request_id, |