| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" | 11 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class TimeDelta; | 14 class TimeDelta; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace device { | 17 namespace device { |
| 18 class BluetoothUUID; | 18 class BluetoothUUID; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 | 22 |
| 23 // General Metrics | 23 // General Metrics |
| 24 | 24 |
| 25 // Enumeration of each Web Bluetooth API entry point. | |
| 26 enum class UMAWebBluetoothFunction { | |
| 27 REQUEST_DEVICE = 0, | |
| 28 CONNECT_GATT = 1, | |
| 29 GET_PRIMARY_SERVICE = 2, | |
| 30 SERVICE_GET_CHARACTERISTIC = 3, | |
| 31 CHARACTERISTIC_READ_VALUE = 4, | |
| 32 CHARACTERISTIC_WRITE_VALUE = 5, | |
| 33 CHARACTERISTIC_START_NOTIFICATIONS = 6, | |
| 34 CHARACTERISTIC_STOP_NOTIFICATIONS = 7, | |
| 35 REMOTE_GATT_SERVER_DISCONNECT = 8, | |
| 36 SERVICE_GET_CHARACTERISTICS = 9, | |
| 37 GET_PRIMARY_SERVICES = 10, | |
| 38 DESCRIPTOR_READ_VALUE = 11, | |
| 39 DESCRIPTOR_WRITE_VALUE = 12, | |
| 40 CHARACTERISTIC_GET_DESCRIPTOR = 13, | |
| 41 CHARACTERISTIC_GET_DESCRIPTORS = 14, | |
| 42 // NOTE: Add new actions immediately above this line. Make sure to update | |
| 43 // the enum list in tools/metrics/histograms/histograms.xml accordingly. | |
| 44 COUNT | |
| 45 }; | |
| 46 | |
| 47 // There should be a call to this function for every call to the Web Bluetooth | |
| 48 // API. | |
| 49 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); | |
| 50 | |
| 51 // Enumeration for outcomes of querying the bluetooth cache. | 25 // Enumeration for outcomes of querying the bluetooth cache. |
| 52 enum class CacheQueryOutcome { | 26 enum class CacheQueryOutcome { |
| 53 SUCCESS = 0, | 27 SUCCESS = 0, |
| 54 BAD_RENDERER = 1, | 28 BAD_RENDERER = 1, |
| 55 NO_DEVICE = 2, | 29 NO_DEVICE = 2, |
| 56 NO_SERVICE = 3, | 30 NO_SERVICE = 3, |
| 57 NO_CHARACTERISTIC = 4, | 31 NO_CHARACTERISTIC = 4, |
| 58 NO_DESCRIPTOR = 5, | 32 NO_DESCRIPTOR = 5, |
| 59 }; | 33 }; |
| 60 | 34 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level); | 324 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level); |
| 351 | 325 |
| 352 // In the case of not accepting all devices in the options that are given | 326 // In the case of not accepting all devices in the options that are given |
| 353 // to WebBluetooth requestDevice(), records the number of devices in the | 327 // to WebBluetooth requestDevice(), records the number of devices in the |
| 354 // chooser when a device is paired. | 328 // chooser when a device is paired. |
| 355 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices); | 329 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices); |
| 356 | 330 |
| 357 } // namespace content | 331 } // namespace content |
| 358 | 332 |
| 359 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 333 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
| OLD | NEW |