Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Side by Side Diff: content/browser/bluetooth/web_bluetooth_service_impl.h

Issue 2654403002: Implement WebBluetooth descriptor.writeValue() (Closed)
Patch Set: Inital Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 const std::string& characteristic_instance_id, 129 const std::string& characteristic_instance_id,
130 const RemoteCharacteristicStopNotificationsCallback& callback) override; 130 const RemoteCharacteristicStopNotificationsCallback& callback) override;
131 void RemoteCharacteristicGetDescriptors( 131 void RemoteCharacteristicGetDescriptors(
132 const std::string& service_instance_id, 132 const std::string& service_instance_id,
133 blink::mojom::WebBluetoothGATTQueryQuantity quantity, 133 blink::mojom::WebBluetoothGATTQueryQuantity quantity,
134 const base::Optional<device::BluetoothUUID>& characteristics_uuid, 134 const base::Optional<device::BluetoothUUID>& characteristics_uuid,
135 const RemoteCharacteristicGetDescriptorsCallback& callback) override; 135 const RemoteCharacteristicGetDescriptorsCallback& callback) override;
136 void RemoteDescriptorReadValue( 136 void RemoteDescriptorReadValue(
137 const std::string& characteristic_instance_id, 137 const std::string& characteristic_instance_id,
138 const RemoteDescriptorReadValueCallback& callback) override; 138 const RemoteDescriptorReadValueCallback& callback) override;
139 139
ortuno 2017/01/28 00:22:51 nit: no new line.
dougt 2017/01/31 00:31:25 Done.
140 void RemoteDescriptorWriteValue(
141 const std::string& descriptor_instance_id,
142 const std::vector<uint8_t>& value,
143 const RemoteDescriptorWriteValueCallback& callback) override;
144
140 void RequestDeviceImpl( 145 void RequestDeviceImpl(
141 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, 146 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options,
142 const RequestDeviceCallback& callback, 147 const RequestDeviceCallback& callback,
143 device::BluetoothAdapter* adapter); 148 device::BluetoothAdapter* adapter);
144 149
145 // Should only be run after the services have been discovered for 150 // Should only be run after the services have been discovered for
146 // |device_address|. 151 // |device_address|.
147 void RemoteServerGetPrimaryServicesImpl( 152 void RemoteServerGetPrimaryServicesImpl(
148 const WebBluetoothDeviceId& device_id, 153 const WebBluetoothDeviceId& device_id,
149 blink::mojom::WebBluetoothGATTQueryQuantity quantity, 154 blink::mojom::WebBluetoothGATTQueryQuantity quantity,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const RemoteCharacteristicStopNotificationsCallback& callback); 204 const RemoteCharacteristicStopNotificationsCallback& callback);
200 205
201 // Callbacks for BluetoothRemoteGattDescriptor::ReadRemoteDescriptor. 206 // Callbacks for BluetoothRemoteGattDescriptor::ReadRemoteDescriptor.
202 void OnDescriptorReadValueSuccess( 207 void OnDescriptorReadValueSuccess(
203 const RemoteDescriptorReadValueCallback& callback, 208 const RemoteDescriptorReadValueCallback& callback,
204 const std::vector<uint8_t>& value); 209 const std::vector<uint8_t>& value);
205 void OnDescriptorReadValueFailed( 210 void OnDescriptorReadValueFailed(
206 const RemoteDescriptorReadValueCallback& callback, 211 const RemoteDescriptorReadValueCallback& callback,
207 device::BluetoothRemoteGattService::GattErrorCode error_code); 212 device::BluetoothRemoteGattService::GattErrorCode error_code);
208 213
214 // Callbacks for BluetoothRemoteGattDescriptor::WriteRemoteDescriptor.
215 void OnDescriptorWriteValueSuccess(
216 const RemoteDescriptorWriteValueCallback& callback);
217 void OnDescriptorWriteValueFailed(
218 const RemoteDescriptorWriteValueCallback& callback,
219 device::BluetoothRemoteGattService::GattErrorCode error_code);
220
209 // Functions to query the platform cache for the bluetooth object. 221 // Functions to query the platform cache for the bluetooth object.
210 // result.outcome == CacheQueryOutcome::SUCCESS if the object was found in the 222 // result.outcome == CacheQueryOutcome::SUCCESS if the object was found in the
211 // cache. Otherwise result.outcome that can used to record the outcome and 223 // cache. Otherwise result.outcome that can used to record the outcome and
212 // result.error will contain the error that should be sent to the renderer. 224 // result.error will contain the error that should be sent to the renderer.
213 // One of the possible outcomes is BAD_RENDERER. In this case we crash the 225 // One of the possible outcomes is BAD_RENDERER. In this case we crash the
214 // renderer, record the reason and close the pipe, so it's safe to drop 226 // renderer, record the reason and close the pipe, so it's safe to drop
215 // any callbacks. 227 // any callbacks.
216 228
217 // Queries the platform cache for a Device with |device_id| for |origin|. 229 // Queries the platform cache for a Device with |device_id| for |origin|.
218 // Fills in the |outcome| field and the |device| field if successful. 230 // Fills in the |outcome| field and the |device| field if successful.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 mojo::Binding<blink::mojom::WebBluetoothService> binding_; 290 mojo::Binding<blink::mojom::WebBluetoothService> binding_;
279 291
280 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; 292 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_;
281 293
282 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); 294 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl);
283 }; 295 };
284 296
285 } // namespace content 297 } // namespace content
286 298
287 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ 299 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698