| 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 22 matching lines...) Expand all  Loading... | 
| 33   CHARACTERISTIC_STOP_NOTIFICATIONS = 7, | 33   CHARACTERISTIC_STOP_NOTIFICATIONS = 7, | 
| 34   // NOTE: Add new actions immediately above this line. Make sure to update | 34   // NOTE: Add new actions immediately above this line. Make sure to update | 
| 35   // the enum list in tools/metrics/histograms/histograms.xml accordingly. | 35   // the enum list in tools/metrics/histograms/histograms.xml accordingly. | 
| 36   COUNT | 36   COUNT | 
| 37 }; | 37 }; | 
| 38 | 38 | 
| 39 // There should be a call to this function for every call to the Web Bluetooth | 39 // There should be a call to this function for every call to the Web Bluetooth | 
| 40 // API. | 40 // API. | 
| 41 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); | 41 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); | 
| 42 | 42 | 
|  | 43 // Enumation for outcomes of querying the bluetooth cache. | 
|  | 44 enum class CacheQueryOutcome { | 
|  | 45   SUCCESS = 0, | 
|  | 46   NO_DEVICE = 1, | 
|  | 47   NO_SERVICE = 2, | 
|  | 48   NO_CHARACTERISTIC = 3, | 
|  | 49 }; | 
|  | 50 | 
|  | 51 // Record outcome for the function based on the cache query error. | 
|  | 52 void RecordOutcomeWithCacheQueryResult(UMAWebBluetoothFunction function, | 
|  | 53                                        CacheQueryOutcome outcome); | 
|  | 54 | 
| 43 // requestDevice() Metrics | 55 // requestDevice() Metrics | 
| 44 enum class UMARequestDeviceOutcome { | 56 enum class UMARequestDeviceOutcome { | 
| 45   SUCCESS = 0, | 57   SUCCESS = 0, | 
| 46   NO_BLUETOOTH_ADAPTER = 1, | 58   NO_BLUETOOTH_ADAPTER = 1, | 
| 47   NO_RENDER_FRAME = 2, | 59   NO_RENDER_FRAME = 2, | 
| 48   OBSOLETE_DISCOVERY_START_FAILED = 3, | 60   OBSOLETE_DISCOVERY_START_FAILED = 3, | 
| 49   OBSOLETE_DISCOVERY_STOP_FAILED = 4, | 61   OBSOLETE_DISCOVERY_STOP_FAILED = 4, | 
| 50   OBSOLETE_NO_MATCHING_DEVICES_FOUND = 5, | 62   OBSOLETE_NO_MATCHING_DEVICES_FOUND = 5, | 
| 51   BLUETOOTH_ADAPTER_NOT_PRESENT = 6, | 63   BLUETOOTH_ADAPTER_NOT_PRESENT = 6, | 
| 52   OBSOLETE_BLUETOOTH_ADAPTER_OFF = 7, | 64   OBSOLETE_BLUETOOTH_ADAPTER_OFF = 7, | 
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 186 | 198 | 
| 187 // Characteristic.startNotifications() Metrics | 199 // Characteristic.startNotifications() Metrics | 
| 188 // There should be a call to this function for every call to | 200 // There should be a call to this function for every call to | 
| 189 // Send(BluetoothMsg_StartNotificationsSuccess) and | 201 // Send(BluetoothMsg_StartNotificationsSuccess) and | 
| 190 // Send(BluetoothMsg_StopNotificationsError). | 202 // Send(BluetoothMsg_StopNotificationsError). | 
| 191 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); | 203 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); | 
| 192 | 204 | 
| 193 }  // namespace content | 205 }  // namespace content | 
| 194 | 206 | 
| 195 #endif  // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 207 #endif  // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 
| OLD | NEW | 
|---|