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

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

Issue 1146163005: bluetooth: Blink-side implementation of getCharacteristic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-characteristic-interface
Patch Set: getCharacteristic Blink-Side Created 5 years, 7 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.h
diff --git a/Source/modules/bluetooth/BluetoothGATTCharacteristic.h b/Source/modules/bluetooth/BluetoothGATTCharacteristic.h
index 0fe3937176832b077c058f834f4d7d957c10b186..f317d38c3baf07d97b863b401749fd53097013ce 100644
--- a/Source/modules/bluetooth/BluetoothGATTCharacteristic.h
+++ b/Source/modules/bluetooth/BluetoothGATTCharacteristic.h
@@ -7,19 +7,41 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "platform/heap/Handle.h"
+#include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h"
+#include "wtf/text/WTFString.h"
namespace blink {
+class ScriptPromiseResolver;
+
// BluetoothGATTCharacteristic represents a GATT Characteristic, which is a
// basic data element that provides further information about a peripheral's
// service.
+//
+// Callbacks providing WebBluetoothGATTCharacteristic objects are handled by
+// CallbackPromiseAdapter templatized with this class. See this class's
+// "Interface required by CallbackPromiseAdapter" section and the
+// CallbackPromiseAdapter class comments.
class BluetoothGATTCharacteristic final
- : public GarbageCollected<BluetoothGATTCharacteristic>
+ : public GarbageCollectedFinalized<BluetoothGATTCharacteristic>
, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
+ explicit BluetoothGATTCharacteristic(const WebBluetoothGATTCharacteristic&);
+
+ // Interface required by CallbackPromiseAdapter.
+ typedef WebBluetoothGATTCharacteristic WebType;
+ static BluetoothGATTCharacteristic* take(ScriptPromiseResolver* , WebBluetoothGATTCharacteristic*);
+ static void dispose(WebBluetoothGATTCharacteristic*);
+
// Interface required by garbage collection.
DEFINE_INLINE_TRACE() { }
+
+ // IDL exposed interface:
+ String uuid() { return m_webCharacteristic.uuid; }
+
+private:
+ WebBluetoothGATTCharacteristic m_webCharacteristic;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698