| Index: content/browser/bluetooth/bluetooth_dispatcher_host.h
|
| diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.h b/content/browser/bluetooth/bluetooth_dispatcher_host.h
|
| index d55e58889e0b34cf6103ec2cf0def77f2e1dd0e7..a5d4a8dadf204d808e5ff4f52b31df54eb536d5f 100644
|
| --- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
|
| +++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
|
| @@ -14,6 +14,8 @@
|
| #include "base/memory/scoped_vector.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h"
|
| +#include "content/browser/bluetooth/bluetooth_metrics.h"
|
| +#include "content/common/bluetooth/bluetooth_messages.h"
|
| #include "content/public/browser/bluetooth_chooser.h"
|
| #include "content/public/browser/browser_message_filter.h"
|
| #include "device/bluetooth/bluetooth_adapter.h"
|
| @@ -53,6 +55,24 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
|
| void SetBluetoothAdapterForTesting(
|
| scoped_refptr<device::BluetoothAdapter> mock_adapter);
|
|
|
| + struct CacheQueryResult {
|
| + CacheQueryResult();
|
| + CacheQueryResult(CacheQueryOutcome outcome);
|
| + ~CacheQueryResult();
|
| + blink::WebBluetoothError GetWebError() const;
|
| + device::BluetoothDevice* device = nullptr;
|
| + device::BluetoothGattService* service = nullptr;
|
| + device::BluetoothGattCharacteristic* characteristic = nullptr;
|
| + CacheQueryOutcome outcome;
|
| + };
|
| +
|
| + // Queries the platform cache for a characteristic with
|
| + // |characteristic_instance_id|. Fills in the |outcome| field, and |device|,
|
| + // |service| and |characteristic| fields if successful.
|
| + CacheQueryResult QueryCacheForCharacteristic(
|
| + const url::Origin& origin,
|
| + const std::string& characteristic_instance_id);
|
| +
|
| protected:
|
| ~BluetoothDispatcherHost() override;
|
|
|
| @@ -60,7 +80,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
|
| friend class base::DeleteHelper<BluetoothDispatcherHost>;
|
| friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
|
|
|
| - struct CacheQueryResult;
|
| struct RequestDeviceSession;
|
| struct PrimaryServicesRequest;
|
|
|
| @@ -129,11 +148,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
|
| int request_id,
|
| int frame_routing_id,
|
| const std::string& characteristic_instance_id);
|
| - void OnWriteValue(int thread_id,
|
| - int request_id,
|
| - int frame_routing_id,
|
| - const std::string& characteristic_instance_id,
|
| - const std::vector<uint8_t>& value);
|
| void OnStartNotifications(int thread_id,
|
| int request_id,
|
| int frame_routing_id,
|
| @@ -210,12 +224,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
|
| int request_id,
|
| device::BluetoothGattService::GattErrorCode);
|
|
|
| - // Callbacks for BluetoothGattCharacteristic::WriteRemoteCharacteristic.
|
| - void OnWriteValueSuccess(int thread_id, int request_id);
|
| - void OnWriteValueFailed(int thread_id,
|
| - int request_id,
|
| - device::BluetoothGattService::GattErrorCode);
|
| -
|
| // Callbacks for BluetoothGattCharacteristic::StartNotifySession.
|
| void OnStartNotifySessionSuccess(
|
| int thread_id,
|
| @@ -247,12 +255,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
|
| // in the |outcome| field, and |device| and |service| fields if successful.
|
| CacheQueryResult QueryCacheForService(const url::Origin& origin,
|
| const std::string& service_instance_id);
|
| - // Queries the platform cache for a characteristic with
|
| - // |characteristic_instance_id|. Fills in the |outcome| field, and |device|,
|
| - // |service| and |characteristic| fields if successful.
|
| - CacheQueryResult QueryCacheForCharacteristic(
|
| - const url::Origin& origin,
|
| - const std::string& characteristic_instance_id);
|
|
|
| // Adds the PrimaryServicesRequest to the vector of pending services requests
|
| // for that device.
|
|
|