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

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: 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..097345de638615fab288119f9729c8d25af2db65 100644
--- a/Source/modules/bluetooth/BluetoothGATTRemoteServer.h
+++ b/Source/modules/bluetooth/BluetoothGATTRemoteServer.h
@@ -7,18 +7,40 @@
#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>
scheib 2015/04/21 17:57:29 I don't think we need this object to be Finalized,
ortuno 2015/04/21 19:54:07 WebBluetoothGATTRemoteServer needs to be finalized
, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
+ BluetoothGATTRemoteServer(const WebBluetoothGATTRemoteServer&);
+
+ static BluetoothGATTRemoteServer* create(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

Powered by Google App Engine
This is Rietveld 408576698