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

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

Issue 2510323002: bluetooth: Implement acceptAllDevices (Closed)
Patch Set: Clean up Created 4 years, 1 month 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/bluetooth_metrics.cc
diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc
index c9e540517d0e3603a7503fb9a15ddd536b554390..321465524fa20567ef75d856dd271639fc94470f 100644
--- a/content/browser/bluetooth/bluetooth_metrics.cc
+++ b/content/browser/bluetooth/bluetooth_metrics.cc
@@ -99,9 +99,11 @@ static void RecordUnionOfServices(
union_of_services.insert(service->canonical_value());
}
- for (const auto& filter : options->filters) {
- for (const base::Optional<BluetoothUUID>& service : filter->services) {
- union_of_services.insert(service->canonical_value());
+ if (!options->filters.is_null()) {
+ for (const auto& filter : options->filters) {
+ for (const base::Optional<BluetoothUUID>& service : filter->services) {
+ union_of_services.insert(service->canonical_value());
+ }
}
}
@@ -119,7 +121,13 @@ static void RecordUnionOfServices(
void RecordRequestDeviceOptions(
const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options) {
- RecordRequestDeviceFilters(options->filters);
+ UMA_HISTOGRAM_BOOLEAN("Bluetooth.Web.RequestDevice.Options.AcceptAllDevices",
+ options->accept_all_devices);
+
+ if (!options->filters.is_null()) {
+ RecordRequestDeviceFilters(options->filters);
+ }
+
RecordRequestDeviceOptionalServices(options->optional_services);
RecordUnionOfServices(options);
}

Powered by Google App Engine
This is Rietveld 408576698