| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/BluetoothRemoteGATTServer.h" | 5 #include "modules/bluetooth/BluetoothRemoteGATTServer.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 28 matching lines...) Expand all Loading... |
| 39 ScriptPromiseResolver* resolver) { | 39 ScriptPromiseResolver* resolver) { |
| 40 auto result = m_activeAlgorithms.insert(resolver); | 40 auto result = m_activeAlgorithms.insert(resolver); |
| 41 CHECK(result.isNewEntry); | 41 CHECK(result.isNewEntry); |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool BluetoothRemoteGATTServer::RemoveFromActiveAlgorithms( | 44 bool BluetoothRemoteGATTServer::RemoveFromActiveAlgorithms( |
| 45 ScriptPromiseResolver* resolver) { | 45 ScriptPromiseResolver* resolver) { |
| 46 if (!m_activeAlgorithms.contains(resolver)) { | 46 if (!m_activeAlgorithms.contains(resolver)) { |
| 47 return false; | 47 return false; |
| 48 } | 48 } |
| 49 m_activeAlgorithms.remove(resolver); | 49 m_activeAlgorithms.erase(resolver); |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 DEFINE_TRACE(BluetoothRemoteGATTServer) { | 53 DEFINE_TRACE(BluetoothRemoteGATTServer) { |
| 54 visitor->trace(m_activeAlgorithms); | 54 visitor->trace(m_activeAlgorithms); |
| 55 visitor->trace(m_device); | 55 visitor->trace(m_device); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void BluetoothRemoteGATTServer::ConnectCallback( | 58 void BluetoothRemoteGATTServer::ConnectCallback( |
| 59 ScriptPromiseResolver* resolver, | 59 ScriptPromiseResolver* resolver, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service(); | 185 mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service(); |
| 186 service->RemoteServerGetPrimaryServices( | 186 service->RemoteServerGetPrimaryServices( |
| 187 device()->id(), quantity, servicesUUID, | 187 device()->id(), quantity, servicesUUID, |
| 188 convertToBaseCallback( | 188 convertToBaseCallback( |
| 189 WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback, | 189 WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback, |
| 190 wrapPersistent(this), quantity, wrapPersistent(resolver)))); | 190 wrapPersistent(this), quantity, wrapPersistent(resolver)))); |
| 191 return promise; | 191 return promise; |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |