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

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: Merge 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..84a387fd6e714cbec096aba357acfe89e298789a 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());
+ if (device->GetName())
+ device_ptr->name = device->GetName().value();
ortuno 2016/07/21 17:42:29 optional nit to save one line: device_ptr->name =
scheib 2016/07/30 02:38:14 Changed to always assign -- to make the assignment
ortuno 2016/07/31 18:00:05 I'm surprised it requires type casting since the c
device_ptr->uuids = std::move(filtered_uuids);
RecordRequestDeviceOutcome(UMARequestDeviceOutcome::SUCCESS);

Powered by Google App Engine
This is Rietveld 408576698