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

Unified Diff: components/arc/bluetooth/arc_bluetooth_bridge.h

Issue 2319213005: arc/bluetooth: Save BluetoothGattConnection objects (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/bluetooth/arc_bluetooth_bridge.h
diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.h b/components/arc/bluetooth/arc_bluetooth_bridge.h
index fd98791b1995e9c1c65c4eb937b3297d873d626f..a5a2280e5241272fc7821f93bcc45f16ef0934e6 100644
--- a/components/arc/bluetooth/arc_bluetooth_bridge.h
+++ b/components/arc/bluetooth/arc_bluetooth_bridge.h
@@ -291,11 +291,11 @@ class ArcBluetoothBridge
bool connected) const;
void OnGattConnected(
mojom::BluetoothAddressPtr addr,
- std::unique_ptr<device::BluetoothGattConnection> connection) const;
+ std::unique_ptr<device::BluetoothGattConnection> connection);
void OnGattConnectError(
mojom::BluetoothAddressPtr addr,
device::BluetoothDevice::ConnectErrorCode error_code) const;
- void OnGattDisconnected(mojom::BluetoothAddressPtr addr) const;
+ void OnGattDisconnected(mojom::BluetoothAddressPtr addr);
void OnStartLEListenDone(const StartLEListenCallback& callback,
scoped_refptr<device::BluetoothAdvertisement> adv);
@@ -385,6 +385,12 @@ class ArcBluetoothBridge
int32_t gatt_server_attribute_next_handle_ = 0;
// Keeps track of all devices which initiated a GATT connection to us.
std::unordered_set<std::string> gatt_connection_cache_;
+ // Map of device address to GATT connection objects for connections we
+ // have made. We need to hang on to these as long as the connection is
+ // active since their destructors will drop the connections otherwise.
+ std::unordered_map<std::string,
+ std::unique_ptr<device::BluetoothGattConnection>>
+ gatt_connections_;
// Timer to turn adapter discoverable off.
base::OneShotTimer discoverable_off_timer_;
« no previous file with comments | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698