Chromium Code Reviews| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h |
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h |
| index e182232a1009726cec4464d484e2fa25eb0457d7..e263ed513ddb829f162af948bec0612bc3c38c77 100644 |
| --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h |
| @@ -8,6 +8,7 @@ |
| #include "bindings/core/v8/ScriptWrappable.h" |
| #include "core/dom/ActiveDOMObject.h" |
| #include "core/dom/DOMArrayPiece.h" |
| +#include "modules/EventTargetModules.h" |
| #include "platform/heap/Handle.h" |
| #include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h" |
| #include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristicInit.h" |
| @@ -31,13 +32,13 @@ class ScriptState; |
| // "Interface required by CallbackPromiseAdapter" section and the |
| // CallbackPromiseAdapter class comments. |
| class BluetoothGATTCharacteristic final |
| - : public GarbageCollectedFinalized<BluetoothGATTCharacteristic> |
| - , public ScriptWrappable |
| + : public RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothGATTCharacteristic> |
| , public ActiveDOMObject |
| , public WebBluetoothGATTCharacteristic { |
| USING_PRE_FINALIZER(BluetoothGATTCharacteristic, dispose); |
| - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothGATTCharacteristic); |
| DEFINE_WRAPPERTYPEINFO(); |
| + REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothGATTCharacteristic); |
| + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothGATTCharacteristic); |
| public: |
| explicit BluetoothGATTCharacteristic(ExecutionContext*, PassOwnPtr<WebBluetoothGATTCharacteristicInit>); |
| @@ -45,6 +46,9 @@ public: |
| using WebType = OwnPtr<WebBluetoothGATTCharacteristicInit>; |
| static BluetoothGATTCharacteristic* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothGATTCharacteristicInit>); |
| + // Interface required by WebBluetoothGATTCharacteristic |
|
Jeffrey Yasskin
2015/10/15 23:00:51
This is just the implementation of WebBluetoothGAT
ortuno
2015/10/16 01:24:22
Done.
|
| + void dispatchCharacteristicValueChanged(const WebVector<uint8_t>& value); |
| + |
| // ActiveDOMObject interface. |
| void stop() override; |
| @@ -56,19 +60,28 @@ public: |
| // The function only notifies the embedder once. |
| void notifyCharacteristicObjectRemoved(); |
| + // Interface required by EventTarget. |
|
Jeffrey Yasskin
2015/10/15 23:00:51
Similarly here, these are just EventTarget methods
ortuno
2015/10/16 01:24:21
Done.
|
| + const WTF::AtomicString& interfaceName() const override; |
| + ExecutionContext* executionContext() const; |
| + bool addEventListener(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, bool useCapture) override; |
| + |
| // Interface required by garbage collection. |
| DECLARE_VIRTUAL_TRACE(); |
| // IDL exposed interface: |
| String uuid() { return m_webCharacteristic->uuid; } |
| + PassRefPtr<DOMArrayBuffer> value() const {return m_value;} |
|
Jeffrey Yasskin
2015/10/15 23:00:51
Style: Be consistent about spaces within braces. P
ortuno
2015/10/16 01:24:22
Done.
|
| ScriptPromise readValue(ScriptState*); |
| ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&); |
| ScriptPromise startNotifications(ScriptState*); |
| ScriptPromise stopNotifications(ScriptState*); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(characteristicvaluechanged); |
| + |
| private: |
| OwnPtr<WebBluetoothGATTCharacteristicInit> m_webCharacteristic; |
| bool m_stopped; |
| + RefPtr<DOMArrayBuffer> m_value; |
| }; |
| } // namespace blink |