| 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 BluetoothDevice_h | 5 #ifndef BluetoothDevice_h |
| 6 #define BluetoothDevice_h | 6 #define BluetoothDevice_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/dom/ActiveDOMObject.h" | 9 #include "core/dom/ActiveDOMObject.h" |
| 10 #include "core/page/PageLifecycleObserver.h" | 10 #include "core/page/PageLifecycleObserver.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // CallbackPromiseAdapter templatized with this class. See this class's | 30 // CallbackPromiseAdapter templatized with this class. See this class's |
| 31 // "Interface required by CallbackPromiseAdapter" section and the | 31 // "Interface required by CallbackPromiseAdapter" section and the |
| 32 // CallbackPromiseAdapter class comments. | 32 // CallbackPromiseAdapter class comments. |
| 33 class BluetoothDevice final | 33 class BluetoothDevice final |
| 34 : public RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothDevice
> | 34 : public RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothDevice
> |
| 35 , public ActiveDOMObject | 35 , public ActiveDOMObject |
| 36 , public PageLifecycleObserver { | 36 , public PageLifecycleObserver { |
| 37 USING_PRE_FINALIZER(BluetoothDevice, dispose); | 37 USING_PRE_FINALIZER(BluetoothDevice, dispose); |
| 38 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
| 39 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothDevice); | 39 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothDevice); |
| 40 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothDevice); | 40 USING_GARBAGE_COLLECTED_MIXIN(BluetoothDevice); |
| 41 public: | 41 public: |
| 42 BluetoothDevice(ExecutionContext*, PassOwnPtr<WebBluetoothDevice>); | 42 BluetoothDevice(ExecutionContext*, PassOwnPtr<WebBluetoothDevice>); |
| 43 | 43 |
| 44 // Interface required by CallbackPromiseAdapter: | 44 // Interface required by CallbackPromiseAdapter: |
| 45 using WebType = OwnPtr<WebBluetoothDevice>; | 45 using WebType = OwnPtr<WebBluetoothDevice>; |
| 46 static BluetoothDevice* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetooth
Device>); | 46 static BluetoothDevice* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetooth
Device>); |
| 47 | 47 |
| 48 // We should disconnect from the device in all of the following cases: | 48 // We should disconnect from the device in all of the following cases: |
| 49 // 1. When the object gets GarbageCollected e.g. it went out of scope. | 49 // 1. When the object gets GarbageCollected e.g. it went out of scope. |
| 50 // dispose() is called in this case. | 50 // dispose() is called in this case. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 OwnPtr<WebBluetoothDevice> m_webDevice; | 102 OwnPtr<WebBluetoothDevice> m_webDevice; |
| 103 Member<BluetoothAdvertisingData> m_adData; | 103 Member<BluetoothAdvertisingData> m_adData; |
| 104 Member<BluetoothRemoteGATTServer> m_gatt; | 104 Member<BluetoothRemoteGATTServer> m_gatt; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| 108 | 108 |
| 109 #endif // BluetoothDevice_h | 109 #endif // BluetoothDevice_h |
| OLD | NEW |