| 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/ActiveDOMObject.h" | 9 #include "core/dom/ActiveDOMObject.h" |
| 10 #include "core/dom/DOMArrayPiece.h" | 10 #include "core/dom/DOMArrayPiece.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // CallbackPromiseAdapter templatized with this class. See this class's | 33 // CallbackPromiseAdapter templatized with this class. See this class's |
| 34 // "Interface required by CallbackPromiseAdapter" section and the | 34 // "Interface required by CallbackPromiseAdapter" section and the |
| 35 // CallbackPromiseAdapter class comments. | 35 // CallbackPromiseAdapter class comments. |
| 36 class BluetoothRemoteGATTCharacteristic final | 36 class BluetoothRemoteGATTCharacteristic final |
| 37 : public RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothRemote
GATTCharacteristic> | 37 : public RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothRemote
GATTCharacteristic> |
| 38 , public ActiveDOMObject | 38 , public ActiveDOMObject |
| 39 , public WebBluetoothRemoteGATTCharacteristic { | 39 , public WebBluetoothRemoteGATTCharacteristic { |
| 40 USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); | 40 USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); |
| 41 DEFINE_WRAPPERTYPEINFO(); | 41 DEFINE_WRAPPERTYPEINFO(); |
| 42 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothRemoteGATTCharacteristic)
; | 42 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothRemoteGATTCharacteristic)
; |
| 43 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); | 43 USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); |
| 44 public: | 44 public: |
| 45 explicit BluetoothRemoteGATTCharacteristic(ExecutionContext*, PassOwnPtr<Web
BluetoothRemoteGATTCharacteristicInit>); | 45 explicit BluetoothRemoteGATTCharacteristic(ExecutionContext*, PassOwnPtr<Web
BluetoothRemoteGATTCharacteristicInit>); |
| 46 | 46 |
| 47 // Interface required by CallbackPromiseAdapter. | 47 // Interface required by CallbackPromiseAdapter. |
| 48 using WebType = OwnPtr<WebBluetoothRemoteGATTCharacteristicInit>; | 48 using WebType = OwnPtr<WebBluetoothRemoteGATTCharacteristicInit>; |
| 49 static BluetoothRemoteGATTCharacteristic* take(ScriptPromiseResolver*, PassO
wnPtr<WebBluetoothRemoteGATTCharacteristicInit>); | 49 static BluetoothRemoteGATTCharacteristic* take(ScriptPromiseResolver*, PassO
wnPtr<WebBluetoothRemoteGATTCharacteristicInit>); |
| 50 | 50 |
| 51 // Save value. | 51 // Save value. |
| 52 void setValue(const PassRefPtr<DOMDataView>&); | 52 void setValue(const PassRefPtr<DOMDataView>&); |
| 53 | 53 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 79 PassRefPtr<DOMDataView> value() const { return m_value; } | 79 PassRefPtr<DOMDataView> value() const { return m_value; } |
| 80 ScriptPromise readValue(ScriptState*); | 80 ScriptPromise readValue(ScriptState*); |
| 81 ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&); | 81 ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&); |
| 82 ScriptPromise startNotifications(ScriptState*); | 82 ScriptPromise startNotifications(ScriptState*); |
| 83 ScriptPromise stopNotifications(ScriptState*); | 83 ScriptPromise stopNotifications(ScriptState*); |
| 84 | 84 |
| 85 DEFINE_ATTRIBUTE_EVENT_LISTENER(characteristicvaluechanged); | 85 DEFINE_ATTRIBUTE_EVENT_LISTENER(characteristicvaluechanged); |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 // EventTarget overrides. | 88 // EventTarget overrides. |
| 89 bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillB
eRawPtr<EventListener>, const EventListenerOptions&) override; | 89 bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventLis
tener>, const EventListenerOptions&) override; |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 OwnPtr<WebBluetoothRemoteGATTCharacteristicInit> m_webCharacteristic; | 92 OwnPtr<WebBluetoothRemoteGATTCharacteristicInit> m_webCharacteristic; |
| 93 bool m_stopped; | 93 bool m_stopped; |
| 94 Member<BluetoothCharacteristicProperties> m_properties; | 94 Member<BluetoothCharacteristicProperties> m_properties; |
| 95 RefPtr<DOMDataView> m_value; | 95 RefPtr<DOMDataView> m_value; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace blink | 98 } // namespace blink |
| 99 | 99 |
| 100 #endif // BluetoothRemoteGATTCharacteristic_h | 100 #endif // BluetoothRemoteGATTCharacteristic_h |
| OLD | NEW |