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

Unified Diff: content/renderer/bluetooth/web_bluetooth_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: addressed nits Created 4 years, 4 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 3ce2a4b0c463eb78f26d15ba2a2ec82c82be3244..ef89b10da5d1c74e3a1d9b01214f64eafb92cec1 100644
--- a/content/renderer/bluetooth/web_bluetooth_impl.cc
+++ b/content/renderer/bluetooth/web_bluetooth_impl.cc
@@ -189,7 +189,9 @@ void WebBluetoothImpl::OnRequestDeviceComplete(
callbacks->onSuccess(base::WrapUnique(new blink::WebBluetoothDeviceInit(
blink::WebString::fromUTF8(device->id),
- blink::WebString::fromUTF8(device->name), uuids)));
+ device->name.is_null() ? blink::WebString()
+ : blink::WebString::fromUTF8(device->name),
+ uuids)));
} else {
callbacks->onError(ToInt32(error));
}

Powered by Google App Engine
This is Rietveld 408576698