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 #ifndef BluetoothRemoteGATTService_h | 5 #ifndef BluetoothRemoteGATTService_h |
6 #define BluetoothRemoteGATTService_h | 6 #define BluetoothRemoteGATTService_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "bindings/modules/v8/StringOrUnsignedLong.h" | 9 #include "bindings/modules/v8/StringOrUnsignedLong.h" |
10 #include "modules/bluetooth/BluetoothDevice.h" | 10 #include "modules/bluetooth/BluetoothDevice.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 #include "platform/heap/Heap.h" | 12 #include "platform/heap/Heap.h" |
13 #include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h" | 13 #include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h" |
14 #include "public/platform/modules/bluetooth/web_bluetooth.mojom.h" | 14 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" |
15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
16 #include <memory> | 16 #include <memory> |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class ScriptPromise; | 20 class ScriptPromise; |
21 class ScriptPromiseResolver; | 21 class ScriptPromiseResolver; |
22 class ScriptState; | 22 class ScriptState; |
23 | 23 |
24 // Represents a GATT Service within a Bluetooth Peripheral, a collection of | 24 // Represents a GATT Service within a Bluetooth Peripheral, a collection of |
(...skipping 20 matching lines...) Expand all Loading... |
45 | 45 |
46 // IDL exposed interface: | 46 // IDL exposed interface: |
47 String uuid() { return m_webService->uuid; } | 47 String uuid() { return m_webService->uuid; } |
48 bool isPrimary() { return m_webService->isPrimary; } | 48 bool isPrimary() { return m_webService->isPrimary; } |
49 BluetoothDevice* device() { return m_device; } | 49 BluetoothDevice* device() { return m_device; } |
50 ScriptPromise getCharacteristic(ScriptState*, const StringOrUnsignedLong& ch
aracteristic, ExceptionState&); | 50 ScriptPromise getCharacteristic(ScriptState*, const StringOrUnsignedLong& ch
aracteristic, ExceptionState&); |
51 ScriptPromise getCharacteristics(ScriptState*, const StringOrUnsignedLong& c
haracteristic, ExceptionState&); | 51 ScriptPromise getCharacteristics(ScriptState*, const StringOrUnsignedLong& c
haracteristic, ExceptionState&); |
52 ScriptPromise getCharacteristics(ScriptState*, ExceptionState&); | 52 ScriptPromise getCharacteristics(ScriptState*, ExceptionState&); |
53 | 53 |
54 private: | 54 private: |
55 ScriptPromise getCharacteristicsImpl(ScriptState*, mojom::WebBluetoothGATTQu
eryQuantity, String characteristicUUID = String()); | 55 ScriptPromise getCharacteristicsImpl(ScriptState*, mojom::blink::WebBluetoot
hGATTQueryQuantity, String characteristicUUID = String()); |
56 | 56 |
57 std::unique_ptr<WebBluetoothRemoteGATTService> m_webService; | 57 std::unique_ptr<WebBluetoothRemoteGATTService> m_webService; |
58 Member<BluetoothDevice> m_device; | 58 Member<BluetoothDevice> m_device; |
59 }; | 59 }; |
60 | 60 |
61 } // namespace blink | 61 } // namespace blink |
62 | 62 |
63 #endif // BluetoothRemoteGATTService_h | 63 #endif // BluetoothRemoteGATTService_h |
OLD | NEW |