Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp

Issue 2478013002: bluetooth: Invalidate services upon disconnection (Closed)
Patch Set: Address scheib's comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698