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

Side by Side Diff: content/browser/bluetooth/bluetooth_metrics.cc

Issue 2662433003: Add BluetoothRemoteGATTDescriptor reporting for .writeValue(). (Closed)
Patch Set: updating comments Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/bluetooth/bluetooth_metrics.h" 5 #include "content/browser/bluetooth/bluetooth_metrics.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 case UMAGATTOperation::CHARACTERISTIC_WRITE: 277 case UMAGATTOperation::CHARACTERISTIC_WRITE:
278 RecordCharacteristicWriteValueOutcome(outcome); 278 RecordCharacteristicWriteValueOutcome(outcome);
279 return; 279 return;
280 case UMAGATTOperation::START_NOTIFICATIONS: 280 case UMAGATTOperation::START_NOTIFICATIONS:
281 RecordStartNotificationsOutcome(outcome); 281 RecordStartNotificationsOutcome(outcome);
282 return; 282 return;
283 case UMAGATTOperation::DESCRIPTOR_READ: 283 case UMAGATTOperation::DESCRIPTOR_READ:
284 RecordDescriptorReadValueOutcome(outcome); 284 RecordDescriptorReadValueOutcome(outcome);
285 return; 285 return;
286 case UMAGATTOperation::DESCRIPTOR_WRITE: 286 case UMAGATTOperation::DESCRIPTOR_WRITE:
287 // TODO(683477) reporting for .writeValue() 287 RecordDescriptorWriteValueOutcome(outcome);
288 return; 288 return;
289 case UMAGATTOperation::COUNT: 289 case UMAGATTOperation::COUNT:
290 NOTREACHED(); 290 NOTREACHED();
291 return; 291 return;
292 } 292 }
293 NOTREACHED(); 293 NOTREACHED();
294 } 294 }
295 295
296 static UMAGATTOperationOutcome TranslateCacheQueryOutcomeToGATTOperationOutcome( 296 static UMAGATTOperationOutcome TranslateCacheQueryOutcomeToGATTOperationOutcome(
297 CacheQueryOutcome outcome) { 297 CacheQueryOutcome outcome) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Descriptor.ReadValue.Outcome", 364 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Descriptor.ReadValue.Outcome",
365 static_cast<int>(outcome), 365 static_cast<int>(outcome),
366 static_cast<int>(UMAGATTOperationOutcome::COUNT)); 366 static_cast<int>(UMAGATTOperationOutcome::COUNT));
367 } 367 }
368 368
369 void RecordDescriptorReadValueOutcome(CacheQueryOutcome outcome) { 369 void RecordDescriptorReadValueOutcome(CacheQueryOutcome outcome) {
370 RecordDescriptorReadValueOutcome( 370 RecordDescriptorReadValueOutcome(
371 TranslateCacheQueryOutcomeToGATTOperationOutcome(outcome)); 371 TranslateCacheQueryOutcomeToGATTOperationOutcome(outcome));
372 } 372 }
373 373
374 // Descriptor.writeValue
375
376 void RecordDescriptorWriteValueOutcome(UMAGATTOperationOutcome outcome) {
377 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Descriptor.WriteValue.Outcome",
378 static_cast<int>(outcome),
379 static_cast<int>(UMAGATTOperationOutcome::COUNT));
380 }
381
382 void RecordDescriptorWriteValueOutcome(CacheQueryOutcome outcome) {
383 RecordDescriptorWriteValueOutcome(
384 TranslateCacheQueryOutcomeToGATTOperationOutcome(outcome));
385 }
386
374 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level) { 387 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level) {
375 UMA_HISTOGRAM_ENUMERATION( 388 UMA_HISTOGRAM_ENUMERATION(
376 "Bluetooth.Web.RequestDevice.RSSISignalStrengthLevel", 389 "Bluetooth.Web.RequestDevice.RSSISignalStrengthLevel",
377 static_cast<int>(level), 390 static_cast<int>(level),
378 static_cast<int>(UMARSSISignalStrengthLevel::COUNT)); 391 static_cast<int>(UMARSSISignalStrengthLevel::COUNT));
379 } 392 }
380 393
381 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) { 394 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) {
382 if (!accept_all_devices) { 395 if (!accept_all_devices) {
383 UMA_HISTOGRAM_SPARSE_SLOWLY( 396 UMA_HISTOGRAM_SPARSE_SLOWLY(
384 "Bluetooth.Web.RequestDevice." 397 "Bluetooth.Web.RequestDevice."
385 "NumOfDevicesInChooserWhenNotAcceptingAllDevices", 398 "NumOfDevicesInChooserWhenNotAcceptingAllDevices",
386 std::min(num_of_devices, kMaxNumOfDevices)); 399 std::min(num_of_devices, kMaxNumOfDevices));
387 } 400 }
388 } 401 }
389 402
390 } // namespace content 403 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | content/browser/bluetooth/web_bluetooth_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698