New issue
Advanced search Search tips

Issue 674195 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Add UMA for the number of devices that were in the chooser when a device is paired

Project Member Reported by juncai@chromium.org, Dec 14 2016

Issue description

In the case of not accepting all devices, knowing the number of devices that were in the chooser is helpful for researching some methods to distinguish devices with the same name. UMA needs to be added for the number of devices that were in the chooser a device is paired.

 

Comment 1 by juncai@chromium.org, Dec 15 2016

Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a

commit 63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a
Author: juncai <juncai@chromium.org>
Date: Mon Dec 19 22:25:38 2016

Add UMA for the number of devices in the chooser when a device is paired

In the case of not accepting all devices in the options that are given
to WebBluetooth requestDevice(), knowing the number of devices that are
in the chooser is helpful for researching some methods to distinguish
devices with the same name. This CL adds UMA for the number of devices
that are in the chooser when a device is paired.

BUG= 674195 

Review-Url: https://codereview.chromium.org/2577183002
Cr-Commit-Position: refs/heads/master@{#439593}

[modify] https://crrev.com/63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h
[modify] https://crrev.com/63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a/content/browser/bluetooth/bluetooth_device_chooser_controller.cc
[modify] https://crrev.com/63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a/content/browser/bluetooth/bluetooth_device_chooser_controller.h
[modify] https://crrev.com/63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a/content/browser/bluetooth/bluetooth_metrics.cc
[modify] https://crrev.com/63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a/content/browser/bluetooth/bluetooth_metrics.h
[modify] https://crrev.com/63b736b52a58abd71e614cd0d2e69c9ecb2d7b3a/tools/metrics/histograms/histograms.xml

Comment 3 by juncai@chromium.org, Dec 19 2016

Status: Fixed (was: Started)
juncai I believe there's a small error in RecordNumOfDevices function. It should be:

 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) {
-  if (accept_all_devices) {
+  if (!accept_all_devices) {
     UMA_HISTOGRAM_SPARSE_SLOWLY(
         "Bluetooth.Web.RequestDevice."
         "NumOfDevicesInChooserWhenNotAcceptingAllDevices",
         std::min(num_of_devices, kMaxNumOfDevices));
   }
 }


WDYT?

Comment 5 by juncai@chromium.org, Dec 20 2016

Right! Thanks fbeaufort@! I'll make the change.
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4e0ae774e0a981ce792cf149179a216a2a54fbcd

commit 4e0ae774e0a981ce792cf149179a216a2a54fbcd
Author: juncai <juncai@chromium.org>
Date: Tue Dec 20 20:21:04 2016

Fix UMA for the number of devices in the chooser when a device is paired

This is a follow-up CL for
https://codereview.chromium.org/2577183002/
to fix an if statement at //content/browser/bluetooth/bluetooth_metrics.cc
It should be "if (!accept_all_devices)" instead of "if (accept_all_devices)"

TBR=scheib@chromium.org

BUG= 674195 

Review-Url: https://codereview.chromium.org/2590333002
Cr-Commit-Position: refs/heads/master@{#439876}

[modify] https://crrev.com/4e0ae774e0a981ce792cf149179a216a2a54fbcd/content/browser/bluetooth/bluetooth_metrics.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/41105d8a7831fff4df07939b32330445cce21a95

commit 41105d8a7831fff4df07939b32330445cce21a95
Author: juncai <juncai@chromium.org>
Date: Tue Dec 27 20:32:06 2016

Fix the logic of counting the number of devices for Web Bluetooth chooser UMA

This is a follow-up CL for
https://codereview.chromium.org/2577183002/

This CL fixes the logic of counting the number of devices. Previously, the
|device_ids_| is cleared in function StartDeviceDiscovery(), and since
StartDeviceDiscovery() is called after PopulateConnectedDevices(),
and PopulateConnectedDevices() may add cached devices. So those added devices
are removed from |device_ids_|. This CL fixes this by clearing the |device_ids_|
before the PopulateConnectedDevices() function is called.

TBR=scheib@chromium.org

BUG= 674195 

Review-Url: https://codereview.chromium.org/2601773003
Cr-Commit-Position: refs/heads/master@{#440781}

[modify] https://crrev.com/41105d8a7831fff4df07939b32330445cce21a95/content/browser/bluetooth/bluetooth_device_chooser_controller.cc

Sign in to add a comment