Chromium Code Reviews| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h |
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h |
| index ca7efb124a359d6d9c2b0374056fd9fd6a095514..54f046f08bf573c7a9eaa5db3853dc09340e62d8 100644 |
| --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h |
| @@ -5,16 +5,17 @@ |
| #ifndef BluetoothRemoteGATTCharacteristic_h |
| #define BluetoothRemoteGATTCharacteristic_h |
| +#include <memory> |
| #include "bindings/core/v8/ScriptWrappable.h" |
| #include "core/dom/ContextLifecycleObserver.h" |
| #include "core/dom/DOMArrayPiece.h" |
| #include "core/dom/DOMDataView.h" |
| #include "modules/EventTargetModules.h" |
| #include "modules/bluetooth/BluetoothRemoteGATTService.h" |
| +#include "mojo/public/cpp/bindings/associated_binding.h" |
| #include "platform/heap/Handle.h" |
| #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" |
| #include "wtf/text/WTFString.h" |
| -#include <memory> |
| namespace blink { |
| @@ -34,7 +35,8 @@ class ScriptState; |
| // CallbackPromiseAdapter class comments. |
| class BluetoothRemoteGATTCharacteristic final |
| : public EventTargetWithInlineData, |
| - public ContextLifecycleObserver { |
| + public ContextLifecycleObserver, |
| + public mojom::blink::WebBluetoothCharacteristicClient { |
| USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); |
| DEFINE_WRAPPERTYPEINFO(); |
| USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); |
| @@ -55,11 +57,13 @@ class BluetoothRemoteGATTCharacteristic final |
| // Save value. |
| void setValue(DOMDataView*); |
| - void dispatchCharacteristicValueChanged(const Vector<uint8_t>& value); |
| - |
| // ContextLifecycleObserver interface. |
| void contextDestroyed(ExecutionContext*) override; |
| + // mojom::blink::WebBluetoothCharacteristicClient: |
| + void RemoteCharacteristicValueChanged( |
|
ortuno
2017/03/01 04:52:06
nit: Move this above contextDestroyed so that both
juncai
2017/03/02 03:23:49
Done.
|
| + const WTF::Vector<uint8_t>& value) override; |
| + |
| // USING_PRE_FINALIZER interface. |
| // Called before the object gets garbage collected. |
| void dispose(); |
| @@ -110,8 +114,10 @@ class BluetoothRemoteGATTCharacteristic final |
| void WriteValueCallback(ScriptPromiseResolver*, |
| const Vector<uint8_t>& value, |
| mojom::blink::WebBluetoothResult); |
| - void NotificationsCallback(ScriptPromiseResolver*, |
| - mojom::blink::WebBluetoothResult); |
| + void NotificationsCallback( |
| + ScriptPromiseResolver*, |
| + mojom::blink::WebBluetoothResult, |
| + mojom::blink::WebBluetoothCharacteristicClientAssociatedRequest); |
| ScriptPromise getDescriptorsImpl(ScriptState*, |
| mojom::blink::WebBluetoothGATTQueryQuantity, |
| @@ -130,7 +136,8 @@ class BluetoothRemoteGATTCharacteristic final |
| mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr m_characteristic; |
| Member<BluetoothRemoteGATTService> m_service; |
| - bool m_stopped; |
| + mojo::AssociatedBinding<mojom::blink::WebBluetoothCharacteristicClient> |
|
ortuno
2017/03/01 04:52:06
nit: move this to the end.
juncai
2017/03/02 03:23:49
Done.
|
| + m_clientBinding; |
| Member<BluetoothCharacteristicProperties> m_properties; |
| Member<DOMDataView> m_value; |
| Member<BluetoothDevice> m_device; |