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

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: getCharacteristic Blink-Side Created 5 years, 7 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..8ea538e88d35bf76b4cf07877472c0b221ae6848
--- /dev/null
+++ b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
@@ -0,0 +1,39 @@
+// 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(const WebBluetoothGATTCharacteristic& webCharacteristic)
+ : m_webCharacteristic(webCharacteristic)
+{
+}
+
+BluetoothGATTCharacteristic* BluetoothGATTCharacteristic::take(ScriptPromiseResolver*, WebBluetoothGATTCharacteristic* webCharacteristicRawPointer)
+{
+ if (!webCharacteristicRawPointer) {
+ return nullptr;
+ }
+ OwnPtr<WebBluetoothGATTCharacteristic> webCharacteristic = adoptPtr(webCharacteristicRawPointer);
+ return new BluetoothGATTCharacteristic(*webCharacteristic);
Jeffrey Yasskin 2015/06/03 00:24:04 This is a little weird (was probably weird in your
ortuno 2015/06/03 21:57:04 Changed to PassOwnPtr. OwnPtr alone won't compile.
+}
+
+void BluetoothGATTCharacteristic::dispose(WebBluetoothGATTCharacteristic* webCharacteristic)
+{
+ delete webCharacteristic;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698