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

Unified Diff: content/browser/bluetooth/web_bluetooth_service_impl.cc

Issue 2014473002: bluetooth: Web Bluetooth can filter by empty device names, doesn't leak MACs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-GetNameOrEmpty-
Patch Set: Correct null handling in renderer; Null and Empty Named fakes & tests. Created 4 years, 5 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/browser/bluetooth/web_bluetooth_service_impl.cc
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.cc b/content/browser/bluetooth/web_bluetooth_service_impl.cc
index 355e344b471a234ced30d2860c79d9a83d9e6dbb..6db050b1dc7ee06e028545942af3f29393c068ec 100644
--- a/content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -783,8 +783,8 @@ void WebBluetoothServiceImpl::OnGetDeviceSuccess(
blink::mojom::WebBluetoothDevicePtr device_ptr =
blink::mojom::WebBluetoothDevice::New();
device_ptr->id = device_id_for_origin;
- // TODO(615720): Use the upcoming GetName (was GetDeviceName).
- device_ptr->name = base::UTF16ToUTF8(device->GetNameForDisplay());
+ device_ptr->name = device->GetName() ? mojo::String(device->GetName().value())
+ : mojo::String(nullptr);
device_ptr->uuids = std::move(filtered_uuids);
RecordRequestDeviceOutcome(UMARequestDeviceOutcome::SUCCESS);

Powered by Google App Engine
This is Rietveld 408576698