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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 Bluetooth*); | 46 Bluetooth*); |
47 | 47 |
48 BluetoothRemoteGATTService* getOrCreateRemoteGATTService( | 48 BluetoothRemoteGATTService* getOrCreateRemoteGATTService( |
49 mojom::blink::WebBluetoothRemoteGATTServicePtr, | 49 mojom::blink::WebBluetoothRemoteGATTServicePtr, |
50 bool isPrimary, | 50 bool isPrimary, |
51 const String& deviceInstanceId); | 51 const String& deviceInstanceId); |
52 bool isValidService(const String& serviceInstanceId); | 52 bool isValidService(const String& serviceInstanceId); |
53 | 53 |
54 BluetoothRemoteGATTCharacteristic* getOrCreateRemoteGATTCharacteristic( | 54 BluetoothRemoteGATTCharacteristic* getOrCreateRemoteGATTCharacteristic( |
55 ExecutionContext*, | 55 ExecutionContext*, |
56 const String& serviceInstanceId, | |
57 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, | 56 mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr, |
58 BluetoothRemoteGATTService*); | 57 BluetoothRemoteGATTService*); |
59 bool isValidCharacteristic(const String& characteristicInstanceId); | 58 bool isValidCharacteristic(const String& characteristicInstanceId); |
60 | 59 |
61 // We should disconnect from the device in all of the following cases: | 60 // 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. | 61 // 1. When the object gets GarbageCollected e.g. it went out of scope. |
63 // dispose() is called in this case. | 62 // dispose() is called in this case. |
64 // 2. When the parent document gets detached e.g. reloading a page. | 63 // 2. When the parent document gets detached e.g. reloading a page. |
65 // stop() is called in this case. | 64 // stop() is called in this case. |
66 // TODO(ortuno): Users should be able to turn on notifications for | 65 // TODO(ortuno): Users should be able to turn on notifications for |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 Member<BluetoothAttributeInstanceMap> m_attributeInstanceMap; | 106 Member<BluetoothAttributeInstanceMap> m_attributeInstanceMap; |
108 | 107 |
109 mojom::blink::WebBluetoothDevicePtr m_device; | 108 mojom::blink::WebBluetoothDevicePtr m_device; |
110 Member<BluetoothRemoteGATTServer> m_gatt; | 109 Member<BluetoothRemoteGATTServer> m_gatt; |
111 Member<Bluetooth> m_bluetooth; | 110 Member<Bluetooth> m_bluetooth; |
112 }; | 111 }; |
113 | 112 |
114 } // namespace blink | 113 } // namespace blink |
115 | 114 |
116 #endif // BluetoothDevice_h | 115 #endif // BluetoothDevice_h |
OLD | NEW |