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

Unified Diff: Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp

Issue 1146163005: bluetooth: Blink-side implementation of getCharacteristic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-characteristic-interface
Patch Set: Merged with TOT Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
diff --git a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..35ecae79b130676c19680a0539ee8bb5b45cbb37
--- /dev/null
+++ b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
@@ -0,0 +1,38 @@
+// Copyright 2015 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 "config.h"
+#include "modules/bluetooth/BluetoothGATTCharacteristic.h"
+
+#include "bindings/core/v8/CallbackPromiseAdapter.h"
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "core/dom/DOMException.h"
+#include "core/dom/ExceptionCode.h"
+#include "modules/bluetooth/BluetoothError.h"
+#include "public/platform/Platform.h"
+#include "public/platform/modules/bluetooth/WebBluetooth.h"
+#include "wtf/OwnPtr.h"
+
+namespace blink {
+
+BluetoothGATTCharacteristic::BluetoothGATTCharacteristic(PassOwnPtr<WebBluetoothGATTCharacteristic> webCharacteristic)
+ : m_webCharacteristic(webCharacteristic)
+{
+}
+
+BluetoothGATTCharacteristic* BluetoothGATTCharacteristic::take(ScriptPromiseResolver*, WebBluetoothGATTCharacteristic* webCharacteristicRawPointer)
+{
+ if (!webCharacteristicRawPointer) {
+ return nullptr;
+ }
+ return new BluetoothGATTCharacteristic(adoptPtr(webCharacteristicRawPointer));
+}
+
+void BluetoothGATTCharacteristic::dispose(WebBluetoothGATTCharacteristic* webCharacteristic)
+{
+ delete webCharacteristic;
+}
+
+} // namespace blink
« no previous file with comments | « Source/modules/bluetooth/BluetoothGATTCharacteristic.h ('k') | Source/modules/bluetooth/BluetoothGATTCharacteristic.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698