| Index: content/browser/bluetooth/bluetooth_metrics.cc
|
| diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc
|
| index 32f7c73dfa7015e6fda33fb643be6be3c95b19bc..27994e4f56ff8e291949896cd1e79a419e4d79d6 100644
|
| --- a/content/browser/bluetooth/bluetooth_metrics.cc
|
| +++ b/content/browser/bluetooth/bluetooth_metrics.cc
|
| @@ -17,10 +17,18 @@
|
| using device::BluetoothUUID;
|
|
|
| namespace {
|
| -// TODO(ortuno): Remove once we have a macro to histogram strings.
|
| -// http://crbug.com/520284
|
| -int HashUUID(const std::string& uuid) {
|
| - uint32_t data = base::SuperFastHash(uuid.data(), uuid.size());
|
| +
|
| +// Generates a hash from a canonical UUID string suitable for
|
| +// UMA_HISTOGRAM_SPARSE_SLOWLY (positive int).
|
| +//
|
| +// Hash values can be produced manually using tool: bluetooth_metrics_hash.
|
| +int HashUUID(const std::string& canonical_uuid) {
|
| + DCHECK(canonical_uuid == BluetoothUUID(canonical_uuid).canonical_value());
|
| +
|
| + // TODO(520284): Other than verifying that uuid is canonical, this logic
|
| + // should be migrated to a dedicated histogram macro for hashed strings.
|
| + uint32_t data =
|
| + base::SuperFastHash(canonical_uuid.data(), canonical_uuid.size());
|
|
|
| // Strip off the signed bit because UMA doesn't support negative values,
|
| // but takes a signed int as input.
|
|
|