| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| 6 #define CONTENT_RENDERER_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | 6 #define CONTENT_RENDERER_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const blink::WebString& characteristic_instance_id, | 79 const blink::WebString& characteristic_instance_id, |
| 80 blink::WebBluetoothRemoteGATTCharacteristic* characteristic) override; | 80 blink::WebBluetoothRemoteGATTCharacteristic* characteristic) override; |
| 81 void registerCharacteristicObject( | 81 void registerCharacteristicObject( |
| 82 const blink::WebString& characteristic_instance_id, | 82 const blink::WebString& characteristic_instance_id, |
| 83 blink::WebBluetoothRemoteGATTCharacteristic* characteristic) override; | 83 blink::WebBluetoothRemoteGATTCharacteristic* characteristic) override; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 struct GetCharacteristicsCallback; | 86 struct GetCharacteristicsCallback; |
| 87 // WebBluetoothServiceClient methods: | 87 // WebBluetoothServiceClient methods: |
| 88 void RemoteCharacteristicValueChanged( | 88 void RemoteCharacteristicValueChanged( |
| 89 const mojo::String& characteristic_instance_id, | 89 const std::string& characteristic_instance_id, |
| 90 mojo::Array<uint8_t> value) override; | 90 const std::vector<uint8_t>& value) override; |
| 91 void GattServerDisconnected(const WebBluetoothDeviceId& device_id) override; | 91 void GattServerDisconnected(const WebBluetoothDeviceId& device_id) override; |
| 92 | 92 |
| 93 // Callbacks for WebBluetoothService calls: | 93 // Callbacks for WebBluetoothService calls: |
| 94 void OnRequestDeviceComplete( | 94 void OnRequestDeviceComplete( |
| 95 std::unique_ptr<blink::WebBluetoothRequestDeviceCallbacks> callbacks, | 95 std::unique_ptr<blink::WebBluetoothRequestDeviceCallbacks> callbacks, |
| 96 const blink::mojom::WebBluetoothResult result, | 96 const blink::mojom::WebBluetoothResult result, |
| 97 blink::mojom::WebBluetoothDevicePtr device); | 97 blink::mojom::WebBluetoothDevicePtr device); |
| 98 void OnConnectComplete( | 98 void OnConnectComplete( |
| 99 std::unique_ptr<blink::WebBluetoothRemoteGATTServerConnectCallbacks> | 99 std::unique_ptr<blink::WebBluetoothRemoteGATTServerConnectCallbacks> |
| 100 callbacks, | 100 callbacks, |
| 101 blink::mojom::WebBluetoothResult result); | 101 blink::mojom::WebBluetoothResult result); |
| 102 void OnGetPrimaryServicesComplete( | 102 void OnGetPrimaryServicesComplete( |
| 103 const blink::WebString& device_id, | 103 const blink::WebString& device_id, |
| 104 std::unique_ptr<blink::WebBluetoothGetPrimaryServicesCallbacks> callbacks, | 104 std::unique_ptr<blink::WebBluetoothGetPrimaryServicesCallbacks> callbacks, |
| 105 blink::mojom::WebBluetoothResult result, | 105 blink::mojom::WebBluetoothResult result, |
| 106 mojo::Array<blink::mojom::WebBluetoothRemoteGATTServicePtr> services); | 106 base::Optional< |
| 107 std::vector<blink::mojom::WebBluetoothRemoteGATTServicePtr>> |
| 108 services); |
| 107 void OnGetCharacteristicsComplete( | 109 void OnGetCharacteristicsComplete( |
| 108 const blink::WebString& service_instance_id, | 110 const blink::WebString& service_instance_id, |
| 109 std::unique_ptr<blink::WebBluetoothGetCharacteristicsCallbacks> callbacks, | 111 std::unique_ptr<blink::WebBluetoothGetCharacteristicsCallbacks> callbacks, |
| 110 blink::mojom::WebBluetoothResult result, | 112 blink::mojom::WebBluetoothResult result, |
| 111 mojo::Array<blink::mojom::WebBluetoothRemoteGATTCharacteristicPtr> | 113 base::Optional< |
| 114 std::vector<blink::mojom::WebBluetoothRemoteGATTCharacteristicPtr>> |
| 112 characteristics); | 115 characteristics); |
| 113 void OnReadValueComplete( | 116 void OnReadValueComplete( |
| 114 std::unique_ptr<blink::WebBluetoothReadValueCallbacks> callbacks, | 117 std::unique_ptr<blink::WebBluetoothReadValueCallbacks> callbacks, |
| 115 blink::mojom::WebBluetoothResult result, | 118 blink::mojom::WebBluetoothResult result, |
| 116 mojo::Array<uint8_t> value); | 119 const base::Optional<std::vector<uint8_t>>& value); |
| 117 void OnWriteValueComplete( | 120 void OnWriteValueComplete( |
| 118 const blink::WebVector<uint8_t>& value, | 121 const blink::WebVector<uint8_t>& value, |
| 119 std::unique_ptr<blink::WebBluetoothWriteValueCallbacks> callbacks, | 122 std::unique_ptr<blink::WebBluetoothWriteValueCallbacks> callbacks, |
| 120 blink::mojom::WebBluetoothResult result); | 123 blink::mojom::WebBluetoothResult result); |
| 121 void OnStartNotificationsComplete( | 124 void OnStartNotificationsComplete( |
| 122 std::unique_ptr<blink::WebBluetoothNotificationsCallbacks> callbacks, | 125 std::unique_ptr<blink::WebBluetoothNotificationsCallbacks> callbacks, |
| 123 blink::mojom::WebBluetoothResult result); | 126 blink::mojom::WebBluetoothResult result); |
| 124 void OnStopNotificationsComplete( | 127 void OnStopNotificationsComplete( |
| 125 std::unique_ptr<blink::WebBluetoothNotificationsCallbacks> callbacks); | 128 std::unique_ptr<blink::WebBluetoothNotificationsCallbacks> callbacks); |
| 126 | 129 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 149 | 152 |
| 150 // Binding associated with |web_bluetooth_service_|. | 153 // Binding associated with |web_bluetooth_service_|. |
| 151 mojo::AssociatedBinding<blink::mojom::WebBluetoothServiceClient> binding_; | 154 mojo::AssociatedBinding<blink::mojom::WebBluetoothServiceClient> binding_; |
| 152 | 155 |
| 153 DISALLOW_COPY_AND_ASSIGN(WebBluetoothImpl); | 156 DISALLOW_COPY_AND_ASSIGN(WebBluetoothImpl); |
| 154 }; | 157 }; |
| 155 | 158 |
| 156 } // namespace content | 159 } // namespace content |
| 157 | 160 |
| 158 #endif // CONTENT_RENDERER_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | 161 #endif // CONTENT_RENDERER_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| OLD | NEW |