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 BluetoothGATTCharacteristic_h | 5 #ifndef BluetoothGATTCharacteristic_h |
6 #define BluetoothGATTCharacteristic_h | 6 #define BluetoothGATTCharacteristic_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/ActiveDOMObject.h" | 9 #include "core/dom/ActiveDOMObject.h" |
10 #include "core/dom/DOMArrayPiece.h" | 10 #include "core/dom/DOMArrayPiece.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
41 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothGATTCharacteristic); | 41 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothGATTCharacteristic); |
42 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothGATTCharacteristic); | 42 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothGATTCharacteristic); |
43 public: | 43 public: |
44 explicit BluetoothGATTCharacteristic(ExecutionContext*, PassOwnPtr<WebBlueto
othGATTCharacteristicInit>); | 44 explicit BluetoothGATTCharacteristic(ExecutionContext*, PassOwnPtr<WebBlueto
othGATTCharacteristicInit>); |
45 | 45 |
46 // Interface required by CallbackPromiseAdapter. | 46 // Interface required by CallbackPromiseAdapter. |
47 using WebType = OwnPtr<WebBluetoothGATTCharacteristicInit>; | 47 using WebType = OwnPtr<WebBluetoothGATTCharacteristicInit>; |
48 static BluetoothGATTCharacteristic* take(ScriptPromiseResolver*, PassOwnPtr<
WebBluetoothGATTCharacteristicInit>); | 48 static BluetoothGATTCharacteristic* take(ScriptPromiseResolver*, PassOwnPtr<
WebBluetoothGATTCharacteristicInit>); |
49 | 49 |
| 50 // Save value. |
| 51 void setValue(const PassRefPtr<DOMArrayBuffer>&); |
| 52 |
50 // WebBluetoothGATTCharacteristic interface: | 53 // WebBluetoothGATTCharacteristic interface: |
51 void dispatchCharacteristicValueChanged(const WebVector<uint8_t>& value) ove
rride; | 54 void dispatchCharacteristicValueChanged(const WebVector<uint8_t>&) override; |
52 | 55 |
53 // ActiveDOMObject interface. | 56 // ActiveDOMObject interface. |
54 void stop() override; | 57 void stop() override; |
55 | 58 |
56 // USING_PRE_FINALIZER interface. | 59 // USING_PRE_FINALIZER interface. |
57 // Called before the object gets garbage collected. | 60 // Called before the object gets garbage collected. |
58 void dispose(); | 61 void dispose(); |
59 | 62 |
60 // Notify our embedder that we should stop any notifications. | 63 // Notify our embedder that we should stop any notifications. |
61 // The function only notifies the embedder once. | 64 // The function only notifies the embedder once. |
(...skipping 25 matching lines...) Expand all Loading... |
87 private: | 90 private: |
88 OwnPtr<WebBluetoothGATTCharacteristicInit> m_webCharacteristic; | 91 OwnPtr<WebBluetoothGATTCharacteristicInit> m_webCharacteristic; |
89 bool m_stopped; | 92 bool m_stopped; |
90 Member<BluetoothCharacteristicProperties> m_properties; | 93 Member<BluetoothCharacteristicProperties> m_properties; |
91 RefPtr<DOMArrayBuffer> m_value; | 94 RefPtr<DOMArrayBuffer> m_value; |
92 }; | 95 }; |
93 | 96 |
94 } // namespace blink | 97 } // namespace blink |
95 | 98 |
96 #endif // BluetoothGATTCharacteristic_h | 99 #endif // BluetoothGATTCharacteristic_h |
OLD | NEW |