Chromium Code Reviews| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h |
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ad704789c27cbd584dee623053676f8c895b4648 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright 2015 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 BluetoothCharacteristicProperties_h |
| +#define BluetoothCharacteristicProperties_h |
| + |
| +#include "bindings/core/v8/ScriptWrappable.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +// Each BluetoothGATTCharacteristic exposes its characteristic properties |
| +// through a BluetoothCharacteristicProperties object. These properties express |
| +// what operations are valid on the characteristic. |
| + |
|
scheib
2015/10/20 19:50:35
Remove blank line
ortuno
2015/10/20 23:33:23
Done.
|
| +class BluetoothCharacteristicProperties final |
| + : public GarbageCollected<BluetoothCharacteristicProperties> |
| + , public ScriptWrappable { |
| + DEFINE_WRAPPERTYPEINFO(); |
| +public: |
| + static BluetoothCharacteristicProperties* create(uint32_t properties); |
| + |
| + bool broadcast() const { return m_broadcast; } |
| + bool read() const { return m_read; } |
| + bool writeWithoutResponse() const { return m_writeWithoutResponse; } |
| + bool write() const { return m_write; } |
| + bool notify() const { return m_notify; } |
| + bool indicate() const { return m_indicate; } |
| + bool authenticatedSignedWrites() const { return m_authenticatedSignedWrites; } |
| + bool reliableWrite() const { return m_reliableWrite; } |
| + bool writableAuxiliaries() const { return m_writableAuxiliaries; } |
| + |
| + DEFINE_INLINE_TRACE() { } |
| + |
| +private: |
| + explicit BluetoothCharacteristicProperties(uint32_t properties); |
| + |
| + enum class Property { |
| + NONE = 0, |
| + BROADCAST = 1 << 0, |
| + READ = 1 << 1, |
| + WRITE_WITHOUT_RESPONSE = 1 << 2, |
| + WRITE = 1 << 3, |
| + NOTIFY = 1 << 4, |
| + INDICATE = 1 << 5, |
| + AUTHENTICATED_SIGNED_WRITES = 1 << 6, |
| + EXTENDED_PROPERTIES = 1 << 7, // Not used in class. |
| + RELIABLE_WRITE = 1 << 8, |
| + WRITABLE_AUXILIARIES = 1 << 9, |
| + }; |
| + |
| + bool m_broadcast; |
|
scheib
2015/10/20 19:50:35
Store the single uint32_t 'properties' (4 bytes) a
ortuno
2015/10/20 23:33:24
Done.
|
| + bool m_read; |
| + bool m_writeWithoutResponse; |
| + bool m_write; |
| + bool m_notify; |
| + bool m_indicate; |
| + bool m_authenticatedSignedWrites; |
| + bool m_reliableWrite; |
| + bool m_writableAuxiliaries; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // GamepadButton_h |