OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const std::string& characteristic_instance_id, | 97 const std::string& characteristic_instance_id, |
98 const std::vector<uint8_t>& value); | 98 const std::vector<uint8_t>& value); |
99 | 99 |
100 // WebBluetoothService methods: | 100 // WebBluetoothService methods: |
101 void RequestDevice(blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, | 101 void RequestDevice(blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, |
102 const RequestDeviceCallback& callback) override; | 102 const RequestDeviceCallback& callback) override; |
103 void RemoteServerConnect( | 103 void RemoteServerConnect( |
104 const WebBluetoothDeviceId& device_id, | 104 const WebBluetoothDeviceId& device_id, |
105 blink::mojom::WebBluetoothServerClientAssociatedPtrInfo client, | 105 blink::mojom::WebBluetoothServerClientAssociatedPtrInfo client, |
106 const RemoteServerConnectCallback& callback) override; | 106 const RemoteServerConnectCallback& callback) override; |
107 void RemoteServerDisconnect(const WebBluetoothDeviceId& device_id) override; | |
108 void RemoteServerGetPrimaryServices( | 107 void RemoteServerGetPrimaryServices( |
109 const WebBluetoothDeviceId& device_id, | 108 const WebBluetoothDeviceId& device_id, |
110 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 109 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
111 const base::Optional<device::BluetoothUUID>& services_uuid, | 110 const base::Optional<device::BluetoothUUID>& services_uuid, |
112 const RemoteServerGetPrimaryServicesCallback& callback) override; | 111 const RemoteServerGetPrimaryServicesCallback& callback) override; |
113 void RemoteServiceGetCharacteristics( | 112 void RemoteServiceGetCharacteristics( |
114 const std::string& service_instance_id, | 113 const std::string& service_instance_id, |
115 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 114 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
116 const base::Optional<device::BluetoothUUID>& characteristics_uuid, | 115 const base::Optional<device::BluetoothUUID>& characteristics_uuid, |
117 const RemoteServiceGetCharacteristicsCallback& callback) override; | 116 const RemoteServiceGetCharacteristicsCallback& callback) override; |
(...skipping 22 matching lines...) Expand all Loading... |
140 void RemoteDescriptorWriteValue( | 139 void RemoteDescriptorWriteValue( |
141 const std::string& descriptor_instance_id, | 140 const std::string& descriptor_instance_id, |
142 const std::vector<uint8_t>& value, | 141 const std::vector<uint8_t>& value, |
143 const RemoteDescriptorWriteValueCallback& callback) override; | 142 const RemoteDescriptorWriteValueCallback& callback) override; |
144 | 143 |
145 void RequestDeviceImpl( | 144 void RequestDeviceImpl( |
146 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, | 145 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, |
147 const RequestDeviceCallback& callback, | 146 const RequestDeviceCallback& callback, |
148 device::BluetoothAdapter* adapter); | 147 device::BluetoothAdapter* adapter); |
149 | 148 |
| 149 // Renderer has closed the pipe because it no longer needs a connection |
| 150 // to this device. Because: |
| 151 // 1. Content script code has called disconnect() |
| 152 // 2. The actual device disconnected, WebBluetoothServiceImpl informed the |
| 153 // renderer, and renderer reacted. |
| 154 void OnGATTServerClientDisconnection(const WebBluetoothDeviceId& device_id); |
| 155 |
150 // Should only be run after the services have been discovered for | 156 // Should only be run after the services have been discovered for |
151 // |device_address|. | 157 // |device_address|. |
152 void RemoteServerGetPrimaryServicesImpl( | 158 void RemoteServerGetPrimaryServicesImpl( |
153 const WebBluetoothDeviceId& device_id, | 159 const WebBluetoothDeviceId& device_id, |
154 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 160 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
155 const base::Optional<device::BluetoothUUID>& services_uuid, | 161 const base::Optional<device::BluetoothUUID>& services_uuid, |
156 const RemoteServerGetPrimaryServicesCallback& callback, | 162 const RemoteServerGetPrimaryServicesCallback& callback, |
157 device::BluetoothDevice* device); | 163 device::BluetoothDevice* device); |
158 | 164 |
159 // Callbacks for BluetoothDeviceChooserController::GetDevice. | 165 // Callbacks for BluetoothDeviceChooserController::GetDevice. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 mojo::Binding<blink::mojom::WebBluetoothService> binding_; | 293 mojo::Binding<blink::mojom::WebBluetoothService> binding_; |
288 | 294 |
289 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; | 295 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; |
290 | 296 |
291 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); | 297 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); |
292 }; | 298 }; |
293 | 299 |
294 } // namespace content | 300 } // namespace content |
295 | 301 |
296 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 302 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
OLD | NEW |