Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp |
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..618615d1e69d4d7c1e0d34281def4de20cc203dd |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "modules/bluetooth/BluetoothRemoteGATTDescriptor.h" |
+ |
+#include "core/dom/DOMException.h" |
+#include "modules/bluetooth/BluetoothRemoteGATTService.h" |
+ |
+namespace blink { |
+ |
+BluetoothRemoteGATTDescriptor::BluetoothRemoteGATTDescriptor( |
+ std::unique_ptr<WebBluetoothRemoteGATTDescriptorInit> webDescriptor, |
+ BluetoothRemoteGATTCharacteristic* characteristic) |
+ : m_webDescriptor(std::move(webDescriptor)), |
+ m_characteristic(characteristic) {} |
+ |
+ScriptPromise BluetoothRemoteGATTDescriptor::readValue( |
+ ScriptState* scriptState) { |
+ // TODO(668837): Implement WebBluetooth descriptor.readValue() |
+ return ScriptPromise::rejectWithDOMException( |
+ scriptState, |
+ DOMException::create(NotSupportedError, |
+ "descriptor readValue is not implemented " |
+ "yet. See https://goo.gl/J6ASzs")); |
+} |
+ |
+ScriptPromise BluetoothRemoteGATTDescriptor::writeValue( |
+ ScriptState* scriptState, |
+ const DOMArrayPiece& value) { |
+ // TODO(668838): Implement WebBluetooth descriptor.writeValue() |
+ return ScriptPromise::rejectWithDOMException( |
+ scriptState, |
+ DOMException::create(NotSupportedError, |
+ "descriptor writeValue is not implemented " |
+ "yet. See https://goo.gl/J6ASzs")); |
+} |
+ |
+DEFINE_TRACE(BluetoothRemoteGATTDescriptor) { |
+ visitor->trace(m_characteristic); |
+ visitor->trace(m_value); |
+} |
+ |
+} // namespace blink |