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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BluetoothGATTCharacteristic_h 5 #ifndef BluetoothGATTCharacteristic_h
6 #define BluetoothGATTCharacteristic_h 6 #define BluetoothGATTCharacteristic_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 #include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h"
11 #include "wtf/text/WTFString.h"
10 12
11 namespace blink { 13 namespace blink {
12 14
15 class ScriptPromiseResolver;
16
13 // BluetoothGATTCharacteristic represents a GATT Characteristic, which is a 17 // BluetoothGATTCharacteristic represents a GATT Characteristic, which is a
14 // basic data element that provides further information about a peripheral's 18 // basic data element that provides further information about a peripheral's
15 // service. 19 // service.
20 //
21 // Callbacks providing WebBluetoothGATTCharacteristic objects are handled by
22 // CallbackPromiseAdapter templatized with this class. See this class's
23 // "Interface required by CallbackPromiseAdapter" section and the
24 // CallbackPromiseAdapter class comments.
16 class BluetoothGATTCharacteristic final 25 class BluetoothGATTCharacteristic final
17 : public GarbageCollected<BluetoothGATTCharacteristic> 26 : public GarbageCollectedFinalized<BluetoothGATTCharacteristic>
18 , public ScriptWrappable { 27 , public ScriptWrappable {
19 DEFINE_WRAPPERTYPEINFO(); 28 DEFINE_WRAPPERTYPEINFO();
20 public: 29 public:
30 explicit BluetoothGATTCharacteristic(const WebBluetoothGATTCharacteristic&);
31
32 // Interface required by CallbackPromiseAdapter.
33 typedef WebBluetoothGATTCharacteristic WebType;
34 static BluetoothGATTCharacteristic* take(ScriptPromiseResolver* , WebBluetoo thGATTCharacteristic*);
35 static void dispose(WebBluetoothGATTCharacteristic*);
36
21 // Interface required by garbage collection. 37 // Interface required by garbage collection.
22 DEFINE_INLINE_TRACE() { } 38 DEFINE_INLINE_TRACE() { }
39
40 // IDL exposed interface:
41 String uuid() { return m_webCharacteristic.uuid; }
42
43 private:
44 WebBluetoothGATTCharacteristic m_webCharacteristic;
23 }; 45 };
24 46
25 } // namespace blink 47 } // namespace blink
26 48
27 #endif // BluetoothGATTCharacteristic_h 49 #endif // BluetoothGATTCharacteristic_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698