OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BluetoothRemoteGATTCharacteristic_h | 5 #ifndef BluetoothRemoteGATTCharacteristic_h |
6 #define BluetoothRemoteGATTCharacteristic_h | 6 #define BluetoothRemoteGATTCharacteristic_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
10 #include "core/dom/DOMArrayPiece.h" | 10 #include "core/dom/DOMArrayPiece.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 class BluetoothRemoteGATTCharacteristic final | 35 class BluetoothRemoteGATTCharacteristic final |
36 : public EventTargetWithInlineData, | 36 : public EventTargetWithInlineData, |
37 public ContextLifecycleObserver { | 37 public ContextLifecycleObserver { |
38 USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); | 38 USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); |
39 DEFINE_WRAPPERTYPEINFO(); | 39 DEFINE_WRAPPERTYPEINFO(); |
40 USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); | 40 USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); |
41 | 41 |
42 public: | 42 public: |
43 explicit BluetoothRemoteGATTCharacteristic( | 43 explicit BluetoothRemoteGATTCharacteristic( |
44 ExecutionContext*, | 44 ExecutionContext*, |
45 const String& serviceInstanceId, | |
46 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, | 45 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, |
47 BluetoothRemoteGATTService*, | 46 BluetoothRemoteGATTService*, |
48 BluetoothDevice*); | 47 BluetoothDevice*); |
49 | 48 |
50 static BluetoothRemoteGATTCharacteristic* create( | 49 static BluetoothRemoteGATTCharacteristic* create( |
51 ExecutionContext*, | 50 ExecutionContext*, |
52 const String& serviceInstanceId, | |
53 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, | 51 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, |
54 BluetoothRemoteGATTService*, | 52 BluetoothRemoteGATTService*, |
55 BluetoothDevice*); | 53 BluetoothDevice*); |
56 | 54 |
57 // Save value. | 55 // Save value. |
58 void setValue(DOMDataView*); | 56 void setValue(DOMDataView*); |
59 | 57 |
60 void dispatchCharacteristicValueChanged(const Vector<uint8_t>& value); | 58 void dispatchCharacteristicValueChanged(const Vector<uint8_t>& value); |
61 | 59 |
62 // ContextLifecycleObserver interface. | 60 // ContextLifecycleObserver interface. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 97 |
100 void ReadValueCallback(ScriptPromiseResolver*, | 98 void ReadValueCallback(ScriptPromiseResolver*, |
101 mojom::blink::WebBluetoothResult, | 99 mojom::blink::WebBluetoothResult, |
102 const Optional<Vector<uint8_t>>& value); | 100 const Optional<Vector<uint8_t>>& value); |
103 void WriteValueCallback(ScriptPromiseResolver*, | 101 void WriteValueCallback(ScriptPromiseResolver*, |
104 const Vector<uint8_t>& value, | 102 const Vector<uint8_t>& value, |
105 mojom::blink::WebBluetoothResult); | 103 mojom::blink::WebBluetoothResult); |
106 void NotificationsCallback(ScriptPromiseResolver*, | 104 void NotificationsCallback(ScriptPromiseResolver*, |
107 mojom::blink::WebBluetoothResult); | 105 mojom::blink::WebBluetoothResult); |
108 | 106 |
109 const String m_serviceInstanceId; | |
110 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr m_characteristic; | 107 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr m_characteristic; |
111 Member<BluetoothRemoteGATTService> m_service; | 108 Member<BluetoothRemoteGATTService> m_service; |
112 bool m_stopped; | 109 bool m_stopped; |
113 Member<BluetoothCharacteristicProperties> m_properties; | 110 Member<BluetoothCharacteristicProperties> m_properties; |
114 Member<DOMDataView> m_value; | 111 Member<DOMDataView> m_value; |
115 Member<BluetoothDevice> m_device; | 112 Member<BluetoothDevice> m_device; |
116 }; | 113 }; |
117 | 114 |
118 } // namespace blink | 115 } // namespace blink |
119 | 116 |
120 #endif // BluetoothRemoteGATTCharacteristic_h | 117 #endif // BluetoothRemoteGATTCharacteristic_h |
OLD | NEW |