Chromium Code Reviews| Index: Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp |
| diff --git a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp |
| index 35ecae79b130676c19680a0539ee8bb5b45cbb37..8d253d783c6beb8aa47e18c9517ee691d76e280f 100644 |
| --- a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp |
| +++ b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp |
| @@ -10,6 +10,7 @@ |
| #include "bindings/core/v8/ScriptPromiseResolver.h" |
| #include "core/dom/DOMException.h" |
| #include "core/dom/ExceptionCode.h" |
| +#include "modules/bluetooth/BluetoothArrayBuffer.h" |
| #include "modules/bluetooth/BluetoothError.h" |
| #include "public/platform/Platform.h" |
| #include "public/platform/modules/bluetooth/WebBluetooth.h" |
| @@ -35,4 +36,15 @@ void BluetoothGATTCharacteristic::dispose(WebBluetoothGATTCharacteristic* webCha |
| delete webCharacteristic; |
| } |
| +ScriptPromise BluetoothGATTCharacteristic::readValue(ScriptState* scriptState) |
| +{ |
| + WebBluetooth * webbluetooth = Platform::current()->bluetooth(); |
|
Jeffrey Yasskin
2015/06/10 21:12:25
Only put a space on one side of the '*'.
ortuno
2015/06/11 00:10:52
Done.
|
| + |
| + RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState); |
| + ScriptPromise promise = resolver->promise(); |
| + webbluetooth->readValue(m_webCharacteristic->characteristicInstanceID, new CallbackPromiseAdapter<BluetoothArrayBuffer, BluetoothError>(resolver)); |
| + |
| + return promise; |
| +} |
| + |
| } // namespace blink |