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

Side by Side Diff: content/renderer/bluetooth/bluetooth_dispatcher.h

Issue 1775953004: bluetooth: Move writeValue to mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Moar clean up Created 4 years, 9 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 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 const std::vector<uint32_t>& characteristic_properties); 209 const std::vector<uint32_t>& characteristic_properties);
210 void OnGetCharacteristicsError(int thread_id, 210 void OnGetCharacteristicsError(int thread_id,
211 int request_id, 211 int request_id,
212 blink::WebBluetoothError error); 212 blink::WebBluetoothError error);
213 void OnReadValueSuccess(int thread_id, 213 void OnReadValueSuccess(int thread_id,
214 int request_id, 214 int request_id,
215 const std::vector<uint8_t>& value); 215 const std::vector<uint8_t>& value);
216 void OnReadValueError(int thread_id, 216 void OnReadValueError(int thread_id,
217 int request_id, 217 int request_id,
218 blink::WebBluetoothError error); 218 blink::WebBluetoothError error);
219 void OnWriteValueSuccess(int thread_id, int request_id);
220 void OnWriteValueError(int thread_id,
221 int request_id,
222 blink::WebBluetoothError error);
223 void OnStartNotificationsSuccess(int thread_id, int request_id); 219 void OnStartNotificationsSuccess(int thread_id, int request_id);
224 void OnStartNotificationsError(int thread_id, 220 void OnStartNotificationsError(int thread_id,
225 int request_id, 221 int request_id,
226 blink::WebBluetoothError error); 222 blink::WebBluetoothError error);
227 void OnStopNotificationsSuccess(int thread_id, int request_id); 223 void OnStopNotificationsSuccess(int thread_id, int request_id);
228 void OnCharacteristicValueChanged( 224 void OnCharacteristicValueChanged(
229 int thread_id, 225 int thread_id,
230 const std::string& characteristic_instance_id, 226 const std::string& characteristic_instance_id,
231 const std::vector<uint8_t> value); 227 const std::vector<uint8_t> value);
232 228
(...skipping 17 matching lines...) Expand all
250 pending_primary_service_requests_; 246 pending_primary_service_requests_;
251 // Tracks requests to get a characteristic from a service. 247 // Tracks requests to get a characteristic from a service.
252 IDMap<BluetoothCharacteristicRequest, IDMapOwnPointer> 248 IDMap<BluetoothCharacteristicRequest, IDMapOwnPointer>
253 pending_characteristic_requests_; 249 pending_characteristic_requests_;
254 // Tracks requests to get characteristics from a service. 250 // Tracks requests to get characteristics from a service.
255 IDMap<BluetoothCharacteristicsRequest, IDMapOwnPointer> 251 IDMap<BluetoothCharacteristicsRequest, IDMapOwnPointer>
256 pending_characteristics_requests_; 252 pending_characteristics_requests_;
257 // Tracks requests to read from a characteristics. 253 // Tracks requests to read from a characteristics.
258 IDMap<blink::WebBluetoothReadValueCallbacks, IDMapOwnPointer> 254 IDMap<blink::WebBluetoothReadValueCallbacks, IDMapOwnPointer>
259 pending_read_value_requests_; 255 pending_read_value_requests_;
260 IDMap<BluetoothWriteValueRequest, IDMapOwnPointer>
261 pending_write_value_requests_;
262 IDMap<BluetoothNotificationsRequest, IDMapOwnPointer> 256 IDMap<BluetoothNotificationsRequest, IDMapOwnPointer>
263 pending_notifications_requests_; 257 pending_notifications_requests_;
264 258
265 // Map of characteristic_instance_id to a set of 259 // Map of characteristic_instance_id to a set of
266 // WebBluetoothRemoteGATTCharacteristic pointers. Keeps track of which 260 // WebBluetoothRemoteGATTCharacteristic pointers. Keeps track of which
267 // objects are subscribed to notifications. 261 // objects are subscribed to notifications.
268 std::map<std::string, std::set<blink::WebBluetoothRemoteGATTCharacteristic*>> 262 std::map<std::string, std::set<blink::WebBluetoothRemoteGATTCharacteristic*>>
269 active_notification_subscriptions_; 263 active_notification_subscriptions_;
270 264
271 // Map of characteristic_instance_ids to 265 // Map of characteristic_instance_ids to
272 // WebBluetoothRemoteGATTCharacteristics. 266 // WebBluetoothRemoteGATTCharacteristics.
273 // Keeps track of what characteristics have listeners. 267 // Keeps track of what characteristics have listeners.
274 // TODO(ortuno): We are assuming that there exists a single frame per 268 // TODO(ortuno): We are assuming that there exists a single frame per
275 // dispatcher, so there could be at most one characteristic object per 269 // dispatcher, so there could be at most one characteristic object per
276 // characteristic_instance_id. Change to a set when we support multiple 270 // characteristic_instance_id. Change to a set when we support multiple
277 // frames. 271 // frames.
278 // http://crbug.com/541388 272 // http://crbug.com/541388
279 std::map<std::string, blink::WebBluetoothRemoteGATTCharacteristic*> 273 std::map<std::string, blink::WebBluetoothRemoteGATTCharacteristic*>
280 active_characteristics_; 274 active_characteristics_;
281 275
282 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher); 276 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher);
283 }; 277 };
284 278
285 } // namespace content 279 } // namespace content
286 280
287 #endif // CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_ 281 #endif // CONTENT_CHILD_BLUETOOTH_BLUETOOTH_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698