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

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

Issue 1060593004: bluetooth: connectGATT and receive WebBluetoothGATTRemoteServer from embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Web Exposed test changed Created 5 years, 8 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/BluetoothGATTRemoteServer.h
diff --git a/Source/modules/bluetooth/BluetoothGATTRemoteServer.h b/Source/modules/bluetooth/BluetoothGATTRemoteServer.h
index ffea825dd4bf309348352a31d409c478cfd2a069..75e865c6b55e779b82d20d167ad7ea653d9ae554 100644
--- a/Source/modules/bluetooth/BluetoothGATTRemoteServer.h
+++ b/Source/modules/bluetooth/BluetoothGATTRemoteServer.h
@@ -7,18 +7,38 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "platform/heap/Heap.h"
+#include "public/platform/modules/bluetooth/WebBluetoothGATTRemoteServer.h"
namespace blink {
+class ScriptPromiseResolver;
+
// BluetoothGATTRemoteServer provides a way to interact with a connected bluetooth peripheral.
+//
+// Callbacks providing WebBluetoothGATTRemoteServer objects are handled by
+// CallbackPromiseAdapter templatized with this class. See this class's
+// "Interface required by CallbackPromiseAdapter" section and the
+// CallbackPromiseAdapter class comments.
class BluetoothGATTRemoteServer final
- : public GarbageCollected<BluetoothGATTRemoteServer>
+ : public GarbageCollectedFinalized<BluetoothGATTRemoteServer>
, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
+ BluetoothGATTRemoteServer(const WebBluetoothGATTRemoteServer&);
+
+ // Interface required by CallbackPromiseAdapter:
+ typedef WebBluetoothGATTRemoteServer WebType;
+ static BluetoothGATTRemoteServer* take(ScriptPromiseResolver*, WebBluetoothGATTRemoteServer*);
+ static void dispose(WebBluetoothGATTRemoteServer*);
// Interface required by Garbage Collectoin:
DEFINE_INLINE_TRACE() { }
+
+ // IDL exposed interface:
+ bool connected() { return m_webGATT.connected; }
+
+private:
+ WebBluetoothGATTRemoteServer m_webGATT;
};
} // namespace blink
« no previous file with comments | « Source/modules/bluetooth/BluetoothDevice.idl ('k') | Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698