| 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 c545b21a47fbca5cbcbc9ac95012edf227da30d8..cf0926b23e92a6ccf763754b4d4ed3ea0185e958 100644
|
| --- a/components/arc/bluetooth/arc_bluetooth_bridge.h
|
| +++ b/components/arc/bluetooth/arc_bluetooth_bridge.h
|
| @@ -43,8 +43,7 @@ class ArcBluetoothBridge
|
| explicit ArcBluetoothBridge(ArcBridgeService* bridge_service);
|
| ~ArcBluetoothBridge() override;
|
|
|
| - // Overridden from
|
| - // InstanceHolder<mojom::BluetoothInstance>::Observer:
|
| + // Overridden from InstanceHolder<mojom::BluetoothInstance>::Observer:
|
| void OnInstanceReady() override;
|
|
|
| void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter);
|
| @@ -341,6 +340,23 @@ class ArcBluetoothBridge
|
| template <class LocalGattAttribute>
|
| int32_t CreateGattAttributeHandle(LocalGattAttribute* gatt_attr);
|
|
|
| + // Common code for OnCharacteristicReadRequest and OnDescriptorReadRequest
|
| + template <class LocalGattAttribute>
|
| + void OnGattAttributeReadRequest(const device::BluetoothDevice* device,
|
| + const LocalGattAttribute* gatt_attr,
|
| + int offset,
|
| + const ValueCallback& success_callback,
|
| + const ErrorCallback& error_callback);
|
| +
|
| + // Common code for OnCharacteristicWriteRequest and OnDescriptorWriteRequest
|
| + template <class LocalGattAttribute>
|
| + void OnGattAttributeWriteRequest(const device::BluetoothDevice* device,
|
| + const LocalGattAttribute* gatt_attr,
|
| + const std::vector<uint8_t>& value,
|
| + int offset,
|
| + const base::Closure& success_callback,
|
| + const ErrorCallback& error_callback);
|
| +
|
| bool CalledOnValidThread();
|
|
|
| int32_t next_gatt_server_attribute_handle() {
|
| @@ -357,6 +373,8 @@ class ArcBluetoothBridge
|
| notification_session_;
|
| // Map from android int handle to Chrome (BlueZ) string identifier.
|
| std::unordered_map<int32_t, std::string> gatt_identifier_;
|
| + // Map from Chrome (BlueZ) string identifier to android int handle.
|
| + std::unordered_map<std::string, int32_t> gatt_handle_;
|
| // Store last GattCharacteristic added to each GattService for GattServer.
|
| std::unordered_map<int32_t, int32_t> last_characteristic_;
|
| // Monotonically increasing value to use as handle to give to Android side.
|
|
|