Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1531)

Unified Diff: Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp

Issue 1147243004: bluetooth: readValue Blink implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-read-value-interface
Patch Set: Fix Web Exposed Layout Test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
diff --git a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
index 35ecae79b130676c19680a0539ee8bb5b45cbb37..febc3ce2424ed8d5311b27a98d51ac3cd80d76dc 100644
--- a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
+++ b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
@@ -11,6 +11,7 @@
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
#include "modules/bluetooth/BluetoothError.h"
+#include "modules/bluetooth/ConvertWebVectorToArrayBuffer.h"
#include "public/platform/Platform.h"
#include "public/platform/modules/bluetooth/WebBluetooth.h"
#include "wtf/OwnPtr.h"
@@ -35,4 +36,15 @@ void BluetoothGATTCharacteristic::dispose(WebBluetoothGATTCharacteristic* webCha
delete webCharacteristic;
}
+ScriptPromise BluetoothGATTCharacteristic::readValue(ScriptState* scriptState)
+{
+ WebBluetooth* webbluetooth = Platform::current()->bluetooth();
+
+ RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
+ ScriptPromise promise = resolver->promise();
+ webbluetooth->readValue(m_webCharacteristic->characteristicInstanceID, new CallbackPromiseAdapter<ConvertWebVectorToArrayBuffer, BluetoothError>(resolver));
+
+ return promise;
+}
+
} // namespace blink
« no previous file with comments | « Source/modules/bluetooth/BluetoothGATTCharacteristic.h ('k') | Source/modules/bluetooth/BluetoothGATTCharacteristic.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698