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 15 matching lines...) Expand all Loading... |
26 namespace blink { | 26 namespace blink { |
27 class WebBluetoothGATTCharacteristic; | 27 class WebBluetoothGATTCharacteristic; |
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 BluetoothPrimaryServiceRequest; | 35 struct BluetoothPrimaryServiceRequest; |
| 36 struct BluetoothWriteValueRequest; |
36 struct BluetoothNotificationsRequest; | 37 struct BluetoothNotificationsRequest; |
37 | 38 |
38 namespace content { | 39 namespace content { |
39 class ThreadSafeSender; | 40 class ThreadSafeSender; |
40 | 41 |
41 // Dispatcher for child process threads which communicates to the browser's | 42 // Dispatcher for child process threads which communicates to the browser's |
42 // BluetoothDispatcherHost. | 43 // BluetoothDispatcherHost. |
43 // | 44 // |
44 // Instances are created for each thread as necessary by WebBluetoothImpl. | 45 // Instances are created for each thread as necessary by WebBluetoothImpl. |
45 // | 46 // |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // Tracks requests to get a primary service from a device. | 235 // Tracks requests to get a primary service from a device. |
235 // Owns request objects. | 236 // Owns request objects. |
236 IDMap<BluetoothPrimaryServiceRequest, IDMapOwnPointer> | 237 IDMap<BluetoothPrimaryServiceRequest, IDMapOwnPointer> |
237 pending_primary_service_requests_; | 238 pending_primary_service_requests_; |
238 // Tracks requests to get a characteristic from a service. | 239 // Tracks requests to get a characteristic from a service. |
239 IDMap<BluetoothCharacteristicRequest, IDMapOwnPointer> | 240 IDMap<BluetoothCharacteristicRequest, IDMapOwnPointer> |
240 pending_characteristic_requests_; | 241 pending_characteristic_requests_; |
241 // Tracks requests to read from a characteristics. | 242 // Tracks requests to read from a characteristics. |
242 IDMap<blink::WebBluetoothReadValueCallbacks, IDMapOwnPointer> | 243 IDMap<blink::WebBluetoothReadValueCallbacks, IDMapOwnPointer> |
243 pending_read_value_requests_; | 244 pending_read_value_requests_; |
244 IDMap<blink::WebBluetoothWriteValueCallbacks, IDMapOwnPointer> | 245 IDMap<BluetoothWriteValueRequest, IDMapOwnPointer> |
245 pending_write_value_requests_; | 246 pending_write_value_requests_; |
246 IDMap<BluetoothNotificationsRequest, IDMapOwnPointer> | 247 IDMap<BluetoothNotificationsRequest, IDMapOwnPointer> |
247 pending_notifications_requests_; | 248 pending_notifications_requests_; |
248 | 249 |
249 // Map of characteristic_instance_id to a set of | 250 // Map of characteristic_instance_id to a set of |
250 // WebBluetoothGATTCharacteristic pointers. Keeps track of which | 251 // WebBluetoothGATTCharacteristic pointers. Keeps track of which |
251 // objects are subscribed to notifications. | 252 // objects are subscribed to notifications. |
252 std::map<std::string, std::set<blink::WebBluetoothGATTCharacteristic*>> | 253 std::map<std::string, std::set<blink::WebBluetoothGATTCharacteristic*>> |
253 active_notification_subscriptions_; | 254 active_notification_subscriptions_; |
254 | 255 |
255 // Map of characteristic_instance_ids to WebBluetoothGATTCharacteristics. | 256 // Map of characteristic_instance_ids to WebBluetoothGATTCharacteristics. |
256 // Keeps track of what characteristics have listeners. | 257 // Keeps track of what characteristics have listeners. |
257 // TODO(ortuno): We are assuming that there exists a single frame per | 258 // TODO(ortuno): We are assuming that there exists a single frame per |
258 // dispatcher, so there could be at most one characteristic object per | 259 // dispatcher, so there could be at most one characteristic object per |
259 // characteristic_instance_id. Change to a set when we support multiple | 260 // characteristic_instance_id. Change to a set when we support multiple |
260 // frames. | 261 // frames. |
261 // http://crbug.com/541388 | 262 // http://crbug.com/541388 |
262 std::map<std::string, blink::WebBluetoothGATTCharacteristic*> | 263 std::map<std::string, blink::WebBluetoothGATTCharacteristic*> |
263 active_characteristics_; | 264 active_characteristics_; |
264 | 265 |
265 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher); | 266 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher); |
266 }; | 267 }; |
267 | 268 |
268 } // namespace content | 269 } // namespace content |
269 | 270 |
270 #endif // CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ | 271 #endif // CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ |
OLD | NEW |