| 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_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ | 6 #define CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace blink { | 26 namespace blink { |
| 27 class WebBluetoothRemoteGATTCharacteristic; | 27 class WebBluetoothRemoteGATTCharacteristic; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace IPC { | 30 namespace IPC { |
| 31 class Message; | 31 class Message; |
| 32 } | 32 } |
| 33 | 33 |
| 34 struct BluetoothCharacteristicRequest; | 34 struct BluetoothCharacteristicRequest; |
| 35 struct BluetoothCharacteristicsRequest; |
| 35 struct BluetoothPrimaryServiceRequest; | 36 struct BluetoothPrimaryServiceRequest; |
| 36 struct BluetoothWriteValueRequest; | 37 struct BluetoothWriteValueRequest; |
| 37 struct BluetoothNotificationsRequest; | 38 struct BluetoothNotificationsRequest; |
| 38 | 39 |
| 39 namespace content { | 40 namespace content { |
| 40 class ThreadSafeSender; | 41 class ThreadSafeSender; |
| 41 | 42 |
| 42 // Dispatcher for child process threads which communicates to the browser's | 43 // Dispatcher for child process threads which communicates to the browser's |
| 43 // BluetoothDispatcherHost. | 44 // BluetoothDispatcherHost. |
| 44 // | 45 // |
| (...skipping 22 matching lines...) Expand all Loading... |
| 67 blink::WebBluetoothRequestDeviceCallbacks* callbacks); | 68 blink::WebBluetoothRequestDeviceCallbacks* callbacks); |
| 68 void connect(int frame_routing_id, | 69 void connect(int frame_routing_id, |
| 69 const blink::WebString& device_id, | 70 const blink::WebString& device_id, |
| 70 blink::WebBluetoothRemoteGATTServerConnectCallbacks* callbacks); | 71 blink::WebBluetoothRemoteGATTServerConnectCallbacks* callbacks); |
| 71 void disconnect(int frame_routing_id, const blink::WebString& device_id); | 72 void disconnect(int frame_routing_id, const blink::WebString& device_id); |
| 72 void getPrimaryService( | 73 void getPrimaryService( |
| 73 int frame_routing_id, | 74 int frame_routing_id, |
| 74 const blink::WebString& device_id, | 75 const blink::WebString& device_id, |
| 75 const blink::WebString& service_uuid, | 76 const blink::WebString& service_uuid, |
| 76 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks); | 77 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks); |
| 77 | |
| 78 void getCharacteristic( | 78 void getCharacteristic( |
| 79 int frame_routing_id, | 79 int frame_routing_id, |
| 80 const blink::WebString& service_instance_id, | 80 const blink::WebString& service_instance_id, |
| 81 const blink::WebString& characteristic_uuid, | 81 const blink::WebString& characteristic_uuid, |
| 82 blink::WebBluetoothGetCharacteristicCallbacks* callbacks); | 82 blink::WebBluetoothGetCharacteristicCallbacks* callbacks); |
| 83 void getCharacteristics( |
| 84 int frame_routing_id, |
| 85 const blink::WebString& service_instance_id, |
| 86 const blink::WebString& characteristics_uuid, |
| 87 blink::WebBluetoothGetCharacteristicsCallbacks* callbacks); |
| 83 void readValue(int frame_routing_id, | 88 void readValue(int frame_routing_id, |
| 84 const blink::WebString& characteristic_instance_id, | 89 const blink::WebString& characteristic_instance_id, |
| 85 blink::WebBluetoothReadValueCallbacks* callbacks); | 90 blink::WebBluetoothReadValueCallbacks* callbacks); |
| 86 void writeValue(int frame_routing_id, | 91 void writeValue(int frame_routing_id, |
| 87 const blink::WebString& characteristic_instance_id, | 92 const blink::WebString& characteristic_instance_id, |
| 88 const blink::WebVector<uint8_t>& value, | 93 const blink::WebVector<uint8_t>& value, |
| 89 blink::WebBluetoothWriteValueCallbacks*); | 94 blink::WebBluetoothWriteValueCallbacks*); |
| 90 void startNotifications(int frame_routing_id, | 95 void startNotifications(int frame_routing_id, |
| 91 const blink::WebString& characteristic_instance_id, | 96 const blink::WebString& characteristic_instance_id, |
| 92 blink::WebBluetoothRemoteGATTCharacteristic* delegate, | 97 blink::WebBluetoothRemoteGATTCharacteristic* delegate, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 void OnGetPrimaryServiceError(int thread_id, | 194 void OnGetPrimaryServiceError(int thread_id, |
| 190 int request_id, | 195 int request_id, |
| 191 blink::WebBluetoothError error); | 196 blink::WebBluetoothError error); |
| 192 void OnGetCharacteristicSuccess(int thread_id, | 197 void OnGetCharacteristicSuccess(int thread_id, |
| 193 int request_id, | 198 int request_id, |
| 194 const std::string& characteristic_instance_id, | 199 const std::string& characteristic_instance_id, |
| 195 uint32_t characteristic_properties); | 200 uint32_t characteristic_properties); |
| 196 void OnGetCharacteristicError(int thread_id, | 201 void OnGetCharacteristicError(int thread_id, |
| 197 int request_id, | 202 int request_id, |
| 198 blink::WebBluetoothError error); | 203 blink::WebBluetoothError error); |
| 204 void OnGetCharacteristicsSuccess( |
| 205 int thread_id, |
| 206 int request_id, |
| 207 const std::vector<std::string>& characteristics_instance_ids, |
| 208 const std::vector<std::string>& characteristics_uuids, |
| 209 const std::vector<uint32_t>& characteristic_properties); |
| 210 void OnGetCharacteristicsError(int thread_id, |
| 211 int request_id, |
| 212 blink::WebBluetoothError error); |
| 199 void OnReadValueSuccess(int thread_id, | 213 void OnReadValueSuccess(int thread_id, |
| 200 int request_id, | 214 int request_id, |
| 201 const std::vector<uint8_t>& value); | 215 const std::vector<uint8_t>& value); |
| 202 void OnReadValueError(int thread_id, | 216 void OnReadValueError(int thread_id, |
| 203 int request_id, | 217 int request_id, |
| 204 blink::WebBluetoothError error); | 218 blink::WebBluetoothError error); |
| 205 void OnWriteValueSuccess(int thread_id, int request_id); | 219 void OnWriteValueSuccess(int thread_id, int request_id); |
| 206 void OnWriteValueError(int thread_id, | 220 void OnWriteValueError(int thread_id, |
| 207 int request_id, | 221 int request_id, |
| 208 blink::WebBluetoothError error); | 222 blink::WebBluetoothError error); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 230 // Owns callback objects. | 244 // Owns callback objects. |
| 231 IDMap<blink::WebBluetoothRemoteGATTServerConnectCallbacks, IDMapOwnPointer> | 245 IDMap<blink::WebBluetoothRemoteGATTServerConnectCallbacks, IDMapOwnPointer> |
| 232 pending_connect_requests_; | 246 pending_connect_requests_; |
| 233 // Tracks requests to get a primary service from a device. | 247 // Tracks requests to get a primary service from a device. |
| 234 // Owns request objects. | 248 // Owns request objects. |
| 235 IDMap<BluetoothPrimaryServiceRequest, IDMapOwnPointer> | 249 IDMap<BluetoothPrimaryServiceRequest, IDMapOwnPointer> |
| 236 pending_primary_service_requests_; | 250 pending_primary_service_requests_; |
| 237 // Tracks requests to get a characteristic from a service. | 251 // Tracks requests to get a characteristic from a service. |
| 238 IDMap<BluetoothCharacteristicRequest, IDMapOwnPointer> | 252 IDMap<BluetoothCharacteristicRequest, IDMapOwnPointer> |
| 239 pending_characteristic_requests_; | 253 pending_characteristic_requests_; |
| 254 // Tracks requests to get characteristics from a service. |
| 255 IDMap<BluetoothCharacteristicsRequest, IDMapOwnPointer> |
| 256 pending_characteristics_requests_; |
| 240 // Tracks requests to read from a characteristics. | 257 // Tracks requests to read from a characteristics. |
| 241 IDMap<blink::WebBluetoothReadValueCallbacks, IDMapOwnPointer> | 258 IDMap<blink::WebBluetoothReadValueCallbacks, IDMapOwnPointer> |
| 242 pending_read_value_requests_; | 259 pending_read_value_requests_; |
| 243 IDMap<BluetoothWriteValueRequest, IDMapOwnPointer> | 260 IDMap<BluetoothWriteValueRequest, IDMapOwnPointer> |
| 244 pending_write_value_requests_; | 261 pending_write_value_requests_; |
| 245 IDMap<BluetoothNotificationsRequest, IDMapOwnPointer> | 262 IDMap<BluetoothNotificationsRequest, IDMapOwnPointer> |
| 246 pending_notifications_requests_; | 263 pending_notifications_requests_; |
| 247 | 264 |
| 248 // Map of characteristic_instance_id to a set of | 265 // Map of characteristic_instance_id to a set of |
| 249 // WebBluetoothRemoteGATTCharacteristic pointers. Keeps track of which | 266 // WebBluetoothRemoteGATTCharacteristic pointers. Keeps track of which |
| (...skipping 11 matching lines...) Expand all Loading... |
| 261 // http://crbug.com/541388 | 278 // http://crbug.com/541388 |
| 262 std::map<std::string, blink::WebBluetoothRemoteGATTCharacteristic*> | 279 std::map<std::string, blink::WebBluetoothRemoteGATTCharacteristic*> |
| 263 active_characteristics_; | 280 active_characteristics_; |
| 264 | 281 |
| 265 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher); | 282 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher); |
| 266 }; | 283 }; |
| 267 | 284 |
| 268 } // namespace content | 285 } // namespace content |
| 269 | 286 |
| 270 #endif // CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ | 287 #endif // CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ |
| OLD | NEW |