| Index: content/browser/bluetooth/web_bluetooth_service_impl.h
|
| diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.h b/content/browser/bluetooth/web_bluetooth_service_impl.h
|
| index 2c6dc940dde53df8e30d9f12443b6c7f7bba8e9b..44e1858594e1486fefd0dc2ec68506b72c5a9fc5 100644
|
| --- a/content/browser/bluetooth/web_bluetooth_service_impl.h
|
| +++ b/content/browser/bluetooth/web_bluetooth_service_impl.h
|
| @@ -15,6 +15,7 @@
|
| #include "content/common/content_export.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "device/bluetooth/bluetooth_adapter.h"
|
| +#include "device/bluetooth/bluetooth_gatt_connection.h"
|
| #include "device/bluetooth/bluetooth_gatt_notify_session.h"
|
| #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
|
| #include "device/bluetooth/bluetooth_remote_gatt_service.h"
|
| @@ -28,6 +29,7 @@ class Origin;
|
| namespace content {
|
|
|
| class BluetoothDispatcherHost;
|
| +class FrameConnectedBluetoothDevices;
|
| class RenderFrameHost;
|
| class RenderProcessHost;
|
|
|
| @@ -66,6 +68,8 @@ class WebBluetoothServiceImpl : public blink::mojom::WebBluetoothService,
|
| // BluetoothAdapter::Observer:
|
| void AdapterPresentChanged(device::BluetoothAdapter* adapter,
|
| bool present) override;
|
| + void DeviceChanged(device::BluetoothAdapter* adapter,
|
| + device::BluetoothDevice* device) override;
|
| void GattServicesDiscovered(device::BluetoothAdapter* adapter,
|
| device::BluetoothDevice* device) override;
|
| void GattCharacteristicValueChanged(
|
| @@ -83,6 +87,10 @@ class WebBluetoothServiceImpl : public blink::mojom::WebBluetoothService,
|
| // WebBluetoothService methods:
|
| void SetClient(
|
| blink::mojom::WebBluetoothServiceClientAssociatedPtrInfo client) override;
|
| + void RemoteServerConnect(
|
| + const mojo::String& device_id,
|
| + const RemoteServerConnectCallback& callback) override;
|
| + void RemoteServerDisconnect(const mojo::String& device_id) override;
|
| void RemoteServerGetPrimaryService(
|
| const mojo::String& device_id,
|
| const mojo::String& service_uuid,
|
| @@ -113,6 +121,18 @@ class WebBluetoothServiceImpl : public blink::mojom::WebBluetoothService,
|
| const RemoteServerGetPrimaryServiceCallback& callback,
|
| device::BluetoothDevice* device);
|
|
|
| + // Callbacks for BluetoothDevice::CreateGattConnection.
|
| + void OnCreateGATTConnectionSuccess(
|
| + const std::string& device_id,
|
| + base::TimeTicks start_time,
|
| + const RemoteServerConnectCallback& callback,
|
| + std::unique_ptr<device::BluetoothGattConnection> connection);
|
| + void OnCreateGATTConnectionFailed(
|
| + const std::string& device_id,
|
| + base::TimeTicks start_time,
|
| + const RemoteServerConnectCallback& callback,
|
| + device::BluetoothDevice::ConnectErrorCode error_code);
|
| +
|
| // Callbacks for BluetoothRemoteGattCharacteristic::ReadRemoteCharacteristic.
|
| void OnReadValueSuccess(const RemoteCharacteristicReadValueCallback& callback,
|
| const std::vector<uint8_t>& value);
|
| @@ -170,6 +190,9 @@ class WebBluetoothServiceImpl : public blink::mojom::WebBluetoothService,
|
| std::unordered_map<std::string, std::string> service_id_to_device_address_;
|
| std::unordered_map<std::string, std::string> characteristic_id_to_service_id_;
|
|
|
| + // Map to keep track of the connected Bluetooth devices.
|
| + std::unique_ptr<FrameConnectedBluetoothDevices> connected_devices_;
|
| +
|
| // Maps a device address to callbacks that are waiting for services to
|
| // be discovered for that device.
|
| std::unordered_map<std::string, std::vector<PrimaryServicesRequestCallback>>
|
|
|