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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 enum class UMAGetPrimaryServiceOutcome { | 132 enum class UMAGetPrimaryServiceOutcome { |
133 SUCCESS = 0, | 133 SUCCESS = 0, |
134 NO_DEVICE = 1, | 134 NO_DEVICE = 1, |
135 NOT_FOUND = 2, | 135 NOT_FOUND = 2, |
136 // Note: Add new GetPrimaryService outcomes immediately above this line. | 136 // Note: Add new GetPrimaryService outcomes immediately above this line. |
137 // Make sure to update the enum list in | 137 // Make sure to update the enum list in |
138 // tools/metrics/histograms/histograms.xml accordingly. | 138 // tools/metrics/histograms/histograms.xml accordingly. |
139 COUNT | 139 COUNT |
140 }; | 140 }; |
141 // Record the service uuid used when calling getPrimaryService. | 141 // Record the service uuid used when calling getPrimaryService. |
142 void RecordGetPrimaryServiceService(const device::BluetoothUUID& service); | 142 void RecordGetPrimaryServiceService( |
| 143 const std::unique_ptr<device::BluetoothUUID>& service); |
143 // There should be a call to this function for every call to | 144 // There should be a call to this function for every call to |
144 // Send(BluetoothMsg_GetPrimaryServiceSuccess) and | 145 // Send(BluetoothMsg_GetPrimaryServiceSuccess) and |
145 // Send(BluetoothMsg_GetPrimaryServiceError). | 146 // Send(BluetoothMsg_GetPrimaryServiceError). |
146 void RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome outcome); | 147 void RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome outcome); |
147 // Records the outcome of the cache query for getPrimaryService. Should only be | 148 // Records the outcome of the cache query for getPrimaryService. Should only be |
148 // called if QueryCacheForDevice fails. | 149 // called if QueryCacheForDevice fails. |
149 void RecordGetPrimaryServiceOutcome(CacheQueryOutcome outcome); | 150 void RecordGetPrimaryServiceOutcome(CacheQueryOutcome outcome); |
150 | 151 |
151 // getCharacteristic() and getCharacteristics() Metrics | 152 // getCharacteristic() and getCharacteristics() Metrics |
152 enum class UMAGetCharacteristicOutcome { | 153 enum class UMAGetCharacteristicOutcome { |
(...skipping 19 matching lines...) Expand all Loading... |
172 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 173 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
173 UMAGetCharacteristicOutcome outcome); | 174 UMAGetCharacteristicOutcome outcome); |
174 // Records the outcome of the cache query for getCharacteristics. Should only be | 175 // Records the outcome of the cache query for getCharacteristics. Should only be |
175 // called if QueryCacheForService fails. | 176 // called if QueryCacheForService fails. |
176 void RecordGetCharacteristicsOutcome( | 177 void RecordGetCharacteristicsOutcome( |
177 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 178 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
178 CacheQueryOutcome outcome); | 179 CacheQueryOutcome outcome); |
179 // Records the UUID of the characteristic used when calling getCharacteristic. | 180 // Records the UUID of the characteristic used when calling getCharacteristic. |
180 void RecordGetCharacteristicsCharacteristic( | 181 void RecordGetCharacteristicsCharacteristic( |
181 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 182 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
182 const std::string& characteristic); | 183 const std::unique_ptr<device::BluetoothUUID>& characteristic); |
183 | 184 |
184 // GATT Operations Metrics | 185 // GATT Operations Metrics |
185 | 186 |
186 // These are the possible outcomes when performing GATT operations i.e. | 187 // These are the possible outcomes when performing GATT operations i.e. |
187 // characteristic.readValue/writeValue descriptor.readValue/writeValue. | 188 // characteristic.readValue/writeValue descriptor.readValue/writeValue. |
188 enum UMAGATTOperationOutcome { | 189 enum UMAGATTOperationOutcome { |
189 SUCCESS = 0, | 190 SUCCESS = 0, |
190 NO_DEVICE = 1, | 191 NO_DEVICE = 1, |
191 NO_SERVICE = 2, | 192 NO_SERVICE = 2, |
192 NO_CHARACTERISTIC = 3, | 193 NO_CHARACTERISTIC = 3, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // Send(BluetoothMsg_StartNotificationsSuccess) and | 244 // Send(BluetoothMsg_StartNotificationsSuccess) and |
244 // Send(BluetoothMsg_StopNotificationsError). | 245 // Send(BluetoothMsg_StopNotificationsError). |
245 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); | 246 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); |
246 // Records the outcome of a cache query for startNotifications. Should only be | 247 // Records the outcome of a cache query for startNotifications. Should only be |
247 // called if QueryCacheForCharacteristic fails. | 248 // called if QueryCacheForCharacteristic fails. |
248 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome); | 249 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome); |
249 | 250 |
250 } // namespace content | 251 } // namespace content |
251 | 252 |
252 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 253 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
OLD | NEW |