| 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 BluetoothGATTRemoteServer_h | 5 #ifndef BluetoothGATTRemoteServer_h |
| 6 #define BluetoothGATTRemoteServer_h | 6 #define BluetoothGATTRemoteServer_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "platform/heap/Heap.h" | 9 #include "platform/heap/Heap.h" |
| 10 #include "public/platform/modules/bluetooth/WebBluetoothGATTRemoteServer.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 14 class ScriptPromiseResolver; |
| 15 |
| 13 // BluetoothGATTRemoteServer provides a way to interact with a connected bluetoo
th peripheral. | 16 // BluetoothGATTRemoteServer provides a way to interact with a connected bluetoo
th peripheral. |
| 17 // |
| 18 // Callbacks providing WebBluetoothGATTRemoteServer objects are handled by |
| 19 // CallbackPromiseAdapter templatized with this class. See this class's |
| 20 // "Interface required by CallbackPromiseAdapter" section and the |
| 21 // CallbackPromiseAdapter class comments. |
| 14 class BluetoothGATTRemoteServer final | 22 class BluetoothGATTRemoteServer final |
| 15 : public GarbageCollected<BluetoothGATTRemoteServer> | 23 : public GarbageCollectedFinalized<BluetoothGATTRemoteServer> |
| 16 , public ScriptWrappable { | 24 , public ScriptWrappable { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 25 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: | 26 public: |
| 27 BluetoothGATTRemoteServer(const WebBluetoothGATTRemoteServer&); |
| 28 |
| 29 // Interface required by CallbackPromiseAdapter: |
| 30 typedef WebBluetoothGATTRemoteServer WebType; |
| 31 static BluetoothGATTRemoteServer* take(ScriptPromiseResolver*, WebBluetoothG
ATTRemoteServer*); |
| 32 static void dispose(WebBluetoothGATTRemoteServer*); |
| 19 | 33 |
| 20 // Interface required by Garbage Collectoin: | 34 // Interface required by Garbage Collectoin: |
| 21 DEFINE_INLINE_TRACE() { } | 35 DEFINE_INLINE_TRACE() { } |
| 36 |
| 37 // IDL exposed interface: |
| 38 bool connected() { return m_webGATT.connected; } |
| 39 |
| 40 private: |
| 41 WebBluetoothGATTRemoteServer m_webGATT; |
| 22 }; | 42 }; |
| 23 | 43 |
| 24 } // namespace blink | 44 } // namespace blink |
| 25 | 45 |
| 26 #endif // BluetoothDevice_h | 46 #endif // BluetoothDevice_h |
| OLD | NEW |