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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp

Issue 2615093002: Typemap WebBluetoothDeviceId to WTF::String (Closed)
Patch Set: merge master Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp
index 14a973432faafa3ae15991e06b02c7775fc40b4c..5cfa298e48b5e5f382a606c40bd7c0516f9968fd 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp
@@ -17,16 +17,16 @@ BluetoothAttributeInstanceMap::BluetoothAttributeInstanceMap(
BluetoothRemoteGATTService*
BluetoothAttributeInstanceMap::getOrCreateRemoteGATTService(
- const String& serviceInstanceId,
- const String& uuid,
+ mojom::blink::WebBluetoothRemoteGATTServicePtr remoteGATTService,
bool isPrimary,
const String& deviceInstanceId) {
+ String serviceInstanceId = remoteGATTService->instance_id;
BluetoothRemoteGATTService* service =
m_serviceIdToObject.get(serviceInstanceId);
if (!service) {
- service = new BluetoothRemoteGATTService(serviceInstanceId, uuid, isPrimary,
- deviceInstanceId, m_device);
+ service = new BluetoothRemoteGATTService(
+ std::move(remoteGATTService), isPrimary, deviceInstanceId, m_device);
m_serviceIdToObject.add(serviceInstanceId, service);
}
@@ -41,19 +41,19 @@ bool BluetoothAttributeInstanceMap::containsService(
BluetoothRemoteGATTCharacteristic*
BluetoothAttributeInstanceMap::getOrCreateRemoteGATTCharacteristic(
ExecutionContext* context,
- const String& characteristicInstanceId,
const String& serviceInstanceId,
- const String& uuid,
- uint32_t characteristicProperties,
+ mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr
+ remoteGATTCharacteristic,
BluetoothRemoteGATTService* service) {
+ String instanceId = remoteGATTCharacteristic->instance_id;
BluetoothRemoteGATTCharacteristic* characteristic =
- m_characteristicIdToObject.get(characteristicInstanceId);
+ m_characteristicIdToObject.get(instanceId);
if (!characteristic) {
characteristic = BluetoothRemoteGATTCharacteristic::create(
- context, characteristicInstanceId, serviceInstanceId, uuid,
- characteristicProperties, service, m_device);
- m_characteristicIdToObject.add(characteristicInstanceId, characteristic);
+ context, serviceInstanceId, std::move(remoteGATTCharacteristic),
+ service, m_device);
+ m_characteristicIdToObject.add(instanceId, characteristic);
}
return characteristic;

Powered by Google App Engine
This is Rietveld 408576698