| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 BluetoothRemoteGATTCharacteristic* getOrCreateRemoteGATTCharacteristic( | 55 BluetoothRemoteGATTCharacteristic* getOrCreateRemoteGATTCharacteristic( |
| 56 ExecutionContext*, | 56 ExecutionContext*, |
| 57 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, | 57 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, |
| 58 BluetoothRemoteGATTService*); | 58 BluetoothRemoteGATTService*); |
| 59 bool isValidCharacteristic(const String& characteristicInstanceId); | 59 bool isValidCharacteristic(const String& characteristicInstanceId); |
| 60 | 60 |
| 61 BluetoothRemoteGATTDescriptor* getOrCreateBluetoothRemoteGATTDescriptor( | 61 BluetoothRemoteGATTDescriptor* getOrCreateBluetoothRemoteGATTDescriptor( |
| 62 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr, | 62 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr, |
| 63 BluetoothRemoteGATTCharacteristic*); | 63 BluetoothRemoteGATTCharacteristic*); |
| 64 bool isValidDescriptor(const String& descriptorInstanceId); |
| 64 | 65 |
| 65 // We should disconnect from the device in all of the following cases: | 66 // We should disconnect from the device in all of the following cases: |
| 66 // 1. When the object gets GarbageCollected e.g. it went out of scope. | 67 // 1. When the object gets GarbageCollected e.g. it went out of scope. |
| 67 // dispose() is called in this case. | 68 // dispose() is called in this case. |
| 68 // 2. When the parent document gets detached e.g. reloading a page. | 69 // 2. When the parent document gets detached e.g. reloading a page. |
| 69 // stop() is called in this case. | 70 // stop() is called in this case. |
| 70 // TODO(ortuno): Users should be able to turn on notifications for | 71 // TODO(ortuno): Users should be able to turn on notifications for |
| 71 // events on navigator.bluetooth and still remain connected even if the | 72 // events on navigator.bluetooth and still remain connected even if the |
| 72 // BluetoothDevice object is garbage collected. | 73 // BluetoothDevice object is garbage collected. |
| 73 | 74 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 Member<BluetoothAttributeInstanceMap> m_attributeInstanceMap; | 112 Member<BluetoothAttributeInstanceMap> m_attributeInstanceMap; |
| 112 | 113 |
| 113 mojom::blink::WebBluetoothDevicePtr m_device; | 114 mojom::blink::WebBluetoothDevicePtr m_device; |
| 114 Member<BluetoothRemoteGATTServer> m_gatt; | 115 Member<BluetoothRemoteGATTServer> m_gatt; |
| 115 Member<Bluetooth> m_bluetooth; | 116 Member<Bluetooth> m_bluetooth; |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 } // namespace blink | 119 } // namespace blink |
| 119 | 120 |
| 120 #endif // BluetoothDevice_h | 121 #endif // BluetoothDevice_h |
| OLD | NEW |