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

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

Issue 1152393002: bluetooth: Blink side implementation of getPrimaryService (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-get-primary-service-interface
Patch Set: Add BluetoothGATTService to webexposed layout test 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/BluetoothGATTService.h
diff --git a/Source/modules/bluetooth/BluetoothGATTService.h b/Source/modules/bluetooth/BluetoothGATTService.h
index 357cfd1c01a33545823585248c80d11302380b4f..add812b6c8adc98f5f2851916296128072e790c6 100644
--- a/Source/modules/bluetooth/BluetoothGATTService.h
+++ b/Source/modules/bluetooth/BluetoothGATTService.h
@@ -7,18 +7,42 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "platform/heap/Handle.h"
+#include "public/platform/modules/bluetooth/WebBluetoothGATTService.h"
+#include "wtf/text/WTFString.h"
namespace blink {
+class ScriptPromiseResolver;
+
// Represents a GATT Service within a Bluetooth Peripheral, a collection of
// characteristics and relationships to other services that encapsulate the
// behavior of part of a device.
+//
+// Callbacks providing WebBluetoothGATTService objects are handled by
+// CallbackPromiseAdapter templatized with this class. See this class's
+// "Interface required by CallbackPromiseAdapter" section and the
+// CallbackPromiseAdapter class comments.
class BluetoothGATTService final
- : public GarbageCollected<BluetoothGATTService>
+ : public GarbageCollectedFinalized<BluetoothGATTService>
, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
+ explicit BluetoothGATTService(const WebBluetoothGATTService&);
+
+ // Interface required by CallbackPromiseAdapter:
+ typedef WebBluetoothGATTService WebType;
+ static BluetoothGATTService* take(ScriptPromiseResolver*, WebBluetoothGATTService*);
+ static void dispose(WebBluetoothGATTService*);
+
+ // Interface required by garbage collection.
DEFINE_INLINE_TRACE() { }
+
+ // IDL exposed interface:
+ String uuid() { return m_webService.uuid; }
+ bool isPrimary() { return m_webService.isPrimary; }
+
+private:
+ WebBluetoothGATTService m_webService;
};
} // namespace blink
« no previous file with comments | « Source/modules/bluetooth/BluetoothGATTRemoteServer.idl ('k') | Source/modules/bluetooth/BluetoothGATTService.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698