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

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: 1. getPrimaryService impl 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..bf37c4a0dc3ff4c386f8726842188488872ea863 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:
+ BluetoothGATTService(const WebBluetoothGATTService&);
haraken 2015/05/24 00:13:51 Add explicit.
ortuno 2015/05/27 21:24:47 Done.
+
+ // 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

Powered by Google App Engine
This is Rietveld 408576698