| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.h
|
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4d7443d62c1e71cecbb1fed437edfa97b63f1e2c
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.h
|
| @@ -0,0 +1,64 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef BluetoothRemoteGATTDescriptor_h
|
| +#define BluetoothRemoteGATTDescriptor_h
|
| +
|
| +#include "bindings/core/v8/ScriptWrappable.h"
|
| +#include "core/dom/ActiveDOMObject.h"
|
| +#include "core/dom/DOMArrayPiece.h"
|
| +#include "core/dom/DOMDataView.h"
|
| +#include "modules/EventTargetModules.h"
|
| +#include "modules/bluetooth/BluetoothRemoteGATTCharacteristic.h"
|
| +#include "modules/bluetooth/BluetoothRemoteGATTService.h"
|
| +#include "platform/heap/Handle.h"
|
| +#include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristic.h"
|
| +#include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTDescriptorInit.h"
|
| +#include "wtf/text/WTFString.h"
|
| +#include <memory>
|
| +
|
| +namespace blink {
|
| +
|
| +class BluetoothRemoteGATTCharacteristic;
|
| +class ScriptPromise;
|
| +class ScriptState;
|
| +
|
| +// BluetoothRemoteGATTDescriptor represents a GATT Descriptor, which is
|
| +// a basic data element that provides further information about a peripheral's
|
| +// characteristic.
|
| +class BluetoothRemoteGATTDescriptor final
|
| + : public GarbageCollectedFinalized<BluetoothRemoteGATTDescriptor>,
|
| + public ScriptWrappable {
|
| + DEFINE_WRAPPERTYPEINFO();
|
| +
|
| + public:
|
| + BluetoothRemoteGATTDescriptor(
|
| + std::unique_ptr<WebBluetoothRemoteGATTDescriptorInit>,
|
| + BluetoothRemoteGATTCharacteristic*);
|
| +
|
| + // IDL exposed interface:
|
| + BluetoothRemoteGATTCharacteristic* characteristic() {
|
| + return m_characteristic;
|
| + }
|
| + String uuid() { return m_webDescriptor->uuid; }
|
| + DOMDataView* value() const { return m_value; }
|
| + ScriptPromise readValue(ScriptState*);
|
| + ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&);
|
| +
|
| + // Interface required by garbage collection.
|
| + DECLARE_VIRTUAL_TRACE();
|
| +
|
| + private:
|
| + friend class DescriptorReadValueCallback;
|
| +
|
| + BluetoothRemoteGATTServer* getGatt() { return m_characteristic->gatt(); }
|
| +
|
| + std::unique_ptr<WebBluetoothRemoteGATTDescriptorInit> m_webDescriptor;
|
| + Member<BluetoothRemoteGATTCharacteristic> m_characteristic;
|
| + Member<DOMDataView> m_value;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // BluetoothRemoteGATTDescriptor_h
|
|
|