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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // NETWORK_ERROR Note: 5 // NETWORK_ERROR Note:
6 // When a device can't be found in the BluetoothAdapter, that generally 6 // When a device can't be found in the BluetoothAdapter, that generally
7 // indicates that it's gone out of range. We reject with a NetworkError in that 7 // indicates that it's gone out of range. We reject with a NetworkError in that
8 // case. 8 // case.
9 // https://webbluetoothchrome.github.io/web-bluetooth/#dom-bluetoothdevice-conne ctgatt 9 // https://webbluetoothchrome.github.io/web-bluetooth/#dom-bluetoothdevice-conne ctgatt
10 10
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 request_device_sessions_.Remove(chooser_id); 834 request_device_sessions_.Remove(chooser_id);
835 } 835 }
836 836
837 void BluetoothDispatcherHost::OnGATTConnectionCreated( 837 void BluetoothDispatcherHost::OnGATTConnectionCreated(
838 int thread_id, 838 int thread_id,
839 int request_id, 839 int request_id,
840 const std::string& device_instance_id, 840 const std::string& device_instance_id,
841 base::TimeTicks start_time, 841 base::TimeTicks start_time,
842 scoped_ptr<device::BluetoothGattConnection> connection) { 842 scoped_ptr<device::BluetoothGattConnection> connection) {
843 DCHECK_CURRENTLY_ON(BrowserThread::UI); 843 DCHECK_CURRENTLY_ON(BrowserThread::UI);
844 // TODO(ortuno): Save the BluetoothGattConnection so we can disconnect 844 connections_.push_back(connection.Pass());
845 // from it.
846 RecordConnectGATTTimeSuccess(base::TimeTicks::Now() - start_time); 845 RecordConnectGATTTimeSuccess(base::TimeTicks::Now() - start_time);
847 RecordConnectGATTOutcome(UMAConnectGATTOutcome::SUCCESS); 846 RecordConnectGATTOutcome(UMAConnectGATTOutcome::SUCCESS);
848 Send(new BluetoothMsg_ConnectGATTSuccess(thread_id, request_id, 847 Send(new BluetoothMsg_ConnectGATTSuccess(thread_id, request_id,
849 device_instance_id)); 848 device_instance_id));
850 } 849 }
851 850
852 void BluetoothDispatcherHost::OnCreateGATTConnectionError( 851 void BluetoothDispatcherHost::OnCreateGATTConnectionError(
853 int thread_id, 852 int thread_id,
854 int request_id, 853 int request_id,
855 const std::string& device_instance_id, 854 const std::string& device_instance_id,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 DCHECK_CURRENTLY_ON(BrowserThread::UI); 954 DCHECK_CURRENTLY_ON(BrowserThread::UI);
956 NOTIMPLEMENTED(); 955 NOTIMPLEMENTED();
957 } 956 }
958 957
959 void BluetoothDispatcherHost::ShowBluetoothAdapterOffLink() { 958 void BluetoothDispatcherHost::ShowBluetoothAdapterOffLink() {
960 DCHECK_CURRENTLY_ON(BrowserThread::UI); 959 DCHECK_CURRENTLY_ON(BrowserThread::UI);
961 NOTIMPLEMENTED(); 960 NOTIMPLEMENTED();
962 } 961 }
963 962
964 } // namespace content 963 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698