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

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

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Implement WebBluetooth getDescriptor[s] 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "modules/bluetooth/BluetoothRemoteGATTDescriptor.h"
6
7 #include "core/dom/DOMException.h"
8 #include "modules/bluetooth/BluetoothRemoteGATTService.h"
9 #include <memory>
10
11 namespace blink {
12
13 BluetoothRemoteGATTDescriptor::BluetoothRemoteGATTDescriptor(
14 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr descriptor,
15 BluetoothRemoteGATTCharacteristic* characteristic)
16 : m_descriptor(std::move(descriptor)), m_characteristic(characteristic) {}
17
18 BluetoothRemoteGATTDescriptor* BluetoothRemoteGATTDescriptor::create(
19 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr descriptor,
20
21 BluetoothRemoteGATTCharacteristic* characteristic) {
22 BluetoothRemoteGATTDescriptor* result =
23 new BluetoothRemoteGATTDescriptor(std::move(descriptor), characteristic);
24 return result;
25 }
26
27 ScriptPromise BluetoothRemoteGATTDescriptor::readValue(
28 ScriptState* scriptState) {
29 // TODO(668837): Implement WebBluetooth descriptor.readValue()
30 return ScriptPromise::rejectWithDOMException(
31 scriptState,
32 DOMException::create(NotSupportedError,
33 "descriptor readValue is not implemented "
34 "yet. See https://goo.gl/J6ASzs"));
35 }
36
37 ScriptPromise BluetoothRemoteGATTDescriptor::writeValue(
38 ScriptState* scriptState,
39 const DOMArrayPiece& value) {
40 // TODO(668838): Implement WebBluetooth descriptor.writeValue()
41 return ScriptPromise::rejectWithDOMException(
42 scriptState,
43 DOMException::create(NotSupportedError,
44 "descriptor writeValue is not implemented "
45 "yet. See https://goo.gl/J6ASzs"));
46 }
47
48 DEFINE_TRACE(BluetoothRemoteGATTDescriptor) {
49 visitor->trace(m_characteristic);
50 visitor->trace(m_value);
51 }
52
53 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698