| 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/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
| 10 #include "modules/EventTargetModules.h" | 10 #include "modules/EventTargetModules.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 BluetoothRemoteGATTService* getOrCreateBluetoothRemoteGATTService( | 51 BluetoothRemoteGATTService* getOrCreateBluetoothRemoteGATTService( |
| 52 std::unique_ptr<WebBluetoothRemoteGATTService>); | 52 std::unique_ptr<WebBluetoothRemoteGATTService>); |
| 53 bool isValidService(const String& serviceInstanceId); | 53 bool isValidService(const String& serviceInstanceId); |
| 54 | 54 |
| 55 BluetoothRemoteGATTCharacteristic* | 55 BluetoothRemoteGATTCharacteristic* |
| 56 getOrCreateBluetoothRemoteGATTCharacteristic( | 56 getOrCreateBluetoothRemoteGATTCharacteristic( |
| 57 ExecutionContext*, | 57 ExecutionContext*, |
| 58 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit>, | 58 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit>, |
| 59 BluetoothRemoteGATTService*); | 59 BluetoothRemoteGATTService*); |
| 60 bool isValidCharacteristic(const String& characteristicInstanceId); |
| 60 | 61 |
| 61 // We should disconnect from the device in all of the following cases: | 62 // We should disconnect from the device in all of the following cases: |
| 62 // 1. When the object gets GarbageCollected e.g. it went out of scope. | 63 // 1. When the object gets GarbageCollected e.g. it went out of scope. |
| 63 // dispose() is called in this case. | 64 // dispose() is called in this case. |
| 64 // 2. When the parent document gets detached e.g. reloading a page. | 65 // 2. When the parent document gets detached e.g. reloading a page. |
| 65 // stop() is called in this case. | 66 // stop() is called in this case. |
| 66 // TODO(ortuno): Users should be able to turn on notifications for | 67 // TODO(ortuno): Users should be able to turn on notifications for |
| 67 // events on navigator.bluetooth and still remain connected even if the | 68 // events on navigator.bluetooth and still remain connected even if the |
| 68 // BluetoothDevice object is garbage collected. | 69 // BluetoothDevice object is garbage collected. |
| 69 | 70 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // Holds all GATT Attributes associated with this BluetoothDevice. | 106 // Holds all GATT Attributes associated with this BluetoothDevice. |
| 106 Member<BluetoothAttributeInstanceMap> m_attributeInstanceMap; | 107 Member<BluetoothAttributeInstanceMap> m_attributeInstanceMap; |
| 107 | 108 |
| 108 std::unique_ptr<WebBluetoothDeviceInit> m_webDevice; | 109 std::unique_ptr<WebBluetoothDeviceInit> m_webDevice; |
| 109 Member<BluetoothRemoteGATTServer> m_gatt; | 110 Member<BluetoothRemoteGATTServer> m_gatt; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 } // namespace blink | 113 } // namespace blink |
| 113 | 114 |
| 114 #endif // BluetoothDevice_h | 115 #endif // BluetoothDevice_h |
| OLD | NEW |