| 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 SERVICE_GET_CHARACTERISTIC = 3, | 30 SERVICE_GET_CHARACTERISTIC = 3, |
| 31 CHARACTERISTIC_READ_VALUE = 4, | 31 CHARACTERISTIC_READ_VALUE = 4, |
| 32 CHARACTERISTIC_WRITE_VALUE = 5, | 32 CHARACTERISTIC_WRITE_VALUE = 5, |
| 33 CHARACTERISTIC_START_NOTIFICATIONS = 6, | 33 CHARACTERISTIC_START_NOTIFICATIONS = 6, |
| 34 CHARACTERISTIC_STOP_NOTIFICATIONS = 7, | 34 CHARACTERISTIC_STOP_NOTIFICATIONS = 7, |
| 35 REMOTE_GATT_SERVER_DISCONNECT = 8, | 35 REMOTE_GATT_SERVER_DISCONNECT = 8, |
| 36 SERVICE_GET_CHARACTERISTICS = 9, | 36 SERVICE_GET_CHARACTERISTICS = 9, |
| 37 GET_PRIMARY_SERVICES = 10, | 37 GET_PRIMARY_SERVICES = 10, |
| 38 DESCRIPTOR_READ_VALUE = 11, | 38 DESCRIPTOR_READ_VALUE = 11, |
| 39 DESCRIPTOR_WRITE_VALUE = 12, | 39 DESCRIPTOR_WRITE_VALUE = 12, |
| 40 CHARACTERISTIC_GET_DESCRIPTOR = 13, |
| 41 CHARACTERISTIC_GET_DESCRIPTORS = 14, |
| 40 // NOTE: Add new actions immediately above this line. Make sure to update | 42 // NOTE: Add new actions immediately above this line. Make sure to update |
| 41 // the enum list in tools/metrics/histograms/histograms.xml accordingly. | 43 // the enum list in tools/metrics/histograms/histograms.xml accordingly. |
| 42 COUNT | 44 COUNT |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 // There should be a call to this function for every call to the Web Bluetooth | 47 // There should be a call to this function for every call to the Web Bluetooth |
| 46 // API. | 48 // API. |
| 47 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); | 49 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); |
| 48 | 50 |
| 49 // Enumeration for outcomes of querying the bluetooth cache. | 51 // Enumeration for outcomes of querying the bluetooth cache. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 180 |
| 179 enum class UMAGetCharacteristicOutcome { | 181 enum class UMAGetCharacteristicOutcome { |
| 180 SUCCESS = 0, | 182 SUCCESS = 0, |
| 181 NO_DEVICE = 1, | 183 NO_DEVICE = 1, |
| 182 NO_SERVICE = 2, | 184 NO_SERVICE = 2, |
| 183 NOT_FOUND = 3, | 185 NOT_FOUND = 3, |
| 184 BLOCKLISTED = 4, | 186 BLOCKLISTED = 4, |
| 185 NO_CHARACTERISTICS = 5, | 187 NO_CHARACTERISTICS = 5, |
| 186 // Note: Add new outcomes immediately above this line. | 188 // Note: Add new outcomes immediately above this line. |
| 187 // Make sure to update the enum list in | 189 // Make sure to update the enum list in |
| 188 // tools/metrisc/histogram/histograms.xml accordingly. | 190 // tools/metrics/histogram/histograms.xml accordingly. |
| 189 COUNT | 191 COUNT |
| 190 }; | 192 }; |
| 191 | 193 |
| 194 enum class UMAGetDescriptorOutcome { |
| 195 SUCCESS = 0, |
| 196 NO_DEVICE = 1, |
| 197 NO_SERVICE = 2, |
| 198 NO_CHARACTERISTIC = 3, |
| 199 NOT_FOUND = 4, |
| 200 BLOCKLISTED = 5, |
| 201 NO_DESCRIPTORS = 6, |
| 202 // Note: Add new outcomes immediately above this line. |
| 203 // Make sure to update the enum list in |
| 204 // tools/metrics/histogram/histograms.xml accordingly. |
| 205 COUNT |
| 206 }; |
| 207 |
| 192 // There should be a call to this function whenever | 208 // There should be a call to this function whenever |
| 193 // RemoteServiceGetCharacteristicsCallback is run. | 209 // RemoteServiceGetCharacteristicsCallback is run. |
| 194 // Pass blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE for | 210 // Pass blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE for |
| 195 // getCharacteristic. | 211 // getCharacteristic. |
| 196 // Pass blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE for | 212 // Pass blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE for |
| 197 // getCharacteristics. | 213 // getCharacteristics. |
| 198 void RecordGetCharacteristicsOutcome( | 214 void RecordGetCharacteristicsOutcome( |
| 199 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 215 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 200 UMAGetCharacteristicOutcome outcome); | 216 UMAGetCharacteristicOutcome outcome); |
| 201 | 217 |
| 202 // Records the outcome of the cache query for getCharacteristics. Should only be | 218 // Records the outcome of the cache query for getCharacteristics. Should only be |
| 203 // called if QueryCacheForService fails. | 219 // called if QueryCacheForService fails. |
| 204 void RecordGetCharacteristicsOutcome( | 220 void RecordGetCharacteristicsOutcome( |
| 205 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 221 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 206 CacheQueryOutcome outcome); | 222 CacheQueryOutcome outcome); |
| 207 | 223 |
| 208 // Records the UUID of the characteristic used when calling getCharacteristic. | 224 // Records the UUID of the characteristic used when calling getCharacteristic. |
| 209 void RecordGetCharacteristicsCharacteristic( | 225 void RecordGetCharacteristicsCharacteristic( |
| 210 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 226 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 211 const base::Optional<device::BluetoothUUID>& characteristic); | 227 const base::Optional<device::BluetoothUUID>& characteristic); |
| 212 | 228 |
| 229 // There should be a call to this function whenever |
| 230 // RemoteServiceGetDescriptorsCallback is run. |
| 231 // Pass blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE for |
| 232 // getDescriptor. |
| 233 // Pass blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE for |
| 234 // getDescriptors. |
| 235 void RecordGetDescriptorsOutcome( |
| 236 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 237 UMAGetDescriptorOutcome outcome); |
| 238 |
| 239 // Records the outcome of the cache query for getDescriptors. Should only be |
| 240 // called if QueryCacheForService fails. |
| 241 void RecordGetDescriptorsOutcome( |
| 242 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 243 CacheQueryOutcome outcome); |
| 244 |
| 245 // Records the UUID of the descriptor used when calling getDescriptor. |
| 246 void RecordGetDescriptorsDescriptor( |
| 247 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 248 const base::Optional<device::BluetoothUUID>& descriptor); |
| 249 |
| 213 // GATT Operations Metrics | 250 // GATT Operations Metrics |
| 214 | 251 |
| 215 // These are the possible outcomes when performing GATT operations i.e. | 252 // These are the possible outcomes when performing GATT operations i.e. |
| 216 // characteristic.readValue/writeValue descriptor.readValue/writeValue. | 253 // characteristic.readValue/writeValue descriptor.readValue/writeValue. |
| 217 enum UMAGATTOperationOutcome { | 254 enum UMAGATTOperationOutcome { |
| 218 SUCCESS = 0, | 255 SUCCESS = 0, |
| 219 NO_DEVICE = 1, | 256 NO_DEVICE = 1, |
| 220 NO_SERVICE = 2, | 257 NO_SERVICE = 2, |
| 221 NO_CHARACTERISTIC = 3, | 258 NO_CHARACTERISTIC = 3, |
| 222 NO_DESCRIPTOR = 4, | 259 NO_DESCRIPTOR = 4, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level); | 357 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level); |
| 321 | 358 |
| 322 // In the case of not accepting all devices in the options that are given | 359 // In the case of not accepting all devices in the options that are given |
| 323 // to WebBluetooth requestDevice(), records the number of devices in the | 360 // to WebBluetooth requestDevice(), records the number of devices in the |
| 324 // chooser when a device is paired. | 361 // chooser when a device is paired. |
| 325 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices); | 362 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices); |
| 326 | 363 |
| 327 } // namespace content | 364 } // namespace content |
| 328 | 365 |
| 329 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 366 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
| OLD | NEW |