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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTDescriptor.cpp

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Remove macos restriction Created 4 years 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698