| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/BluetoothAttributeInstanceMap.h" | 5 #include "modules/bluetooth/BluetoothAttributeInstanceMap.h" |
| 6 | 6 |
| 7 #include "modules/bluetooth/BluetoothDevice.h" | 7 #include "modules/bluetooth/BluetoothDevice.h" |
| 8 #include "modules/bluetooth/BluetoothRemoteGATTService.h" | 8 #include "modules/bluetooth/BluetoothRemoteGATTService.h" |
| 9 #include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h" | 9 #include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h" |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 if (!service) { | 27 if (!service) { |
| 28 service = | 28 service = |
| 29 new BluetoothRemoteGATTService(std::move(webService), m_device.get()); | 29 new BluetoothRemoteGATTService(std::move(webService), m_device.get()); |
| 30 m_serviceIdToObject.add(serviceInstanceId, service); | 30 m_serviceIdToObject.add(serviceInstanceId, service); |
| 31 } | 31 } |
| 32 | 32 |
| 33 return service; | 33 return service; |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool BluetoothAttributeInstanceMap::containsService( |
| 37 const String& serviceInstanceId) { |
| 38 return m_serviceIdToObject.contains(serviceInstanceId); |
| 39 } |
| 40 |
| 41 void BluetoothAttributeInstanceMap::Clear() { |
| 42 m_serviceIdToObject.clear(); |
| 43 } |
| 44 |
| 36 DEFINE_TRACE(BluetoothAttributeInstanceMap) { | 45 DEFINE_TRACE(BluetoothAttributeInstanceMap) { |
| 37 visitor->trace(m_device); | 46 visitor->trace(m_device); |
| 38 visitor->trace(m_serviceIdToObject); | 47 visitor->trace(m_serviceIdToObject); |
| 39 } | 48 } |
| 40 | 49 |
| 41 } // namespace blink | 50 } // namespace blink |
| OLD | NEW |