Chromium Code Reviews| Index: Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp |
| diff --git a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8ea538e88d35bf76b4cf07877472c0b221ae6848 |
| --- /dev/null |
| +++ b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp |
| @@ -0,0 +1,39 @@ |
| +// 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/BluetoothGATTCharacteristic.h" |
| + |
| +#include "bindings/core/v8/CallbackPromiseAdapter.h" |
| +#include "bindings/core/v8/ScriptPromise.h" |
| +#include "bindings/core/v8/ScriptPromiseResolver.h" |
| +#include "core/dom/DOMException.h" |
| +#include "core/dom/ExceptionCode.h" |
| +#include "modules/bluetooth/BluetoothError.h" |
| +#include "public/platform/Platform.h" |
| +#include "public/platform/modules/bluetooth/WebBluetooth.h" |
| +#include "wtf/OwnPtr.h" |
| + |
| +namespace blink { |
| + |
| +BluetoothGATTCharacteristic::BluetoothGATTCharacteristic(const WebBluetoothGATTCharacteristic& webCharacteristic) |
| + : m_webCharacteristic(webCharacteristic) |
| +{ |
| +} |
| + |
| +BluetoothGATTCharacteristic* BluetoothGATTCharacteristic::take(ScriptPromiseResolver*, WebBluetoothGATTCharacteristic* webCharacteristicRawPointer) |
| +{ |
| + if (!webCharacteristicRawPointer) { |
| + return nullptr; |
| + } |
| + OwnPtr<WebBluetoothGATTCharacteristic> webCharacteristic = adoptPtr(webCharacteristicRawPointer); |
| + return new BluetoothGATTCharacteristic(*webCharacteristic); |
|
Jeffrey Yasskin
2015/06/03 00:24:04
This is a little weird (was probably weird in your
ortuno
2015/06/03 21:57:04
Changed to PassOwnPtr. OwnPtr alone won't compile.
|
| +} |
| + |
| +void BluetoothGATTCharacteristic::dispose(WebBluetoothGATTCharacteristic* webCharacteristic) |
| +{ |
| + delete webCharacteristic; |
| +} |
| + |
| +} // namespace blink |