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

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

Issue 2641173009: Add BluetoothRemoteGATTDescriptor reporting for .readValue(). (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_metrics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 17 matching lines...) Expand all
28 CONNECT_GATT = 1, 28 CONNECT_GATT = 1,
29 GET_PRIMARY_SERVICE = 2, 29 GET_PRIMARY_SERVICE = 2,
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 // NOTE: Add new actions immediately above this line. Make sure to update 39 // NOTE: Add new actions immediately above this line. Make sure to update
39 // the enum list in tools/metrics/histograms/histograms.xml accordingly. 40 // the enum list in tools/metrics/histograms/histograms.xml accordingly.
40 COUNT 41 COUNT
41 }; 42 };
42 43
43 // There should be a call to this function for every call to the Web Bluetooth 44 // There should be a call to this function for every call to the Web Bluetooth
44 // API. 45 // API.
45 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); 46 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function);
46 47
47 // Enumeration for outcomes of querying the bluetooth cache. 48 // Enumeration for outcomes of querying the bluetooth cache.
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // Characteristic.startNotifications() Metrics 272 // Characteristic.startNotifications() Metrics
272 // There should be a call to this function for every call to 273 // There should be a call to this function for every call to
273 // Send(BluetoothMsg_StartNotificationsSuccess) and 274 // Send(BluetoothMsg_StartNotificationsSuccess) and
274 // Send(BluetoothMsg_StopNotificationsError). 275 // Send(BluetoothMsg_StopNotificationsError).
275 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); 276 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome);
276 277
277 // Records the outcome of a cache query for startNotifications. Should only be 278 // Records the outcome of a cache query for startNotifications. Should only be
278 // called if QueryCacheForCharacteristic fails. 279 // called if QueryCacheForCharacteristic fails.
279 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome); 280 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome);
280 281
282 // Descriptor.readValue() Metrics
283 // There should be a call to this function for every call to
284 // Send(BluetoothMsg_ReadDescriptorValueSuccess) and
285 // Send(BluetoothMsg_ReadDescriptorValueError).
286 void RecordDescriptorReadValueOutcome(UMAGATTOperationOutcome error);
287
288 // Records the outcome of a cache query for readValue. Should only be called if
289 // QueryCacheForDescriptor fails.
290 void RecordDescriptorReadValueOutcome(CacheQueryOutcome outcome);
291
281 enum class UMARSSISignalStrengthLevel { 292 enum class UMARSSISignalStrengthLevel {
282 LESS_THAN_OR_EQUAL_TO_MIN_RSSI, 293 LESS_THAN_OR_EQUAL_TO_MIN_RSSI,
283 LEVEL_0, 294 LEVEL_0,
284 LEVEL_1, 295 LEVEL_1,
285 LEVEL_2, 296 LEVEL_2,
286 LEVEL_3, 297 LEVEL_3,
287 LEVEL_4, 298 LEVEL_4,
288 GREATER_THAN_OR_EQUAL_TO_MAX_RSSI, 299 GREATER_THAN_OR_EQUAL_TO_MAX_RSSI,
289 // Note: Add new RSSI signal strength level immediately above this line. 300 // Note: Add new RSSI signal strength level immediately above this line.
290 COUNT 301 COUNT
291 }; 302 };
292 303
293 // Records the raw RSSI, and processed result displayed to users, when 304 // Records the raw RSSI, and processed result displayed to users, when
294 // content::BluetoothDeviceChooserController::CalculateSignalStrengthLevel() is 305 // content::BluetoothDeviceChooserController::CalculateSignalStrengthLevel() is
295 // called. 306 // called.
296 void RecordRSSISignalStrength(int rssi); 307 void RecordRSSISignalStrength(int rssi);
297 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level); 308 void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level);
298 309
299 // In the case of not accepting all devices in the options that are given 310 // In the case of not accepting all devices in the options that are given
300 // to WebBluetooth requestDevice(), records the number of devices in the 311 // to WebBluetooth requestDevice(), records the number of devices in the
301 // chooser when a device is paired. 312 // chooser when a device is paired.
302 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices); 313 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices);
303 314
304 } // namespace content 315 } // namespace content
305 316
306 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ 317 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698