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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.h

Issue 2637343002: Implement WebBluetooth descriptor.readValue() (Closed)
Patch Set: #1 Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 BluetoothRemoteGATTDescriptor_h 5 #ifndef BluetoothRemoteGATTDescriptor_h
6 #define BluetoothRemoteGATTDescriptor_h 6 #define BluetoothRemoteGATTDescriptor_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/DOMArrayPiece.h" 9 #include "core/dom/DOMArrayPiece.h"
10 #include "core/dom/DOMDataView.h" 10 #include "core/dom/DOMDataView.h"
(...skipping 29 matching lines...) Expand all
40 40
41 // IDL exposed interface: 41 // IDL exposed interface:
42 BluetoothRemoteGATTCharacteristic* characteristic() { 42 BluetoothRemoteGATTCharacteristic* characteristic() {
43 return m_characteristic; 43 return m_characteristic;
44 } 44 }
45 String uuid() { return m_descriptor->uuid; } 45 String uuid() { return m_descriptor->uuid; }
46 DOMDataView* value() const { return m_value; } 46 DOMDataView* value() const { return m_value; }
47 ScriptPromise readValue(ScriptState*); 47 ScriptPromise readValue(ScriptState*);
48 ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&); 48 ScriptPromise writeValue(ScriptState*, const DOMArrayPiece&);
49 49
50 // Save value.
51 void setValue(DOMDataView*);
52
50 // Interface required by garbage collection. 53 // Interface required by garbage collection.
51 DECLARE_VIRTUAL_TRACE(); 54 DECLARE_VIRTUAL_TRACE();
52 55
53 private: 56 private:
54 friend class DescriptorReadValueCallback; 57 friend class DescriptorReadValueCallback;
55 58
56 BluetoothRemoteGATTServer* getGatt() { return m_characteristic->getGatt(); } 59 BluetoothRemoteGATTServer* getGatt() { return m_characteristic->getGatt(); }
57 60
61 void ReadValueCallback(ScriptPromiseResolver*,
62 mojom::blink::WebBluetoothResult,
63 const Optional<Vector<uint8_t>>&);
64
58 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr m_descriptor; 65 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr m_descriptor;
59 Member<BluetoothRemoteGATTCharacteristic> m_characteristic; 66 Member<BluetoothRemoteGATTCharacteristic> m_characteristic;
60 Member<DOMDataView> m_value; 67 Member<DOMDataView> m_value;
61 }; 68 };
62 69
63 } // namespace blink 70 } // namespace blink
64 71
65 #endif // BluetoothRemoteGATTDescriptor_h 72 #endif // BluetoothRemoteGATTDescriptor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698