Commit a9358c70 authored by Raymond Toy's avatar Raymond Toy Committed by Commit Bot

Remove expired Web Bluetooth histograms

All the histograms with expiry date of M85 are removed, along with the
corresponding code.

Bug: 1088659
Change-Id: I49af6e8a30ae2ed688a36d34d74eb8c817c4e78d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519726Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825430}
parent 9e6d0cfa
...@@ -18,11 +18,6 @@ namespace { ...@@ -18,11 +18,6 @@ namespace {
static base::LazyInstance<content::BluetoothBlocklist>::Leaky g_singleton = static base::LazyInstance<content::BluetoothBlocklist>::Leaky g_singleton =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
void RecordUMAParsedNonEmptyString(bool success) {
UMA_HISTOGRAM_BOOLEAN("Bluetooth.Web.Blocklist.ParsedNonEmptyString",
success);
}
} // namespace } // namespace
namespace content { namespace content {
...@@ -75,7 +70,6 @@ void BluetoothBlocklist::Add(base::StringPiece blocklist_string) { ...@@ -75,7 +70,6 @@ void BluetoothBlocklist::Add(base::StringPiece blocklist_string) {
} }
invalid_values = true; invalid_values = true;
} }
RecordUMAParsedNonEmptyString(parsed_values && !invalid_values);
} }
bool BluetoothBlocklist::IsExcluded(const BluetoothUUID& uuid) const { bool BluetoothBlocklist::IsExcluded(const BluetoothUUID& uuid) const {
......
...@@ -198,49 +198,6 @@ void RecordGetPrimaryServicesServices( ...@@ -198,49 +198,6 @@ void RecordGetPrimaryServicesServices(
} }
} }
// getCharacteristic & getCharacteristics
void RecordGetCharacteristicsOutcome(
blink::mojom::WebBluetoothGATTQueryQuantity quantity,
UMAGetCharacteristicOutcome outcome) {
switch (quantity) {
case blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE:
UMA_HISTOGRAM_ENUMERATION(
"Bluetooth.Web.GetCharacteristic.Outcome", static_cast<int>(outcome),
static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
return;
case blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE:
UMA_HISTOGRAM_ENUMERATION(
"Bluetooth.Web.GetCharacteristics.Outcome", static_cast<int>(outcome),
static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
return;
}
}
void RecordGetCharacteristicsOutcome(
blink::mojom::WebBluetoothGATTQueryQuantity quantity,
CacheQueryOutcome outcome) {
switch (outcome) {
case CacheQueryOutcome::SUCCESS:
case CacheQueryOutcome::BAD_RENDERER:
// No need to record a success or renderer crash.
NOTREACHED();
return;
case CacheQueryOutcome::NO_DEVICE:
RecordGetCharacteristicsOutcome(quantity,
UMAGetCharacteristicOutcome::NO_DEVICE);
return;
case CacheQueryOutcome::NO_SERVICE:
RecordGetCharacteristicsOutcome(quantity,
UMAGetCharacteristicOutcome::NO_SERVICE);
return;
case CacheQueryOutcome::NO_CHARACTERISTIC:
case CacheQueryOutcome::NO_DESCRIPTOR:
NOTREACHED();
return;
}
}
void RecordGetCharacteristicsCharacteristic( void RecordGetCharacteristicsCharacteristic(
blink::mojom::WebBluetoothGATTQueryQuantity quantity, blink::mojom::WebBluetoothGATTQueryQuantity quantity,
const base::Optional<BluetoothUUID>& characteristic) { const base::Optional<BluetoothUUID>& characteristic) {
...@@ -257,64 +214,6 @@ void RecordGetCharacteristicsCharacteristic( ...@@ -257,64 +214,6 @@ void RecordGetCharacteristicsCharacteristic(
} }
} }
void RecordGetDescriptorsDescriptor(
blink::mojom::WebBluetoothGATTQueryQuantity quantity,
const base::Optional<BluetoothUUID>& descriptor) {
switch (quantity) {
case blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE:
base::UmaHistogramSparse("Bluetooth.Web.GetDescriptor.Descriptor",
HashUUID(descriptor));
return;
case blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE:
base::UmaHistogramSparse("Bluetooth.Web.GetDescriptors.Descriptor",
HashUUID(descriptor));
return;
}
}
void RecordGetDescriptorsOutcome(
blink::mojom::WebBluetoothGATTQueryQuantity quantity,
UMAGetDescriptorOutcome outcome) {
switch (quantity) {
case blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE:
UMA_HISTOGRAM_ENUMERATION(
"Bluetooth.Web.GetDescriptor.Outcome", static_cast<int>(outcome),
static_cast<int>(UMAGetDescriptorOutcome::COUNT));
return;
case blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE:
UMA_HISTOGRAM_ENUMERATION(
"Bluetooth.Web.GetDescriptors.Outcome", static_cast<int>(outcome),
static_cast<int>(UMAGetDescriptorOutcome::COUNT));
return;
}
}
void RecordGetDescriptorsOutcome(
blink::mojom::WebBluetoothGATTQueryQuantity quantity,
CacheQueryOutcome outcome) {
switch (outcome) {
case CacheQueryOutcome::SUCCESS:
case CacheQueryOutcome::BAD_RENDERER:
// No need to record a success or renderer crash.
NOTREACHED();
return;
case CacheQueryOutcome::NO_DEVICE:
RecordGetDescriptorsOutcome(quantity, UMAGetDescriptorOutcome::NO_DEVICE);
return;
case CacheQueryOutcome::NO_SERVICE:
RecordGetDescriptorsOutcome(quantity,
UMAGetDescriptorOutcome::NO_SERVICE);
return;
case CacheQueryOutcome::NO_CHARACTERISTIC:
RecordGetDescriptorsOutcome(quantity,
UMAGetDescriptorOutcome::NO_CHARACTERISTIC);
return;
case CacheQueryOutcome::NO_DESCRIPTOR:
NOTREACHED();
return;
}
}
// GATT Operations // GATT Operations
void RecordGATTOperationOutcome(UMAGATTOperation operation, void RecordGATTOperationOutcome(UMAGATTOperation operation,
...@@ -330,10 +229,7 @@ void RecordGATTOperationOutcome(UMAGATTOperation operation, ...@@ -330,10 +229,7 @@ void RecordGATTOperationOutcome(UMAGATTOperation operation,
RecordStartNotificationsOutcome(outcome); RecordStartNotificationsOutcome(outcome);
return; return;
case UMAGATTOperation::DESCRIPTOR_READ: case UMAGATTOperation::DESCRIPTOR_READ:
RecordDescriptorReadValueOutcome(outcome);
return;
case UMAGATTOperation::DESCRIPTOR_WRITE: case UMAGATTOperation::DESCRIPTOR_WRITE:
RecordDescriptorWriteValueOutcome(outcome);
return; return;
case UMAGATTOperation::COUNT: case UMAGATTOperation::COUNT:
NOTREACHED(); NOTREACHED();
...@@ -407,32 +303,6 @@ void RecordRSSISignalStrength(int rssi) { ...@@ -407,32 +303,6 @@ void RecordRSSISignalStrength(int rssi) {
rssi); rssi);
} }
// Descriptor.readValue
void RecordDescriptorReadValueOutcome(UMAGATTOperationOutcome outcome) {
UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Descriptor.ReadValue.Outcome",
static_cast<int>(outcome),
static_cast<int>(UMAGATTOperationOutcome::COUNT));
}
void RecordDescriptorReadValueOutcome(CacheQueryOutcome outcome) {
RecordDescriptorReadValueOutcome(
TranslateCacheQueryOutcomeToGATTOperationOutcome(outcome));
}
// Descriptor.writeValue
void RecordDescriptorWriteValueOutcome(UMAGATTOperationOutcome outcome) {
UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Descriptor.WriteValue.Outcome",
static_cast<int>(outcome),
static_cast<int>(UMAGATTOperationOutcome::COUNT));
}
void RecordDescriptorWriteValueOutcome(CacheQueryOutcome outcome) {
RecordDescriptorWriteValueOutcome(
TranslateCacheQueryOutcomeToGATTOperationOutcome(outcome));
}
void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level) { void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level) {
UMA_HISTOGRAM_ENUMERATION( UMA_HISTOGRAM_ENUMERATION(
"Bluetooth.Web.RequestDevice.RSSISignalStrengthLevel", "Bluetooth.Web.RequestDevice.RSSISignalStrengthLevel",
......
...@@ -195,27 +195,12 @@ void RecordGetCharacteristicsCharacteristic( ...@@ -195,27 +195,12 @@ void RecordGetCharacteristicsCharacteristic(
blink::mojom::WebBluetoothGATTQueryQuantity quantity, blink::mojom::WebBluetoothGATTQueryQuantity quantity,
const base::Optional<device::BluetoothUUID>& characteristic); const base::Optional<device::BluetoothUUID>& characteristic);
// There should be a call to this function whenever
// RemoteServiceGetDescriptorsCallback is run.
// Pass blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE for
// getDescriptor.
// Pass blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE for
// getDescriptors.
void RecordGetDescriptorsOutcome(
blink::mojom::WebBluetoothGATTQueryQuantity quantity,
UMAGetDescriptorOutcome outcome);
// Records the outcome of the cache query for getDescriptors. Should only be // Records the outcome of the cache query for getDescriptors. Should only be
// called if QueryCacheForService fails. // called if QueryCacheForService fails.
void RecordGetDescriptorsOutcome( void RecordGetDescriptorsOutcome(
blink::mojom::WebBluetoothGATTQueryQuantity quantity, blink::mojom::WebBluetoothGATTQueryQuantity quantity,
CacheQueryOutcome outcome); CacheQueryOutcome outcome);
// Records the UUID of the descriptor used when calling getDescriptor.
void RecordGetDescriptorsDescriptor(
blink::mojom::WebBluetoothGATTQueryQuantity quantity,
const base::Optional<device::BluetoothUUID>& descriptor);
// GATT Operations Metrics // GATT Operations Metrics
// These are the possible outcomes when performing GATT operations i.e. // These are the possible outcomes when performing GATT operations i.e.
...@@ -287,26 +272,6 @@ void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); ...@@ -287,26 +272,6 @@ void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome);
// called if QueryCacheForCharacteristic fails. // called if QueryCacheForCharacteristic fails.
void RecordStartNotificationsOutcome(CacheQueryOutcome outcome); void RecordStartNotificationsOutcome(CacheQueryOutcome outcome);
// Descriptor.readValue() Metrics
// There should be a call to this function for every call to
// Send(BluetoothMsg_ReadDescriptorValueSuccess) and
// Send(BluetoothMsg_ReadDescriptorValueError).
void RecordDescriptorReadValueOutcome(UMAGATTOperationOutcome error);
// Records the outcome of a cache query for readValue. Should only be called if
// QueryCacheForDescriptor fails.
void RecordDescriptorReadValueOutcome(CacheQueryOutcome outcome);
// Descriptor.writeValue() Metrics
// There should be a call to this function for every call to
// Send(BluetoothMsg_ReadDescriptorValueSuccess) and
// Send(BluetoothMsg_ReadDescriptorValueError).
void RecordDescriptorWriteValueOutcome(UMAGATTOperationOutcome error);
// Records the outcome of a cache query for writeValue. Should only be called if
// QueryCacheForDescriptor fails.
void RecordDescriptorWriteValueOutcome(CacheQueryOutcome outcome);
enum class UMARSSISignalStrengthLevel { enum class UMARSSISignalStrengthLevel {
LESS_THAN_OR_EQUAL_TO_MIN_RSSI, LESS_THAN_OR_EQUAL_TO_MIN_RSSI,
LEVEL_0, LEVEL_0,
......
...@@ -957,8 +957,6 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics( ...@@ -957,8 +957,6 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics(
if (characteristics_uuid && if (characteristics_uuid &&
BluetoothBlocklist::Get().IsExcluded(characteristics_uuid.value())) { BluetoothBlocklist::Get().IsExcluded(characteristics_uuid.value())) {
RecordGetCharacteristicsOutcome(quantity,
UMAGetCharacteristicOutcome::BLOCKLISTED);
std::move(callback).Run( std::move(callback).Run(
blink::mojom::WebBluetoothResult::BLOCKLISTED_CHARACTERISTIC_UUID, blink::mojom::WebBluetoothResult::BLOCKLISTED_CHARACTERISTIC_UUID,
base::nullopt /* characteristics */); base::nullopt /* characteristics */);
...@@ -973,7 +971,6 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics( ...@@ -973,7 +971,6 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics(
} }
if (query_result.outcome != CacheQueryOutcome::SUCCESS) { if (query_result.outcome != CacheQueryOutcome::SUCCESS) {
RecordGetCharacteristicsOutcome(quantity, query_result.outcome);
std::move(callback).Run(query_result.GetWebResult(), std::move(callback).Run(query_result.GetWebResult(),
base::nullopt /* characteristics */); base::nullopt /* characteristics */);
return; return;
...@@ -1012,17 +1009,11 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics( ...@@ -1012,17 +1009,11 @@ void WebBluetoothServiceImpl::RemoteServiceGetCharacteristics(
} }
if (!response_characteristics.empty()) { if (!response_characteristics.empty()) {
RecordGetCharacteristicsOutcome(quantity,
UMAGetCharacteristicOutcome::SUCCESS);
std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS, std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS,
std::move(response_characteristics)); std::move(response_characteristics));
return; return;
} }
RecordGetCharacteristicsOutcome(
quantity, characteristics_uuid
? UMAGetCharacteristicOutcome::NOT_FOUND
: UMAGetCharacteristicOutcome::NO_CHARACTERISTICS);
std::move(callback).Run( std::move(callback).Run(
characteristics_uuid characteristics_uuid
? blink::mojom::WebBluetoothResult::CHARACTERISTIC_NOT_FOUND ? blink::mojom::WebBluetoothResult::CHARACTERISTIC_NOT_FOUND
...@@ -1037,11 +1028,8 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors( ...@@ -1037,11 +1028,8 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors(
RemoteCharacteristicGetDescriptorsCallback callback) { RemoteCharacteristicGetDescriptorsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
RecordGetDescriptorsDescriptor(quantity, descriptors_uuid);
if (descriptors_uuid && if (descriptors_uuid &&
BluetoothBlocklist::Get().IsExcluded(descriptors_uuid.value())) { BluetoothBlocklist::Get().IsExcluded(descriptors_uuid.value())) {
RecordGetDescriptorsOutcome(quantity, UMAGetDescriptorOutcome::BLOCKLISTED);
std::move(callback).Run( std::move(callback).Run(
blink::mojom::WebBluetoothResult::BLOCKLISTED_DESCRIPTOR_UUID, blink::mojom::WebBluetoothResult::BLOCKLISTED_DESCRIPTOR_UUID,
base::nullopt /* descriptor */); base::nullopt /* descriptor */);
...@@ -1056,7 +1044,6 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors( ...@@ -1056,7 +1044,6 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors(
} }
if (query_result.outcome != CacheQueryOutcome::SUCCESS) { if (query_result.outcome != CacheQueryOutcome::SUCCESS) {
RecordGetDescriptorsOutcome(quantity, query_result.outcome);
std::move(callback).Run(query_result.GetWebResult(), std::move(callback).Run(query_result.GetWebResult(),
base::nullopt /* descriptor */); base::nullopt /* descriptor */);
return; return;
...@@ -1091,14 +1078,10 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors( ...@@ -1091,14 +1078,10 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors(
} }
if (!response_descriptors.empty()) { if (!response_descriptors.empty()) {
RecordGetDescriptorsOutcome(quantity, UMAGetDescriptorOutcome::SUCCESS);
std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS, std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS,
std::move(response_descriptors)); std::move(response_descriptors));
return; return;
} }
RecordGetDescriptorsOutcome(
quantity, descriptors_uuid ? UMAGetDescriptorOutcome::NOT_FOUND
: UMAGetDescriptorOutcome::NO_DESCRIPTORS);
std::move(callback).Run( std::move(callback).Run(
descriptors_uuid ? blink::mojom::WebBluetoothResult::DESCRIPTOR_NOT_FOUND descriptors_uuid ? blink::mojom::WebBluetoothResult::DESCRIPTOR_NOT_FOUND
: blink::mojom::WebBluetoothResult::NO_DESCRIPTORS_FOUND, : blink::mojom::WebBluetoothResult::NO_DESCRIPTORS_FOUND,
...@@ -1300,7 +1283,6 @@ void WebBluetoothServiceImpl::RemoteDescriptorReadValue( ...@@ -1300,7 +1283,6 @@ void WebBluetoothServiceImpl::RemoteDescriptorReadValue(
} }
if (query_result.outcome != CacheQueryOutcome::SUCCESS) { if (query_result.outcome != CacheQueryOutcome::SUCCESS) {
RecordDescriptorReadValueOutcome(query_result.outcome);
std::move(callback).Run(query_result.GetWebResult(), std::move(callback).Run(query_result.GetWebResult(),
base::nullopt /* value */); base::nullopt /* value */);
return; return;
...@@ -1308,7 +1290,6 @@ void WebBluetoothServiceImpl::RemoteDescriptorReadValue( ...@@ -1308,7 +1290,6 @@ void WebBluetoothServiceImpl::RemoteDescriptorReadValue(
if (BluetoothBlocklist::Get().IsExcludedFromReads( if (BluetoothBlocklist::Get().IsExcludedFromReads(
query_result.descriptor->GetUUID())) { query_result.descriptor->GetUUID())) {
RecordDescriptorReadValueOutcome(UMAGATTOperationOutcome::BLOCKLISTED);
std::move(callback).Run(blink::mojom::WebBluetoothResult::BLOCKLISTED_READ, std::move(callback).Run(blink::mojom::WebBluetoothResult::BLOCKLISTED_READ,
base::nullopt /* value */); base::nullopt /* value */);
return; return;
...@@ -1346,14 +1327,12 @@ void WebBluetoothServiceImpl::RemoteDescriptorWriteValue( ...@@ -1346,14 +1327,12 @@ void WebBluetoothServiceImpl::RemoteDescriptorWriteValue(
} }
if (query_result.outcome != CacheQueryOutcome::SUCCESS) { if (query_result.outcome != CacheQueryOutcome::SUCCESS) {
RecordDescriptorWriteValueOutcome(query_result.outcome);
std::move(callback).Run(query_result.GetWebResult()); std::move(callback).Run(query_result.GetWebResult());
return; return;
} }
if (BluetoothBlocklist::Get().IsExcludedFromWrites( if (BluetoothBlocklist::Get().IsExcludedFromWrites(
query_result.descriptor->GetUUID())) { query_result.descriptor->GetUUID())) {
RecordDescriptorWriteValueOutcome(UMAGATTOperationOutcome::BLOCKLISTED);
std::move(callback).Run( std::move(callback).Run(
blink::mojom::WebBluetoothResult::BLOCKLISTED_WRITE); blink::mojom::WebBluetoothResult::BLOCKLISTED_WRITE);
return; return;
...@@ -1944,7 +1923,6 @@ void WebBluetoothServiceImpl::OnDescriptorReadValueSuccess( ...@@ -1944,7 +1923,6 @@ void WebBluetoothServiceImpl::OnDescriptorReadValueSuccess(
RemoteDescriptorReadValueCallback callback, RemoteDescriptorReadValueCallback callback,
const std::vector<uint8_t>& value) { const std::vector<uint8_t>& value) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
RecordDescriptorReadValueOutcome(UMAGATTOperationOutcome::SUCCESS);
std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS, value); std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS, value);
} }
...@@ -1968,7 +1946,6 @@ void WebBluetoothServiceImpl::OnDescriptorWriteValueFailed( ...@@ -1968,7 +1946,6 @@ void WebBluetoothServiceImpl::OnDescriptorWriteValueFailed(
RemoteDescriptorWriteValueCallback callback, RemoteDescriptorWriteValueCallback callback,
device::BluetoothRemoteGattService::GattErrorCode error_code) { device::BluetoothRemoteGattService::GattErrorCode error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
RecordDescriptorWriteValueOutcome(UMAGATTOperationOutcome::SUCCESS);
std::move(callback).Run(TranslateGATTErrorAndRecord( std::move(callback).Run(TranslateGATTErrorAndRecord(
error_code, UMAGATTOperation::DESCRIPTOR_WRITE)); error_code, UMAGATTOperation::DESCRIPTOR_WRITE));
} }
......
...@@ -640,22 +640,6 @@ void BluetoothAdapter::RemoveTimedOutDevices() { ...@@ -640,22 +640,6 @@ void BluetoothAdapter::RemoveTimedOutDevices() {
} }
} }
// static
void BluetoothAdapter::RecordBluetoothDiscoverySessionStartOutcome(
UMABluetoothDiscoverySessionOutcome outcome) {
UMA_HISTOGRAM_ENUMERATION(
"Bluetooth.DiscoverySession.Start.Outcome", static_cast<int>(outcome),
static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
}
// static
void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
UMABluetoothDiscoverySessionOutcome outcome) {
UMA_HISTOGRAM_ENUMERATION(
"Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome),
static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
}
// static // static
constexpr base::TimeDelta BluetoothAdapter::timeoutSec = constexpr base::TimeDelta BluetoothAdapter::timeoutSec =
base::TimeDelta::FromSeconds(180); base::TimeDelta::FromSeconds(180);
......
...@@ -796,14 +796,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter ...@@ -796,14 +796,6 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter
std::set<BluetoothDiscoverySession*> discovery_sessions_; std::set<BluetoothDiscoverySession*> discovery_sessions_;
private: private:
// Histograms the result of StartDiscoverySession.
static void RecordBluetoothDiscoverySessionStartOutcome(
UMABluetoothDiscoverySessionOutcome outcome);
// Histograms the result of BluetoothDiscoverySession::Stop.
static void RecordBluetoothDiscoverySessionStopOutcome(
UMABluetoothDiscoverySessionOutcome outcome);
// This is the callback for all OS level calls to StartScanWithFilter, // This is the callback for all OS level calls to StartScanWithFilter,
// UpdateFilter, and StopScan. It updates the state accordingly, calls all // UpdateFilter, and StopScan. It updates the state accordingly, calls all
// appropriate callbacks, and calls ProcessDiscoveryQueue(). // appropriate callbacks, and calls ProcessDiscoveryQueue().
......
...@@ -47,16 +47,12 @@ void BluetoothDiscoverySession::Stop(base::OnceClosure success_callback, ...@@ -47,16 +47,12 @@ void BluetoothDiscoverySession::Stop(base::OnceClosure success_callback,
ErrorCallback error_callback) { ErrorCallback error_callback) {
if (!IsActive()) { if (!IsActive()) {
DVLOG(1) << "Discovery session not active. Cannot stop."; DVLOG(1) << "Discovery session not active. Cannot stop.";
BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
UMABluetoothDiscoverySessionOutcome::NOT_ACTIVE);
std::move(error_callback).Run(); std::move(error_callback).Run();
return; return;
} }
if (is_stop_in_progress_) { if (is_stop_in_progress_) {
LOG(WARNING) << "Discovery session Stop in progress."; LOG(WARNING) << "Discovery session Stop in progress.";
BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
UMABluetoothDiscoverySessionOutcome::STOP_IN_PROGRESS);
std::move(error_callback).Run(); std::move(error_callback).Run();
return; return;
} }
...@@ -89,8 +85,6 @@ void BluetoothDiscoverySession::OnDiscoverySessionRemoved( ...@@ -89,8 +85,6 @@ void BluetoothDiscoverySession::OnDiscoverySessionRemoved(
base::WeakPtr<BluetoothDiscoverySession> session, base::WeakPtr<BluetoothDiscoverySession> session,
base::OnceClosure deactivate_discovery_session, base::OnceClosure deactivate_discovery_session,
base::OnceClosure success_callback) { base::OnceClosure success_callback) {
BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
UMABluetoothDiscoverySessionOutcome::SUCCESS);
if (session) if (session)
session->is_stop_in_progress_ = false; session->is_stop_in_progress_ = false;
std::move(deactivate_discovery_session).Run(); std::move(deactivate_discovery_session).Run();
...@@ -102,7 +96,6 @@ void BluetoothDiscoverySession::OnDiscoverySessionRemovalFailed( ...@@ -102,7 +96,6 @@ void BluetoothDiscoverySession::OnDiscoverySessionRemovalFailed(
base::WeakPtr<BluetoothDiscoverySession> session, base::WeakPtr<BluetoothDiscoverySession> session,
base::OnceClosure error_callback, base::OnceClosure error_callback,
UMABluetoothDiscoverySessionOutcome outcome) { UMABluetoothDiscoverySessionOutcome outcome) {
BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(outcome);
if (session) if (session)
session->is_stop_in_progress_ = false; session->is_stop_in_progress_ = false;
std::move(error_callback).Run(); std::move(error_callback).Run();
......
...@@ -102,38 +102,6 @@ void ParseModalias(const dbus::ObjectPath& object_path, ...@@ -102,38 +102,6 @@ void ParseModalias(const dbus::ObjectPath& object_path,
*device_id = device_value; *device_id = device_value;
} }
void RecordPairingResult(BluetoothDevice::ConnectErrorCode error_code) {
UMAPairingResult pairing_result;
switch (error_code) {
case BluetoothDevice::ERROR_INPROGRESS:
pairing_result = UMA_PAIRING_RESULT_INPROGRESS;
break;
case BluetoothDevice::ERROR_FAILED:
pairing_result = UMA_PAIRING_RESULT_FAILED;
break;
case BluetoothDevice::ERROR_AUTH_FAILED:
pairing_result = UMA_PAIRING_RESULT_AUTH_FAILED;
break;
case BluetoothDevice::ERROR_AUTH_CANCELED:
pairing_result = UMA_PAIRING_RESULT_AUTH_CANCELED;
break;
case BluetoothDevice::ERROR_AUTH_REJECTED:
pairing_result = UMA_PAIRING_RESULT_AUTH_REJECTED;
break;
case BluetoothDevice::ERROR_AUTH_TIMEOUT:
pairing_result = UMA_PAIRING_RESULT_AUTH_TIMEOUT;
break;
case BluetoothDevice::ERROR_UNSUPPORTED_DEVICE:
pairing_result = UMA_PAIRING_RESULT_UNSUPPORTED_DEVICE;
break;
default:
pairing_result = UMA_PAIRING_RESULT_UNKNOWN_ERROR;
}
UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingResult", pairing_result,
UMA_PAIRING_RESULT_COUNT);
}
BluetoothDevice::ConnectErrorCode DBusErrorToConnectError( BluetoothDevice::ConnectErrorCode DBusErrorToConnectError(
const std::string& error_name) { const std::string& error_name) {
BluetoothDevice::ConnectErrorCode error_code = BluetoothDevice::ERROR_UNKNOWN; BluetoothDevice::ConnectErrorCode error_code = BluetoothDevice::ERROR_UNKNOWN;
...@@ -554,8 +522,7 @@ void BluetoothDeviceBlueZ::Connect( ...@@ -554,8 +522,7 @@ void BluetoothDeviceBlueZ::Connect(
ConnectErrorCallback error_callback) { ConnectErrorCallback error_callback) {
BLUETOOTH_LOG(EVENT) << "Successfully paused discovery"; BLUETOOTH_LOG(EVENT) << "Successfully paused discovery";
if (weak_ptr) if (weak_ptr)
weak_ptr->ConnectInternal(false /* after_pairing */, weak_ptr->ConnectInternal(std::move(callback),
std::move(callback),
std::move(error_callback)); std::move(error_callback));
}, },
weak_ptr_factory_.GetWeakPtr(), dupe_callback, dupe_error_callback), weak_ptr_factory_.GetWeakPtr(), dupe_callback, dupe_error_callback),
...@@ -566,7 +533,7 @@ void BluetoothDeviceBlueZ::Connect( ...@@ -566,7 +533,7 @@ void BluetoothDeviceBlueZ::Connect(
const std::string& error_message) { const std::string& error_message) {
BLUETOOTH_LOG(EVENT) << "Failed to pause discovery"; BLUETOOTH_LOG(EVENT) << "Failed to pause discovery";
if (weak_ptr) if (weak_ptr)
weak_ptr->ConnectInternal(false, std::move(callback), weak_ptr->ConnectInternal(std::move(callback),
std::move(error_callback)); std::move(error_callback));
}, },
weak_ptr_factory_.GetWeakPtr(), dupe_callback, weak_ptr_factory_.GetWeakPtr(), dupe_callback,
...@@ -970,22 +937,19 @@ void BluetoothDeviceBlueZ::OnAbortWriteError( ...@@ -970,22 +937,19 @@ void BluetoothDeviceBlueZ::OnAbortWriteError(
#endif #endif
void BluetoothDeviceBlueZ::ConnectInternal( void BluetoothDeviceBlueZ::ConnectInternal(
bool after_pairing,
base::OnceClosure callback, base::OnceClosure callback,
ConnectErrorCallback error_callback) { ConnectErrorCallback error_callback) {
BLUETOOTH_LOG(EVENT) << object_path_.value() << ": Connecting"; BLUETOOTH_LOG(EVENT) << object_path_.value() << ": Connecting";
bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->Connect( bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->Connect(
object_path_, object_path_,
base::BindOnce(&BluetoothDeviceBlueZ::OnConnect, base::BindOnce(&BluetoothDeviceBlueZ::OnConnect,
weak_ptr_factory_.GetWeakPtr(), after_pairing, weak_ptr_factory_.GetWeakPtr(), std::move(callback)),
std::move(callback)),
base::BindOnce(&BluetoothDeviceBlueZ::OnConnectError, base::BindOnce(&BluetoothDeviceBlueZ::OnConnectError,
weak_ptr_factory_.GetWeakPtr(), after_pairing, weak_ptr_factory_.GetWeakPtr(),
std::move(error_callback))); std::move(error_callback)));
} }
void BluetoothDeviceBlueZ::OnConnect(bool after_pairing, void BluetoothDeviceBlueZ::OnConnect(base::OnceClosure callback) {
base::OnceClosure callback) {
BLUETOOTH_LOG(EVENT) << object_path_.value() BLUETOOTH_LOG(EVENT) << object_path_.value()
<< ": Unpausing discovery after connection"; << ": Unpausing discovery after connection";
UnpauseDiscovery(); UnpauseDiscovery();
...@@ -998,16 +962,10 @@ void BluetoothDeviceBlueZ::OnConnect(bool after_pairing, ...@@ -998,16 +962,10 @@ void BluetoothDeviceBlueZ::OnConnect(bool after_pairing,
SetTrusted(); SetTrusted();
if (after_pairing)
UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingResult",
UMA_PAIRING_RESULT_SUCCESS,
UMA_PAIRING_RESULT_COUNT);
std::move(callback).Run(); std::move(callback).Run();
} }
void BluetoothDeviceBlueZ::OnConnectError(bool after_pairing, void BluetoothDeviceBlueZ::OnConnectError(ConnectErrorCallback error_callback,
ConnectErrorCallback error_callback,
const std::string& error_name, const std::string& error_name,
const std::string& error_message) { const std::string& error_message) {
BLUETOOTH_LOG(EVENT) << object_path_.value() BLUETOOTH_LOG(EVENT) << object_path_.value()
...@@ -1034,8 +992,6 @@ void BluetoothDeviceBlueZ::OnConnectError(bool after_pairing, ...@@ -1034,8 +992,6 @@ void BluetoothDeviceBlueZ::OnConnectError(bool after_pairing,
error_code = ERROR_UNSUPPORTED_DEVICE; error_code = ERROR_UNSUPPORTED_DEVICE;
} }
if (after_pairing)
RecordPairingResult(error_code);
std::move(error_callback).Run(error_code); std::move(error_callback).Run(error_code);
} }
...@@ -1046,7 +1002,7 @@ void BluetoothDeviceBlueZ::OnPairDuringConnect( ...@@ -1046,7 +1002,7 @@ void BluetoothDeviceBlueZ::OnPairDuringConnect(
EndPairing(); EndPairing();
ConnectInternal(true, std::move(callback), std::move(error_callback)); ConnectInternal(std::move(callback), std::move(error_callback));
} }
void BluetoothDeviceBlueZ::OnPairDuringConnectError( void BluetoothDeviceBlueZ::OnPairDuringConnectError(
...@@ -1068,7 +1024,6 @@ void BluetoothDeviceBlueZ::OnPairDuringConnectError( ...@@ -1068,7 +1024,6 @@ void BluetoothDeviceBlueZ::OnPairDuringConnectError(
// Determine the error code from error_name. // Determine the error code from error_name.
ConnectErrorCode error_code = DBusErrorToConnectError(error_name); ConnectErrorCode error_code = DBusErrorToConnectError(error_name);
RecordPairingResult(error_code);
std::move(error_callback).Run(error_code); std::move(error_callback).Run(error_code);
} }
...@@ -1086,7 +1041,6 @@ void BluetoothDeviceBlueZ::OnPairError(ConnectErrorCallback error_callback, ...@@ -1086,7 +1041,6 @@ void BluetoothDeviceBlueZ::OnPairError(ConnectErrorCallback error_callback,
<< error_message; << error_message;
EndPairing(); EndPairing();
ConnectErrorCode error_code = DBusErrorToConnectError(error_name); ConnectErrorCode error_code = DBusErrorToConnectError(error_name);
RecordPairingResult(error_code);
std::move(error_callback).Run(error_code); std::move(error_callback).Run(error_code);
} }
......
...@@ -222,12 +222,10 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ ...@@ -222,12 +222,10 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ
// Internal method to initiate a connection to this device, and methods called // Internal method to initiate a connection to this device, and methods called
// by dbus:: on completion of the D-Bus method call. // by dbus:: on completion of the D-Bus method call.
void ConnectInternal(bool after_pairing, void ConnectInternal(base::OnceClosure callback,
base::OnceClosure callback,
ConnectErrorCallback error_callback); ConnectErrorCallback error_callback);
void OnConnect(bool after_pairing, base::OnceClosure callback); void OnConnect(base::OnceClosure callback);
void OnConnectError(bool after_pairing, void OnConnectError(ConnectErrorCallback error_callback,
ConnectErrorCallback error_callback,
const std::string& error_name, const std::string& error_name,
const std::string& error_message); const std::string& error_message);
......
...@@ -197,6 +197,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -197,6 +197,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.DiscoverySession.Start.Outcome" <histogram name="Bluetooth.DiscoverySession.Start.Outcome"
enum="BluetoothDiscoveryOutcomes" expires_after="M85"> enum="BluetoothDiscoveryOutcomes" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -242,6 +245,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -242,6 +245,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.PairingResult" enum="BluetoothPairingResult" <histogram name="Bluetooth.PairingResult" enum="BluetoothPairingResult"
expires_after="M85"> expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>adlr@chromium.org</owner> <owner>adlr@chromium.org</owner>
<summary> <summary>
Records the result of pairing each Bluetooth Device. Used to understand Records the result of pairing each Bluetooth Device. Used to understand
...@@ -262,6 +268,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -262,6 +268,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.Blocklist.ParsedNonEmptyString" <histogram name="Bluetooth.Web.Blocklist.ParsedNonEmptyString"
enum="BooleanSuccess" expires_after="M85"> enum="BooleanSuccess" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -360,6 +369,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -360,6 +369,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.Descriptor.ReadValue.Outcome" <histogram name="Bluetooth.Web.Descriptor.ReadValue.Outcome"
enum="WebBluetoothGATTOperationOutcome" expires_after="M85"> enum="WebBluetoothGATTOperationOutcome" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -373,6 +385,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -373,6 +385,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.Descriptor.WriteValue.Outcome" <histogram name="Bluetooth.Web.Descriptor.WriteValue.Outcome"
enum="WebBluetoothGATTOperationOutcome" expires_after="M85"> enum="WebBluetoothGATTOperationOutcome" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -398,6 +413,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -398,6 +413,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.GetCharacteristic.Outcome" <histogram name="Bluetooth.Web.GetCharacteristic.Outcome"
enum="WebBluetoothGetCharacteristicOutcome" expires_after="2021-01-31"> enum="WebBluetoothGetCharacteristicOutcome" expires_after="2021-01-31">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -422,6 +440,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -422,6 +440,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.GetCharacteristics.Outcome" <histogram name="Bluetooth.Web.GetCharacteristics.Outcome"
enum="WebBluetoothGetCharacteristicOutcome" expires_after="M85"> enum="WebBluetoothGetCharacteristicOutcome" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -434,6 +455,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -434,6 +455,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.GetDescriptor.Descriptor" <histogram name="Bluetooth.Web.GetDescriptor.Descriptor"
enum="GATTDescriptorHash" expires_after="M85"> enum="GATTDescriptorHash" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -446,6 +470,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -446,6 +470,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.GetDescriptor.Outcome" <histogram name="Bluetooth.Web.GetDescriptor.Outcome"
enum="WebBluetoothGetDescriptorOutcome" expires_after="M85"> enum="WebBluetoothGetDescriptorOutcome" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -458,6 +485,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -458,6 +485,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.GetDescriptors.Descriptor" <histogram name="Bluetooth.Web.GetDescriptors.Descriptor"
enum="GATTDescriptorHash" expires_after="M85"> enum="GATTDescriptorHash" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
...@@ -470,6 +500,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -470,6 +500,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Bluetooth.Web.GetDescriptors.Outcome" <histogram name="Bluetooth.Web.GetDescriptors.Outcome"
enum="WebBluetoothGetDescriptorOutcome" expires_after="M85"> enum="WebBluetoothGetDescriptorOutcome" expires_after="M85">
<obsolete>
Removed 2020/11/05. crbug.com/1088659
</obsolete>
<owner>odejesush@chromium.org</owner> <owner>odejesush@chromium.org</owner>
<owner>ortuno@chromium.org</owner> <owner>ortuno@chromium.org</owner>
<owner>reillyg@chromium.org</owner> <owner>reillyg@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment