diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-28 21:48:31 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-28 21:48:31 +0000 |
commit | 68d595c6ba0e7a9cb64c0c2d9e313591c9510895 (patch) | |
tree | 6e248c46c0458965dbd1e68f6a478e06cb49b7cc /device/bluetooth/bluetooth_device_experimental_chromeos.cc | |
parent | 9467d4017392a1e39387aa479bdd23a61f3ca54f (diff) | |
download | chromium_src-68d595c6ba0e7a9cb64c0c2d9e313591c9510895.zip chromium_src-68d595c6ba0e7a9cb64c0c2d9e313591c9510895.tar.gz chromium_src-68d595c6ba0e7a9cb64c0c2d9e313591c9510895.tar.bz2 |
Revert 196990 "Bluetooth: gather usage metrics"
Broke this test on the CrOs main waterfall bots:
MetricsLogTest.RecordEnvironment:
[19521:19521:0428/105537:1031147919:FATAL:dbus_thread_manager.cc(562)] Check failed: g_dbus_thread_manager. DBusThreadManager::Get() called before Initialize()
[0x7fd74d7ce060] base::debug::StackTrace::StackTrace()
[0x7fd74d8085ab] logging::LogMessage::~LogMessage()
[0x7fd744a60cfe] chromeos::DBusThreadManager::Get()
[0x000003d84f8f] chromeos::BluetoothAdapterChromeOS::BluetoothAdapterChromeOS()
[0x000003d82c19] device::BluetoothAdapterFactory::GetAdapter()
[0x0000026f1274] MetricsLog::RecordEnvironmentProto()
[0x0000026f0bf2] MetricsLog::RecordEnvironment()
[0x0000013ad864] MetricsLogTest::TestRecordEnvironment()
[0x0000013a95d1] MetricsLogTest_RecordEnvironment_Test::TestBody()
[0x000002f37967] testing::internal::HandleSehExceptionsInMethodIfSupported<>()
[0x000002f35132] testing::internal::HandleExceptionsInMethodIfSupported<>()
[0x000002f2a4e6] testing::Test::Run()
[0x000002f2ad0a] testing::TestInfo::Run()
[0x000002f2b438] testing::TestCase::Run()
[0x000002f303e3] testing::internal::UnitTestImpl::RunAllTests()
[0x000002f3876e] testing::internal::HandleSehExceptionsInMethodIfSupported<>()
[0x000002f358f7] testing::internal::HandleExceptionsInMethodIfSupported<>()
[0x000002f2eeb2] testing::UnitTest::Run()
[0x0000045f17ac] base::TestSuite::Run()
[0x0000042fe020] content::UnitTestTestSuite::Run()
[0x00000306ea62] main
[0x7fd73e27b76d] __libc_start_
> Bluetooth: gather usage metrics
>
> BUG=233820
> TEST=chrome:///histograms
> R=isherman@chromium.org, satorux@chromium.org, youngki@chromium.org
>
> Review URL: https://codereview.chromium.org/13872017
TBR=keybuk@chromium.org
Review URL: https://codereview.chromium.org/14001008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device/bluetooth/bluetooth_device_experimental_chromeos.cc')
-rw-r--r-- | device/bluetooth/bluetooth_device_experimental_chromeos.cc | 152 |
1 files changed, 0 insertions, 152 deletions
diff --git a/device/bluetooth/bluetooth_device_experimental_chromeos.cc b/device/bluetooth/bluetooth_device_experimental_chromeos.cc index 3e11439..09c1ddf 100644 --- a/device/bluetooth/bluetooth_device_experimental_chromeos.cc +++ b/device/bluetooth/bluetooth_device_experimental_chromeos.cc @@ -5,9 +5,6 @@ #include "device/bluetooth/bluetooth_device_experimental_chromeos.h" #include "base/bind.h" -#include "base/metrics/histogram.h" -#include "base/string_util.h" -#include "base/strings/string_number_conversions.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/experimental_bluetooth_adapter_client.h" #include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h" @@ -28,67 +25,6 @@ namespace { // (which we fail in OnRegisterAgentError with ERROR_INPROGRESS). const char kAgentPath[] = "/org/chromium/bluetooth_agent"; -// Histogram enumerations for pairing methods. -enum UMAPairingMethod { - UMA_PAIRING_METHOD_NONE, - UMA_PAIRING_METHOD_REQUEST_PINCODE, - UMA_PAIRING_METHOD_REQUEST_PASSKEY, - UMA_PAIRING_METHOD_DISPLAY_PINCODE, - UMA_PAIRING_METHOD_DISPLAY_PASSKEY, - UMA_PAIRING_METHOD_CONFIRM_PASSKEY, - // NOTE: Add new pairing methods immediately above this line. Make sure to - // update the enum list in tools/histogram/histograms.xml accordinly. - UMA_PAIRING_METHOD_COUNT -}; - -// Histogram enumerations for pairing results. -enum UMAPairingResult { - UMA_PAIRING_RESULT_SUCCESS, - UMA_PAIRING_RESULT_INPROGRESS, - UMA_PAIRING_RESULT_FAILED, - UMA_PAIRING_RESULT_AUTH_FAILED, - UMA_PAIRING_RESULT_AUTH_CANCELED, - UMA_PAIRING_RESULT_AUTH_REJECTED, - UMA_PAIRING_RESULT_AUTH_TIMEOUT, - UMA_PAIRING_RESULT_UNSUPPORTED_DEVICE, - UMA_PAIRING_RESULT_UNKNOWN_ERROR, - // NOTE: Add new pairing results immediately above this line. Make sure to - // update the enum list in tools/histogram/histograms.xml accordinly. - UMA_PAIRING_RESULT_COUNT -}; - -void ParseModalias(const dbus::ObjectPath& object_path, - uint16 *vendor_id, - uint16 *product_id, - uint16 *device_id) { - chromeos::ExperimentalBluetoothDeviceClient::Properties* properties = - chromeos::DBusThreadManager::Get()-> - GetExperimentalBluetoothDeviceClient()->GetProperties(object_path); - DCHECK(properties); - - std::string modalias = properties->modalias.value(); - if (StartsWithASCII(modalias, "usb:", false) && modalias.length() == 19) { - // usb:vXXXXpXXXXdXXXX - if (modalias[4] == 'v' && vendor_id != NULL) { - uint64 component = 0; - base::HexStringToUInt64(modalias.substr(5, 4), &component); - *vendor_id = component; - } - - if (modalias[9] == 'p' && product_id != NULL) { - uint64 component = 0; - base::HexStringToUInt64(modalias.substr(10, 4), &component); - *product_id = component; - } - - if (modalias[14] == 'd' && device_id != NULL) { - uint64 component = 0; - base::HexStringToUInt64(modalias.substr(15, 4), &component); - *device_id = component; - } - } -} - } // namespace namespace chromeos { @@ -100,7 +36,6 @@ BluetoothDeviceExperimentalChromeOS::BluetoothDeviceExperimentalChromeOS( object_path_(object_path), num_connecting_calls_(0), pairing_delegate_(NULL), - pairing_delegate_used_(false), weak_ptr_factory_(this) { } @@ -134,24 +69,6 @@ std::string BluetoothDeviceExperimentalChromeOS::GetAddress() const { return properties->address.value(); } -uint16 BluetoothDeviceExperimentalChromeOS::GetVendorID() const { - uint16 vendor_id = 0; - ParseModalias(object_path_, &vendor_id, NULL, NULL); - return vendor_id; -} - -uint16 BluetoothDeviceExperimentalChromeOS::GetProductID() const { - uint16 product_id = 0; - ParseModalias(object_path_, NULL, &product_id, NULL); - return product_id; -} - -uint16 BluetoothDeviceExperimentalChromeOS::GetDeviceID() const { - uint16 device_id = 0; - ParseModalias(object_path_, NULL, NULL, &device_id); - return device_id; -} - bool BluetoothDeviceExperimentalChromeOS::IsPaired() const { ExperimentalBluetoothDeviceClient::Properties* properties = DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()-> @@ -244,7 +161,6 @@ void BluetoothDeviceExperimentalChromeOS::Connect( DCHECK(agent_.get() == NULL); pairing_delegate_ = pairing_delegate; - pairing_delegate_used_ = false; // The agent path is relatively meaningless since BlueZ only supports // one per application at a time. @@ -394,10 +310,6 @@ void BluetoothDeviceExperimentalChromeOS::RequestPinCode( DCHECK(device_path == object_path_); VLOG(1) << object_path_.value() << ": RequestPinCode"; - UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod", - UMA_PAIRING_METHOD_REQUEST_PINCODE, - UMA_PAIRING_METHOD_COUNT); - DCHECK(pairing_delegate_); DCHECK(pincode_callback_.is_null()); pincode_callback_ = callback; @@ -411,10 +323,6 @@ void BluetoothDeviceExperimentalChromeOS::DisplayPinCode( DCHECK(device_path == object_path_); VLOG(1) << object_path_.value() << ": DisplayPinCode: " << pincode; - UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod", - UMA_PAIRING_METHOD_DISPLAY_PINCODE, - UMA_PAIRING_METHOD_COUNT); - DCHECK(pairing_delegate_); pairing_delegate_->DisplayPinCode(this, pincode); } @@ -426,10 +334,6 @@ void BluetoothDeviceExperimentalChromeOS::RequestPasskey( DCHECK(device_path == object_path_); VLOG(1) << object_path_.value() << ": RequestPasskey"; - UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod", - UMA_PAIRING_METHOD_REQUEST_PASSKEY, - UMA_PAIRING_METHOD_COUNT); - DCHECK(pairing_delegate_); DCHECK(passkey_callback_.is_null()); passkey_callback_ = callback; @@ -445,11 +349,6 @@ void BluetoothDeviceExperimentalChromeOS::DisplayPasskey( VLOG(1) << object_path_.value() << ": DisplayPasskey: " << passkey << " (" << entered << " entered)"; - if (entered == 0) - UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod", - UMA_PAIRING_METHOD_DISPLAY_PASSKEY, - UMA_PAIRING_METHOD_COUNT); - DCHECK(pairing_delegate_); if (entered == 0) pairing_delegate_->DisplayPasskey(this, passkey); @@ -464,10 +363,6 @@ void BluetoothDeviceExperimentalChromeOS::RequestConfirmation( DCHECK(device_path == object_path_); VLOG(1) << object_path_.value() << ": RequestConfirmation: " << passkey; - UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod", - UMA_PAIRING_METHOD_CONFIRM_PASSKEY, - UMA_PAIRING_METHOD_COUNT); - DCHECK(pairing_delegate_); DCHECK(confirmation_callback_.is_null()); confirmation_callback_ = callback; @@ -551,7 +446,6 @@ void BluetoothDeviceExperimentalChromeOS::OnConnectError( error_code = ERROR_UNSUPPORTED_DEVICE; } - RecordPairingResult(false, error_code); error_callback.Run(error_code); } @@ -592,7 +486,6 @@ void BluetoothDeviceExperimentalChromeOS::OnRegisterAgentError( if (error_name == bluetooth_adapter::kErrorAlreadyExists) error_code = ERROR_INPROGRESS; - RecordPairingResult(false, error_code); error_callback.Run(error_code); } @@ -600,11 +493,6 @@ void BluetoothDeviceExperimentalChromeOS::OnPair( const base::Closure& callback, const ConnectErrorCallback& error_callback) { VLOG(1) << object_path_.value() << ": Paired"; - - if (!pairing_delegate_used_) - UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod", - UMA_PAIRING_METHOD_NONE, - UMA_PAIRING_METHOD_COUNT); UnregisterAgent(); SetTrusted(); ConnectInternal(callback, error_callback); @@ -639,7 +527,6 @@ void BluetoothDeviceExperimentalChromeOS::OnPairError( error_code = ERROR_AUTH_TIMEOUT; } - RecordPairingResult(false, error_code); error_callback.Run(error_code); } @@ -749,43 +636,4 @@ bool BluetoothDeviceExperimentalChromeOS::RunPairingCallbacks(Status status) { return callback_run; } -void BluetoothDeviceExperimentalChromeOS::RecordPairingResult( - bool success, - ConnectErrorCode error_code) { - UMAPairingResult pairing_result; - if (success) { - pairing_result = UMA_PAIRING_RESULT_SUCCESS; - } else { - switch (error_code) { - case ERROR_INPROGRESS: - pairing_result = UMA_PAIRING_RESULT_INPROGRESS; - break; - case ERROR_FAILED: - pairing_result = UMA_PAIRING_RESULT_FAILED; - break; - case ERROR_AUTH_FAILED: - pairing_result = UMA_PAIRING_RESULT_AUTH_FAILED; - break; - case ERROR_AUTH_CANCELED: - pairing_result = UMA_PAIRING_RESULT_AUTH_CANCELED; - break; - case ERROR_AUTH_REJECTED: - pairing_result = UMA_PAIRING_RESULT_AUTH_REJECTED; - break; - case ERROR_AUTH_TIMEOUT: - pairing_result = UMA_PAIRING_RESULT_AUTH_TIMEOUT; - break; - case 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); -} - } // namespace chromeos |