OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Bluetooth_h | 5 #ifndef Bluetooth_h |
6 #define Bluetooth_h | 6 #define Bluetooth_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "modules/bluetooth/BluetoothDevice.h" | 10 #include "modules/bluetooth/BluetoothDevice.h" |
11 #include "mojo/public/cpp/bindings/associated_binding.h" | 11 #include "mojo/public/cpp/bindings/associated_binding.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" | 13 #include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" |
| 14 #include "platform/Supplementable.h" |
14 #include <memory> | 15 #include <memory> |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
18 class BluetoothRemoteGATTCharacteristic; | 19 class BluetoothRemoteGATTCharacteristic; |
19 class RequestDeviceOptions; | 20 class RequestDeviceOptions; |
20 class ScriptPromise; | 21 class ScriptPromise; |
21 class ScriptState; | 22 class ScriptState; |
22 | 23 |
23 class Bluetooth : public GarbageCollectedFinalized<Bluetooth>, | 24 class Bluetooth : public GarbageCollectedFinalized<Bluetooth>, |
24 public ScriptWrappable, | 25 public ScriptWrappable, |
25 public mojom::blink::WebBluetoothServiceClient { | 26 public mojom::blink::WebBluetoothServiceClient, |
| 27 public Supplementable<Bluetooth> { |
26 DEFINE_WRAPPERTYPEINFO(); | 28 DEFINE_WRAPPERTYPEINFO(); |
| 29 USING_GARBAGE_COLLECTED_MIXIN(Bluetooth); |
27 USING_PRE_FINALIZER(Bluetooth, dispose); | 30 USING_PRE_FINALIZER(Bluetooth, dispose); |
28 | 31 |
29 public: | 32 public: |
30 static Bluetooth* create() { return new Bluetooth(); } | 33 static Bluetooth* create() { return new Bluetooth(); } |
31 | 34 |
32 void dispose(); | 35 void dispose(); |
33 | 36 |
34 // BluetoothDiscovery interface | 37 // BluetoothDiscovery interface |
35 ScriptPromise requestDevice(ScriptState*, | 38 ScriptPromise requestDevice(ScriptState*, |
36 const RequestDeviceOptions&, | 39 const RequestDeviceOptions&, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 mojom::blink::WebBluetoothServicePtr m_service; | 90 mojom::blink::WebBluetoothServicePtr m_service; |
88 | 91 |
89 // Binding associated with |m_service|. | 92 // Binding associated with |m_service|. |
90 mojo::AssociatedBinding<mojom::blink::WebBluetoothServiceClient> | 93 mojo::AssociatedBinding<mojom::blink::WebBluetoothServiceClient> |
91 m_clientBinding; | 94 m_clientBinding; |
92 }; | 95 }; |
93 | 96 |
94 } // namespace blink | 97 } // namespace blink |
95 | 98 |
96 #endif // Bluetooth_h | 99 #endif // Bluetooth_h |
OLD | NEW |