Chromium Code Reviews| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp |
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..198a6b90bff457569d6aec9e7ff061e7c1545230 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.cpp |
| @@ -0,0 +1,48 @@ |
| +// 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. |
| + |
| +#include "config.h" |
| +#include "modules/bluetooth/BluetoothCharacteristicProperties.h" |
| + |
| +namespace blink { |
| + |
| +BluetoothCharacteristicProperties* BluetoothCharacteristicProperties::create(uint32_t properties) |
| +{ |
| + return new BluetoothCharacteristicProperties(properties); |
| +} |
| + |
| +BluetoothCharacteristicProperties::BluetoothCharacteristicProperties(uint32_t properties) |
| + : m_broadcast(false) |
| + , m_read(false) |
| + , m_writeWithoutResponse(false) |
| + , m_write(false) |
| + , m_notify(false) |
| + , m_indicate(false) |
| + , m_authenticatedSignedWrites(false) |
| + , m_reliableWrite(false) |
| + , m_writableAuxiliaries(false) |
| +{ |
| + ASSERT(properties != static_cast<uint32_t>(Property::NONE)); |
| + |
| + if (properties & static_cast<uint32_t>(Property::BROADCAST)) |
|
scheib
2015/10/20 19:50:35
The 'enum class' vs 'enum' is requiring you to add
ortuno
2015/10/20 23:33:23
Done.
|
| + m_broadcast = true; |
| + if (properties & static_cast<uint32_t>(Property::READ)) |
| + m_read = true; |
| + if (properties & static_cast<uint32_t>(Property::WRITE_WITHOUT_RESPONSE)) |
| + m_writeWithoutResponse = true; |
| + if (properties & static_cast<uint32_t>(Property::WRITE)) |
| + m_write = true; |
| + if (properties & static_cast<uint32_t>(Property::NOTIFY)) |
| + m_notify = true; |
| + if (properties & static_cast<uint32_t>(Property::INDICATE)) |
| + m_indicate = true; |
| + if (properties & static_cast<uint32_t>(Property::AUTHENTICATED_SIGNED_WRITES)) |
| + m_authenticatedSignedWrites = true; |
| + if (properties & static_cast<uint32_t>(Property::RELIABLE_WRITE)) |
| + m_reliableWrite = true; |
| + if (properties & static_cast<uint32_t>(Property::WRITABLE_AUXILIARIES)) |
| + m_writableAuxiliaries = true; |
| +} |
| + |
| +} // namespace blink |