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 92d78eb0d2ac2b27db1035081ee4321784f641b3..d05d62c63b03258e068b6181572ee1b79f74525f 100644 |
| --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h |
| @@ -6,8 +6,10 @@ |
| #define BluetoothGATTCharacteristic_h |
| #include "bindings/core/v8/ScriptWrappable.h" |
| +#include "core/dom/ActiveDOMObject.h" |
| #include "core/dom/DOMArrayPiece.h" |
| #include "platform/heap/Handle.h" |
| +#include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h" |
| #include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristicInit.h" |
| #include "wtf/OwnPtr.h" |
| #include "wtf/PassOwnPtr.h" |
| @@ -15,6 +17,7 @@ |
| namespace blink { |
| +class ExecutionContext; |
| class ScriptPromise; |
| class ScriptPromiseResolver; |
| class ScriptState; |
| @@ -29,25 +32,39 @@ class ScriptState; |
| // CallbackPromiseAdapter class comments. |
| class BluetoothGATTCharacteristic final |
| : public GarbageCollectedFinalized<BluetoothGATTCharacteristic> |
| - , public ScriptWrappable { |
| + , public ScriptWrappable |
| + , public ActiveDOMObject |
| + , public WebBluetoothGATTCharacteristic { |
| + USING_PRE_FINALIZER(BluetoothGATTCharacteristic, dispose); |
| + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothGATTCharacteristic); |
|
haraken
2015/10/07 01:22:33
You don't need this. (WebBluetoothGATTCharacterist
ortuno
2015/10/07 17:03:55
I tried that but the compiler complains when Oilpa
haraken
2015/10/08 00:51:52
ah, sorry; you're right.
WILL_BE_USING_GARBAGE_C
|
| DEFINE_WRAPPERTYPEINFO(); |
| public: |
| - explicit BluetoothGATTCharacteristic(PassOwnPtr<WebBluetoothGATTCharacteristicInit>); |
| + explicit BluetoothGATTCharacteristic(ExecutionContext*, PassOwnPtr<WebBluetoothGATTCharacteristicInit>); |
| // Interface required by CallbackPromiseAdapter. |
| using WebType = OwnPtr<WebBluetoothGATTCharacteristicInit>; |
| static BluetoothGATTCharacteristic* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothGATTCharacteristicInit>); |
| + // ActiveDOMObject interface. |
| + void stop() override; |
| + |
| + // USING_PRE_FINALIZER interface. |
| + // Called when the object is getting garbage collected. |
|
haraken
2015/10/07 01:22:33
Called _before_
ortuno
2015/10/07 17:03:55
Done.
|
| + void dispose(); |
| + |
| // Interface required by garbage collection. |
| - DEFINE_INLINE_TRACE() { } |
| + DECLARE_VIRTUAL_TRACE(); |
| // IDL exposed interface: |
| String uuid() { return m_webCharacteristic->uuid; } |
| ScriptPromise readValue(ScriptState*); |
| ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&); |
| + ScriptPromise startNotifications(ScriptState*); |
| + ScriptPromise stopNotifications(ScriptState*); |
| private: |
| OwnPtr<WebBluetoothGATTCharacteristicInit> m_webCharacteristic; |
| + bool m_stopped; |
| }; |
| } // namespace blink |