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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h

Issue 2615093002: Typemap WebBluetoothDeviceId to WTF::String (Closed)
Patch Set: merge master Created 3 years, 11 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 BluetoothAttributeInstanceMap_h 5 #ifndef BluetoothAttributeInstanceMap_h
6 #define BluetoothAttributeInstanceMap_h 6 #define BluetoothAttributeInstanceMap_h
7 7
8 #include "modules/bluetooth/BluetoothRemoteGATTCharacteristic.h" 8 #include "modules/bluetooth/BluetoothRemoteGATTCharacteristic.h"
9 #include "modules/bluetooth/BluetoothRemoteGATTService.h" 9 #include "modules/bluetooth/BluetoothRemoteGATTService.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 12 matching lines...) Expand all
23 class BluetoothAttributeInstanceMap final 23 class BluetoothAttributeInstanceMap final
24 : public GarbageCollected<BluetoothAttributeInstanceMap> { 24 : public GarbageCollected<BluetoothAttributeInstanceMap> {
25 public: 25 public:
26 BluetoothAttributeInstanceMap(BluetoothDevice*); 26 BluetoothAttributeInstanceMap(BluetoothDevice*);
27 27
28 // Constructs a new BluetoothRemoteGATTService object if there was 28 // Constructs a new BluetoothRemoteGATTService object if there was
29 // no service with the same instance id and adds it to the map. 29 // no service with the same instance id and adds it to the map.
30 // Otherwise returns the BluetoothRemoteGATTService object already 30 // Otherwise returns the BluetoothRemoteGATTService object already
31 // in the map. 31 // in the map.
32 BluetoothRemoteGATTService* getOrCreateRemoteGATTService( 32 BluetoothRemoteGATTService* getOrCreateRemoteGATTService(
33 const String& serviceInstanceId, 33 mojom::blink::WebBluetoothRemoteGATTServicePtr,
34 const String& uuid,
35 bool isPrimary, 34 bool isPrimary,
36 const String& deviceInstanceId); 35 const String& deviceInstanceId);
37 36
38 // Returns true if a BluetoothRemoteGATTService with |serviceInstanceId| 37 // Returns true if a BluetoothRemoteGATTService with |serviceInstanceId|
39 // is in the map. 38 // is in the map.
40 bool containsService(const String& serviceInstanceId); 39 bool containsService(const String& serviceInstanceId);
41 40
42 // Constructs a new BluetoothRemoteGATTCharacteristic object if there was no 41 // Constructs a new BluetoothRemoteGATTCharacteristic object if there was no
43 // characteristic with the same instance id and adds it to the map. 42 // characteristic with the same instance id and adds it to the map.
44 // Otherwise returns the BluetoothRemoteGATTCharacteristic object already in 43 // Otherwise returns the BluetoothRemoteGATTCharacteristic object already in
45 // the map. 44 // the map.
46 BluetoothRemoteGATTCharacteristic* getOrCreateRemoteGATTCharacteristic( 45 BluetoothRemoteGATTCharacteristic* getOrCreateRemoteGATTCharacteristic(
47 ExecutionContext*, 46 ExecutionContext*,
48 const String& characteristicInstanceId,
49 const String& serviceInstanceId, 47 const String& serviceInstanceId,
50 const String& uuid, 48 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr,
51 uint32_t characteristicProperties,
52 BluetoothRemoteGATTService*); 49 BluetoothRemoteGATTService*);
53 50
54 // Returns true if a BluetoothRemoteGATTCharacteristic with 51 // Returns true if a BluetoothRemoteGATTCharacteristic with
55 // |characteristicInstanceId| is in the map. 52 // |characteristicInstanceId| is in the map.
56 bool containsCharacteristic(const String& characteristicInstanceId); 53 bool containsCharacteristic(const String& characteristicInstanceId);
57 54
58 // Removes all Attributes from the map. 55 // Removes all Attributes from the map.
59 // TODO(crbug.com/654950): Remove descriptors when implemented. 56 // TODO(crbug.com/654950): Remove descriptors when implemented.
60 void Clear(); 57 void Clear();
61 58
62 DECLARE_VIRTUAL_TRACE(); 59 DECLARE_VIRTUAL_TRACE();
63 60
64 private: 61 private:
65 // BluetoothDevice that owns this map. 62 // BluetoothDevice that owns this map.
66 Member<BluetoothDevice> m_device; 63 Member<BluetoothDevice> m_device;
67 // Map of service instance ids to objects. 64 // Map of service instance ids to objects.
68 HeapHashMap<String, Member<BluetoothRemoteGATTService>> m_serviceIdToObject; 65 HeapHashMap<String, Member<BluetoothRemoteGATTService>> m_serviceIdToObject;
69 // Map of characteristic instance ids to objects. 66 // Map of characteristic instance ids to objects.
70 HeapHashMap<String, Member<BluetoothRemoteGATTCharacteristic>> 67 HeapHashMap<String, Member<BluetoothRemoteGATTCharacteristic>>
71 m_characteristicIdToObject; 68 m_characteristicIdToObject;
72 }; 69 };
73 70
74 } // namespace blink 71 } // namespace blink
75 72
76 #endif // BluetoothAttributeInstanceMap_h 73 #endif // BluetoothAttributeInstanceMap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698