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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.cc

Issue 1377453007: bluetooth: Keep GATT connections open by retaining BluetoothGattConnection objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-thread-
Patch Set: clear in set_adapter Created 5 years, 2 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 | « content/browser/bluetooth/bluetooth_dispatcher_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « content/browser/bluetooth/bluetooth_dispatcher_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698