Chromium Code Reviews| 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> |
|
scheib
2015/04/21 17:57:29
I don't think we need this object to be Finalized,
ortuno
2015/04/21 19:54:07
WebBluetoothGATTRemoteServer needs to be finalized
| |
| 16 , public ScriptWrappable { | 24 , public ScriptWrappable { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 25 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: | 26 public: |
| 27 BluetoothGATTRemoteServer(const WebBluetoothGATTRemoteServer&); | |
| 28 | |
| 29 static BluetoothGATTRemoteServer* create(const WebBluetoothGATTRemoteServer& ); | |
| 30 | |
| 31 // Interface required by CallbackPromiseAdapter: | |
| 32 typedef WebBluetoothGATTRemoteServer WebType; | |
| 33 static BluetoothGATTRemoteServer* take(ScriptPromiseResolver*, WebBluetoothG ATTRemoteServer*); | |
| 34 static void dispose(WebBluetoothGATTRemoteServer*); | |
| 19 | 35 |
| 20 // Interface required by Garbage Collectoin: | 36 // Interface required by Garbage Collectoin: |
| 21 DEFINE_INLINE_TRACE() { } | 37 DEFINE_INLINE_TRACE() { } |
| 38 | |
| 39 // IDL exposed interface: | |
| 40 bool connected() { return m_webGATT.connected; } | |
| 41 | |
| 42 private: | |
| 43 WebBluetoothGATTRemoteServer m_webGATT; | |
| 22 }; | 44 }; |
| 23 | 45 |
| 24 } // namespace blink | 46 } // namespace blink |
| 25 | 47 |
| 26 #endif // BluetoothDevice_h | 48 #endif // BluetoothDevice_h |
| OLD | NEW |