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

Unified Diff: content/renderer/bluetooth/web_bluetooth_impl.cc

Issue 2015463004: bluetooth: Use BluetoothUUID instead of string when sending uuids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo-request-device
Patch Set: Add header Created 4 years, 7 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: content/renderer/bluetooth/web_bluetooth_impl.cc
diff --git a/content/renderer/bluetooth/web_bluetooth_impl.cc b/content/renderer/bluetooth/web_bluetooth_impl.cc
index f2f474ef94ba60ac82c2a0ef6f22282c2d91f33e..7e15546ce725bf9fc18472a1ce1fc73900aa2550 100644
--- a/content/renderer/bluetooth/web_bluetooth_impl.cc
+++ b/content/renderer/bluetooth/web_bluetooth_impl.cc
@@ -66,7 +66,8 @@ void WebBluetoothImpl::getPrimaryService(
const blink::WebString& service_uuid,
blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) {
GetWebBluetoothService().RemoteServerGetPrimaryService(
- mojo::String::From(device_id), mojo::String::From(service_uuid),
+ mojo::String::From(device_id),
+ base::WrapUnique(new device::BluetoothUUID(service_uuid.utf8())),
base::Bind(&WebBluetoothImpl::OnGetPrimaryServiceComplete,
base::Unretained(this), device_id,
base::Passed(base::WrapUnique(callbacks))));
@@ -79,8 +80,10 @@ void WebBluetoothImpl::getCharacteristics(
blink::WebBluetoothGetCharacteristicsCallbacks* callbacks) {
GetWebBluetoothService().RemoteServiceGetCharacteristics(
mojo::String::From(service_instance_id), quantity,
- characteristics_uuid.isEmpty() ? nullptr
- : mojo::String::From(characteristics_uuid),
+ characteristics_uuid.isEmpty()
+ ? nullptr
+ : base::WrapUnique(
+ new device::BluetoothUUID(characteristics_uuid.utf8())),
base::Bind(&WebBluetoothImpl::OnGetCharacteristicsComplete,
base::Unretained(this), service_instance_id,
base::Passed(base::WrapUnique(callbacks))));

Powered by Google App Engine
This is Rietveld 408576698