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

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: Fix merge conflict Created 4 years, 6 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
« no previous file with comments | « content/renderer/bluetooth/bluetooth_type_converters.cc ('k') | device/bluetooth/bluetooth.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9b981b9c0b06d4b1d20c08038296c23180748aba 100644
--- a/content/renderer/bluetooth/web_bluetooth_impl.cc
+++ b/content/renderer/bluetooth/web_bluetooth_impl.cc
@@ -9,6 +9,7 @@
#include <vector>
#include "base/memory/ptr_util.h"
+#include "base/optional.h"
#include "content/child/mojo/type_converters.h"
#include "content/child/thread_safe_sender.h"
#include "content/public/common/service_registry.h"
@@ -66,7 +67,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::make_optional(device::BluetoothUUID(service_uuid.utf8())),
base::Bind(&WebBluetoothImpl::OnGetPrimaryServiceComplete,
base::Unretained(this), device_id,
base::Passed(base::WrapUnique(callbacks))));
@@ -79,8 +81,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()
+ ? base::nullopt
+ : base::make_optional(
+ device::BluetoothUUID(characteristics_uuid.utf8())),
base::Bind(&WebBluetoothImpl::OnGetCharacteristicsComplete,
base::Unretained(this), service_instance_id,
base::Passed(base::WrapUnique(callbacks))));
« no previous file with comments | « content/renderer/bluetooth/bluetooth_type_converters.cc ('k') | device/bluetooth/bluetooth.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698