| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 ExecutionContext* getExecutionContext() const; | 74 ExecutionContext* getExecutionContext() const; |
| 75 | 75 |
| 76 // Interface required by garbage collection. | 76 // Interface required by garbage collection. |
| 77 DECLARE_VIRTUAL_TRACE(); | 77 DECLARE_VIRTUAL_TRACE(); |
| 78 | 78 |
| 79 // IDL exposed interface: | 79 // IDL exposed interface: |
| 80 BluetoothRemoteGATTService* service() { return m_service; } | 80 BluetoothRemoteGATTService* service() { return m_service; } |
| 81 String uuid() { return m_webCharacteristic->uuid; } | 81 String uuid() { return m_webCharacteristic->uuid; } |
| 82 BluetoothCharacteristicProperties* properties() { return m_properties; } | 82 BluetoothCharacteristicProperties* properties() { return m_properties; } |
| 83 DOMDataView* value() const { return m_value; } | 83 DOMDataView* value() const { return m_value; } |
| 84 ScriptPromise getDescriptor(ScriptState*, |
| 85 const StringOrUnsignedLong& descriptor, |
| 86 ExceptionState&); |
| 87 ScriptPromise getDescriptors(ScriptState*, ExceptionState&); |
| 88 ScriptPromise getDescriptors(ScriptState*, |
| 89 const StringOrUnsignedLong& descriptor, |
| 90 ExceptionState&); |
| 84 ScriptPromise readValue(ScriptState*); | 91 ScriptPromise readValue(ScriptState*); |
| 85 ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&); | 92 ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&); |
| 86 ScriptPromise startNotifications(ScriptState*); | 93 ScriptPromise startNotifications(ScriptState*); |
| 87 ScriptPromise stopNotifications(ScriptState*); | 94 ScriptPromise stopNotifications(ScriptState*); |
| 88 | 95 |
| 89 DEFINE_ATTRIBUTE_EVENT_LISTENER(characteristicvaluechanged); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(characteristicvaluechanged); |
| 90 | 97 |
| 91 protected: | 98 protected: |
| 92 // EventTarget overrides. | 99 // EventTarget overrides. |
| 93 void addedEventListener(const AtomicString& eventType, | 100 void addedEventListener(const AtomicString& eventType, |
| 94 RegisteredEventListener&) override; | 101 RegisteredEventListener&) override; |
| 95 | 102 |
| 96 private: | 103 private: |
| 97 friend class ReadValueCallback; | 104 friend class ReadValueCallback; |
| 98 friend class WriteValueCallback; | 105 friend class WriteValueCallback; |
| 99 friend class NotificationsCallback; | 106 friend class NotificationsCallback; |
| 100 | 107 |
| 101 BluetoothRemoteGATTServer* gatt() { return m_service->device()->gatt(); } | 108 BluetoothRemoteGATTServer* gatt() { return m_service->device()->gatt(); } |
| 102 | 109 |
| 110 ScriptPromise getDescriptorsImpl(ScriptState*, |
| 111 mojom::blink::WebBluetoothGATTQueryQuantity, |
| 112 const String& descriptorUUID = String()); |
| 113 |
| 103 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> m_webCharacteristic; | 114 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> m_webCharacteristic; |
| 104 Member<BluetoothRemoteGATTService> m_service; | 115 Member<BluetoothRemoteGATTService> m_service; |
| 105 bool m_stopped; | 116 bool m_stopped; |
| 106 Member<BluetoothCharacteristicProperties> m_properties; | 117 Member<BluetoothCharacteristicProperties> m_properties; |
| 107 Member<DOMDataView> m_value; | 118 Member<DOMDataView> m_value; |
| 108 }; | 119 }; |
| 109 | 120 |
| 110 } // namespace blink | 121 } // namespace blink |
| 111 | 122 |
| 112 #endif // BluetoothRemoteGATTCharacteristic_h | 123 #endif // BluetoothRemoteGATTCharacteristic_h |
| OLD | NEW |