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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 months 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 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 20 matching lines...) Expand all
31 BluetoothRemoteGATTServer::BluetoothRemoteGATTServer(BluetoothDevice* device) 31 BluetoothRemoteGATTServer::BluetoothRemoteGATTServer(BluetoothDevice* device)
32 : m_device(device), m_connected(false) {} 32 : m_device(device), m_connected(false) {}
33 33
34 BluetoothRemoteGATTServer* BluetoothRemoteGATTServer::create( 34 BluetoothRemoteGATTServer* BluetoothRemoteGATTServer::create(
35 BluetoothDevice* device) { 35 BluetoothDevice* device) {
36 return new BluetoothRemoteGATTServer(device); 36 return new BluetoothRemoteGATTServer(device);
37 } 37 }
38 38
39 void BluetoothRemoteGATTServer::AddToActiveAlgorithms( 39 void BluetoothRemoteGATTServer::AddToActiveAlgorithms(
40 ScriptPromiseResolver* resolver) { 40 ScriptPromiseResolver* resolver) {
41 auto result = m_activeAlgorithms.add(resolver); 41 auto result = m_activeAlgorithms.insert(resolver);
42 CHECK(result.isNewEntry); 42 CHECK(result.isNewEntry);
43 } 43 }
44 44
45 bool BluetoothRemoteGATTServer::RemoveFromActiveAlgorithms( 45 bool BluetoothRemoteGATTServer::RemoveFromActiveAlgorithms(
46 ScriptPromiseResolver* resolver) { 46 ScriptPromiseResolver* resolver) {
47 if (!m_activeAlgorithms.contains(resolver)) { 47 if (!m_activeAlgorithms.contains(resolver)) {
48 return false; 48 return false;
49 } 49 }
50 m_activeAlgorithms.remove(resolver); 50 m_activeAlgorithms.remove(resolver);
51 return true; 51 return true;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service(); 188 mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service();
189 service->RemoteServerGetPrimaryServices( 189 service->RemoteServerGetPrimaryServices(
190 device()->id(), quantity, servicesUUID, 190 device()->id(), quantity, servicesUUID,
191 convertToBaseCallback( 191 convertToBaseCallback(
192 WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback, 192 WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback,
193 wrapPersistent(this), quantity, wrapPersistent(resolver)))); 193 wrapPersistent(this), quantity, wrapPersistent(resolver))));
194 return promise; 194 return promise;
195 } 195 }
196 196
197 } // namespace blink 197 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698