| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/bluetooth/BluetoothRemoteGATTServer.h" | 5 #include "modules/bluetooth/BluetoothRemoteGATTServer.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| 11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
| 12 #include "core/events/Event.h" | 12 #include "core/events/Event.h" |
| 13 #include "modules/bluetooth/BluetoothError.h" | 13 #include "modules/bluetooth/BluetoothError.h" |
| 14 #include "modules/bluetooth/BluetoothRemoteGATTService.h" | 14 #include "modules/bluetooth/BluetoothRemoteGATTService.h" |
| 15 #include "modules/bluetooth/BluetoothSupplement.h" | 15 #include "modules/bluetooth/BluetoothSupplement.h" |
| 16 #include "modules/bluetooth/BluetoothUUID.h" | 16 #include "modules/bluetooth/BluetoothUUID.h" |
| 17 #include "public/platform/modules/bluetooth/WebBluetooth.h" | 17 #include "public/platform/modules/bluetooth/WebBluetooth.h" |
| 18 #include "wtf/OwnPtr.h" | |
| 19 | 18 |
| 20 namespace blink { | 19 namespace blink { |
| 21 | 20 |
| 22 BluetoothRemoteGATTServer::BluetoothRemoteGATTServer(BluetoothDevice* device) | 21 BluetoothRemoteGATTServer::BluetoothRemoteGATTServer(BluetoothDevice* device) |
| 23 : m_device(device) | 22 : m_device(device) |
| 24 , m_connected(false) | 23 , m_connected(false) |
| 25 { | 24 { |
| 26 } | 25 } |
| 27 | 26 |
| 28 BluetoothRemoteGATTServer* BluetoothRemoteGATTServer::create(BluetoothDevice* de
vice) | 27 BluetoothRemoteGATTServer* BluetoothRemoteGATTServer::create(BluetoothDevice* de
vice) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return exceptionState.reject(scriptState); | 90 return exceptionState.reject(scriptState); |
| 92 | 91 |
| 93 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 92 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 94 ScriptPromise promise = resolver->promise(); | 93 ScriptPromise promise = resolver->promise(); |
| 95 webbluetooth->getPrimaryService(device()->id(), serviceUUID, new CallbackPro
miseAdapter<BluetoothRemoteGATTService, BluetoothError>(resolver)); | 94 webbluetooth->getPrimaryService(device()->id(), serviceUUID, new CallbackPro
miseAdapter<BluetoothRemoteGATTService, BluetoothError>(resolver)); |
| 96 | 95 |
| 97 return promise; | 96 return promise; |
| 98 } | 97 } |
| 99 | 98 |
| 100 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |