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

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

Issue 2716263002: DO NOT SUBMIT. Renderer side of Bluetooth Test API in blink C++ (Closed)
Patch Set: Created 3 years, 9 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/Bluetooth.h" 5 #include "modules/bluetooth/Bluetooth.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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 void Bluetooth::characteristicObjectRemoved( 247 void Bluetooth::characteristicObjectRemoved(
248 const String& characteristicInstanceId) { 248 const String& characteristicInstanceId) {
249 m_activeCharacteristics.remove(characteristicInstanceId); 249 m_activeCharacteristics.remove(characteristicInstanceId);
250 } 250 }
251 251
252 DEFINE_TRACE(Bluetooth) { 252 DEFINE_TRACE(Bluetooth) {
253 visitor->trace(m_deviceInstanceMap); 253 visitor->trace(m_deviceInstanceMap);
254 visitor->trace(m_activeCharacteristics); 254 visitor->trace(m_activeCharacteristics);
255 visitor->trace(m_connectedDevices); 255 visitor->trace(m_connectedDevices);
256 Supplementable<Bluetooth>::trace(visitor);
256 } 257 }
257 258
258 Bluetooth::Bluetooth() : m_clientBinding(this) {} 259 Bluetooth::Bluetooth() : m_clientBinding(this) {}
259 260
260 void Bluetooth::RemoteCharacteristicValueChanged( 261 void Bluetooth::RemoteCharacteristicValueChanged(
261 const WTF::String& characteristicInstanceId, 262 const WTF::String& characteristicInstanceId,
262 const WTF::Vector<uint8_t>& value) { 263 const WTF::Vector<uint8_t>& value) {
263 BluetoothRemoteGATTCharacteristic* characteristic = 264 BluetoothRemoteGATTCharacteristic* characteristic =
264 m_activeCharacteristics.get(characteristicInstanceId); 265 m_activeCharacteristics.get(characteristicInstanceId);
265 if (characteristic) 266 if (characteristic)
(...skipping 18 matching lines...) Expand all
284 BluetoothDevice* device = m_deviceInstanceMap.get(id); 285 BluetoothDevice* device = m_deviceInstanceMap.get(id);
285 if (!device) { 286 if (!device) {
286 device = BluetoothDevice::take(resolver, std::move(devicePtr), this); 287 device = BluetoothDevice::take(resolver, std::move(devicePtr), this);
287 auto result = m_deviceInstanceMap.insert(id, device); 288 auto result = m_deviceInstanceMap.insert(id, device);
288 DCHECK(result.isNewEntry); 289 DCHECK(result.isNewEntry);
289 } 290 }
290 return device; 291 return device;
291 } 292 }
292 293
293 } // namespace blink 294 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698