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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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 "config.h"
6 #include "modules/bluetooth/BluetoothGATTCharacteristic.h"
7
8 #include "bindings/core/v8/CallbackPromiseAdapter.h"
9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h"
11 #include "core/dom/DOMException.h"
12 #include "core/dom/ExceptionCode.h"
13 #include "modules/bluetooth/BluetoothError.h"
14 #include "public/platform/Platform.h"
15 #include "public/platform/modules/bluetooth/WebBluetooth.h"
16 #include "wtf/OwnPtr.h"
17
18 namespace blink {
19
20 BluetoothGATTCharacteristic::BluetoothGATTCharacteristic(const WebBluetoothGATTC haracteristic& webCharacteristic)
21 : m_webCharacteristic(webCharacteristic)
22 {
23 }
24
25 BluetoothGATTCharacteristic* BluetoothGATTCharacteristic::take(ScriptPromiseReso lver*, WebBluetoothGATTCharacteristic* webCharacteristicRawPointer)
26 {
27 if (!webCharacteristicRawPointer) {
28 return nullptr;
29 }
30 OwnPtr<WebBluetoothGATTCharacteristic> webCharacteristic = adoptPtr(webChara cteristicRawPointer);
31 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.
32 }
33
34 void BluetoothGATTCharacteristic::dispose(WebBluetoothGATTCharacteristic* webCha racteristic)
35 {
36 delete webCharacteristic;
37 }
38
39 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698