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 "core/dom/DOMException.h" |
| 8 #include "modules/bluetooth/BluetoothRemoteGATTService.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 BluetoothRemoteGATTDescriptor::BluetoothRemoteGATTDescriptor( |
| 13 std::unique_ptr<WebBluetoothRemoteGATTDescriptorInit> webDescriptor, |
| 14 BluetoothRemoteGATTCharacteristic* characteristic) |
| 15 : m_webDescriptor(std::move(webDescriptor)), |
| 16 m_characteristic(characteristic) {} |
| 17 |
| 18 ScriptPromise BluetoothRemoteGATTDescriptor::readValue( |
| 19 ScriptState* scriptState) { |
| 20 // TODO(668837): Implement WebBluetooth descriptor.readValue() |
| 21 return ScriptPromise::rejectWithDOMException( |
| 22 scriptState, |
| 23 DOMException::create(NotSupportedError, |
| 24 "descriptor readValue is not implemented " |
| 25 "yet. See https://goo.gl/J6ASzs")); |
| 26 } |
| 27 |
| 28 ScriptPromise BluetoothRemoteGATTDescriptor::writeValue( |
| 29 ScriptState* scriptState, |
| 30 const DOMArrayPiece& value) { |
| 31 // TODO(668838): Implement WebBluetooth descriptor.writeValue() |
| 32 return ScriptPromise::rejectWithDOMException( |
| 33 scriptState, |
| 34 DOMException::create(NotSupportedError, |
| 35 "descriptor writeValue is not implemented " |
| 36 "yet. See https://goo.gl/J6ASzs")); |
| 37 } |
| 38 |
| 39 DEFINE_TRACE(BluetoothRemoteGATTDescriptor) { |
| 40 visitor->trace(m_characteristic); |
| 41 visitor->trace(m_value); |
| 42 } |
| 43 |
| 44 } // namespace blink |
OLD | NEW |