| 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 #include "modules/bluetooth/BluetoothDevice.h" | 5 #include "modules/bluetooth/BluetoothDevice.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 return m_attributeInstanceMap->getOrCreateRemoteGATTCharacteristic( | 56 return m_attributeInstanceMap->getOrCreateRemoteGATTCharacteristic( |
| 57 context, std::move(characteristic), service); | 57 context, std::move(characteristic), service); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool BluetoothDevice::isValidCharacteristic( | 60 bool BluetoothDevice::isValidCharacteristic( |
| 61 const String& characteristicInstanceId) { | 61 const String& characteristicInstanceId) { |
| 62 return m_attributeInstanceMap->containsCharacteristic( | 62 return m_attributeInstanceMap->containsCharacteristic( |
| 63 characteristicInstanceId); | 63 characteristicInstanceId); |
| 64 } | 64 } |
| 65 | 65 |
| 66 BluetoothRemoteGATTDescriptor* |
| 67 BluetoothDevice::getOrCreateBluetoothRemoteGATTDescriptor( |
| 68 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr descriptor, |
| 69 BluetoothRemoteGATTCharacteristic* characteristic) { |
| 70 return m_attributeInstanceMap->getOrCreateBluetoothRemoteGATTDescriptor( |
| 71 std::move(descriptor), characteristic); |
| 72 } |
| 73 |
| 66 void BluetoothDevice::dispose() { | 74 void BluetoothDevice::dispose() { |
| 67 disconnectGATTIfConnected(); | 75 disconnectGATTIfConnected(); |
| 68 } | 76 } |
| 69 | 77 |
| 70 void BluetoothDevice::contextDestroyed() { | 78 void BluetoothDevice::contextDestroyed() { |
| 71 disconnectGATTIfConnected(); | 79 disconnectGATTIfConnected(); |
| 72 } | 80 } |
| 73 | 81 |
| 74 void BluetoothDevice::disconnectGATTIfConnected() { | 82 void BluetoothDevice::disconnectGATTIfConnected() { |
| 75 if (m_gatt->connected()) { | 83 if (m_gatt->connected()) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 106 | 114 |
| 107 DEFINE_TRACE(BluetoothDevice) { | 115 DEFINE_TRACE(BluetoothDevice) { |
| 108 visitor->trace(m_attributeInstanceMap); | 116 visitor->trace(m_attributeInstanceMap); |
| 109 visitor->trace(m_gatt); | 117 visitor->trace(m_gatt); |
| 110 visitor->trace(m_bluetooth); | 118 visitor->trace(m_bluetooth); |
| 111 EventTargetWithInlineData::trace(visitor); | 119 EventTargetWithInlineData::trace(visitor); |
| 112 ContextLifecycleObserver::trace(visitor); | 120 ContextLifecycleObserver::trace(visitor); |
| 113 } | 121 } |
| 114 | 122 |
| 115 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |