Chromium Code Reviews| 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 7bc0feb7825fa050ed641cd95b59954f55d3a447..f3e95020a326c872f8e52ea22a9cc01f80734149 100644 |
| --- a/content/browser/bluetooth/web_bluetooth_service_impl.h |
| +++ b/content/browser/bluetooth/web_bluetooth_service_impl.h |
| @@ -128,6 +128,18 @@ class CONTENT_EXPORT WebBluetoothServiceImpl |
| void RemoteCharacteristicStopNotifications( |
| const std::string& characteristic_instance_id, |
| const RemoteCharacteristicStopNotificationsCallback& callback) override; |
| + void RemoteCharacteristicGetDescriptors( |
| + const std::string& service_instance_id, |
| + blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| + const base::Optional<device::BluetoothUUID>& characteristics_uuid, |
| + const RemoteCharacteristicGetDescriptorsCallback& callback) override; |
| + void RemoteDescriptorReadValue( |
|
ortuno
2016/12/02 06:14:50
No need for RemoteDescriptorReadValue/WriteValue s
dougt
2016/12/02 18:31:28
Done.
|
| + const std::string& descriptor_instance_id, |
| + const RemoteDescriptorReadValueCallback& callback) override; |
| + void RemoteDescriptorWriteValue( |
| + const std::string& descriptor_instance_id, |
| + const std::vector<uint8_t>& value, |
| + const RemoteDescriptorWriteValueCallback& callback) override; |
| void RequestDeviceImpl( |
| blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, |
| @@ -163,16 +175,17 @@ class CONTENT_EXPORT WebBluetoothServiceImpl |
| device::BluetoothDevice::ConnectErrorCode error_code); |
| // Callbacks for BluetoothRemoteGattCharacteristic::ReadRemoteCharacteristic. |
| - void OnReadValueSuccess(const RemoteCharacteristicReadValueCallback& callback, |
| - const std::vector<uint8_t>& value); |
| - void OnReadValueFailed( |
| + void OnCharacteristicReadValueSuccess( |
| + const RemoteCharacteristicReadValueCallback& callback, |
| + const std::vector<uint8_t>& value); |
| + void OnCharacteristicReadValueFailed( |
| const RemoteCharacteristicReadValueCallback& callback, |
| device::BluetoothRemoteGattService::GattErrorCode error_code); |
| // Callbacks for BluetoothRemoteGattCharacteristic::WriteRemoteCharacteristic. |
| - void OnWriteValueSuccess( |
| + void OnCharacteristicWriteValueSuccess( |
| const RemoteCharacteristicWriteValueCallback& callback); |
| - void OnWriteValueFailed( |
| + void OnCharacteristicWriteValueFailed( |
| const RemoteCharacteristicWriteValueCallback& callback, |
| device::BluetoothRemoteGattService::GattErrorCode error_code); |
| @@ -189,6 +202,21 @@ class CONTENT_EXPORT WebBluetoothServiceImpl |
| const std::string& characteristic_instance_id, |
| const RemoteCharacteristicStopNotificationsCallback& callback); |
| + // Callbacks for BluetoothRemoteGattDescriptor::ReadRemoteDescriptor. |
|
ortuno
2016/12/02 06:14:50
Same here. No need for these callbacks.
dougt
2016/12/02 18:31:28
Done.
|
| + void OnDescriptorReadValueSuccess( |
| + const RemoteDescriptorReadValueCallback& callback, |
| + const std::vector<uint8_t>& value); |
| + void OnDescriptorReadValueFailed( |
| + const RemoteDescriptorReadValueCallback& callback, |
| + device::BluetoothRemoteGattService::GattErrorCode error_code); |
| + |
| + // Callbacks for BluetoothRemoteGattDescriptor::WriteRemoteDescriptor. |
| + void OnDescriptorWriteValueSuccess( |
| + const RemoteDescriptorWriteValueCallback& callback); |
| + void OnDescriptorWriteValueFailed( |
| + const RemoteDescriptorWriteValueCallback& callback, |
| + device::BluetoothRemoteGattService::GattErrorCode error_code); |
| + |
| // Functions to query the platform cache for the bluetooth object. |
| // result.outcome == CacheQueryOutcome::SUCCESS if the object was found in the |
| // cache. Otherwise result.outcome that can used to record the outcome and |
| @@ -211,6 +239,12 @@ class CONTENT_EXPORT WebBluetoothServiceImpl |
| CacheQueryResult QueryCacheForCharacteristic( |
| const std::string& characteristic_instance_id); |
| + // Queries the platform cache for a descriptor with |
|
ortuno
2016/12/02 06:14:50
No need for this one either.
dougt
2016/12/02 18:31:28
Done.
|
| + // |descriptor_instance_id|. Fills in the |outcome| field, and |service|, |
| + // |characteristic| and |descriptor| fields if successful. |
| + CacheQueryResult QueryCacheForDescriptor( |
| + const std::string& descriptor_instance_id); |
| + |
| RenderProcessHost* GetRenderProcessHost(); |
| device::BluetoothAdapter* GetAdapter(); |
| url::Origin GetOrigin(); |
| @@ -227,6 +261,8 @@ class CONTENT_EXPORT WebBluetoothServiceImpl |
| // Maps to get the object's parent based on its instanceID. |
| std::unordered_map<std::string, std::string> service_id_to_device_address_; |
| std::unordered_map<std::string, std::string> characteristic_id_to_service_id_; |
| + std::unordered_map<std::string, std::string> |
| + descriptor_id_to_characteristic_id_; |
| // Map to keep track of the connected Bluetooth devices. |
| std::unique_ptr<FrameConnectedBluetoothDevices> connected_devices_; |