OLD | NEW |
---|---|
(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 "bindings/core/v8/CallbackPromiseAdapter.h" | |
8 #include "bindings/core/v8/ScriptPromise.h" | |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | |
10 #include "core/dom/DOMDataView.h" | |
11 #include "core/dom/DOMException.h" | |
12 #include "core/dom/ExceptionCode.h" | |
13 #include "core/events/Event.h" | |
14 #include "core/inspector/ConsoleMessage.h" | |
haraken
2016/12/09 00:26:04
Remove unused header includes from this file.
dougt
2016/12/09 19:20:07
Done.
| |
15 #include "modules/bluetooth/BluetoothError.h" | |
16 #include "modules/bluetooth/BluetoothRemoteGATTService.h" | |
17 #include "modules/bluetooth/BluetoothSupplement.h" | |
18 #include "public/platform/modules/bluetooth/WebBluetooth.h" | |
19 #include <memory> | |
20 | |
21 namespace blink { | |
22 | |
23 BluetoothRemoteGATTDescriptor::BluetoothRemoteGATTDescriptor( | |
24 std::unique_ptr<WebBluetoothRemoteGATTDescriptorInit> webDescriptor, | |
25 BluetoothRemoteGATTCharacteristic* characteristic) | |
26 : m_webDescriptor(std::move(webDescriptor)), | |
27 m_characteristic(characteristic) {} | |
28 | |
29 ScriptPromise BluetoothRemoteGATTDescriptor::readValue( | |
30 ScriptState* scriptState) { | |
31 // TODO(668837): Implement WebBluetooth descriptor.readValue() | |
32 return ScriptPromise::rejectWithDOMException( | |
33 scriptState, | |
34 DOMException::create(NotSupportedError, | |
35 "descriptor readValue is not implemented " | |
36 "yet. See https://goo.gl/J6ASzs")); | |
37 } | |
38 | |
39 ScriptPromise BluetoothRemoteGATTDescriptor::writeValue( | |
40 ScriptState* scriptState, | |
41 const DOMArrayPiece& value) { | |
42 // TODO(668838): Implement WebBluetooth descriptor.writeValue() | |
43 return ScriptPromise::rejectWithDOMException( | |
44 scriptState, | |
45 DOMException::create(NotSupportedError, | |
46 "descriptor writeValue is not implemented " | |
47 "yet. See https://goo.gl/J6ASzs")); | |
48 } | |
49 | |
50 DEFINE_TRACE(BluetoothRemoteGATTDescriptor) { | |
51 visitor->trace(m_characteristic); | |
52 visitor->trace(m_value); | |
53 } | |
54 | |
55 } // namespace blink | |
OLD | NEW |