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

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

Issue 2510323002: bluetooth: Implement acceptAllDevices (Closed)
Patch Set: clean up Created 4 years 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 dcbc576f88bf9699c31fb8a18c1a3956cd68295f..7a0b4722f7dd4bb77a30d4ca8497935cb0690ba4 100644
--- a/content/browser/bluetooth/bluetooth_metrics.cc
+++ b/content/browser/bluetooth/bluetooth_metrics.cc
@@ -101,12 +101,14 @@ static void RecordUnionOfServices(
union_of_services.insert(service.canonical_value());
}
- for (const auto& filter : options->filters) {
- if (!filter->services) {
- continue;
- }
- for (const BluetoothUUID& service : filter->services.value()) {
- union_of_services.insert(service.canonical_value());
+ if (options->filters) {
+ for (const auto& filter : options->filters.value()) {
+ if (!filter->services) {
+ continue;
+ }
+ for (const BluetoothUUID& service : filter->services.value()) {
+ union_of_services.insert(service.canonical_value());
+ }
}
}
@@ -124,7 +126,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) {
+ RecordRequestDeviceFilters(options->filters.value());
+ }
+
RecordRequestDeviceOptionalServices(options->optional_services);
RecordUnionOfServices(options);
}

Powered by Google App Engine
This is Rietveld 408576698