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

Side by Side Diff: device/bluetooth/bluetooth_adapter_mac_metrics.h

Issue 2912633002: bluetooth: macOS: Adding histograms for NSError values (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_METRICS_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_METRICS_H_
7
8 @class NSError;
9
10 enum class WebBluetoothMacOSAPIs : int {
11 WEB_BLUETOOTH_MACOS_APIS_DID_FAIL_TO_CONNECT_TO_PERIPHERAL = 0,
ortuno 2017/05/31 06:59:52 Because this is an enum class we need to spell out
jlebel 2017/06/13 22:31:37 Done.
12 WEB_BLUETOOTH_MACOS_APIS_DID_DISCONNECT_PERIPHERAL,
13 WEB_BLUETOOTH_MACOS_APIS_DID_DISCOVER_PRIMARY_SERVICES,
14 WEB_BLUETOOTH_MACOS_APIS_DID_DISCOVER_CHARACTERISTICS,
15 WEB_BLUETOOTH_MACOS_APIS_DID_UPDATE_VALUE,
16 WEB_BLUETOOTH_MACOS_APIS_DID_WRITE_VALUE,
17 WEB_BLUETOOTH_MACOS_APIS_DID_UPDATE_NOTIFICATION_STATE,
18 WEB_BLUETOOTH_MACOS_APIS_DID_DISCOVER_DESCRIPTORS,
19 WEB_BLUETOOTH_MACOS_APIS_DID_UPDATE_VALUE_FOR_DESCRIPTOR,
20 WEB_BLUETOOTH_MACOS_APIS_DID_WRITE_VALUE_FOR_DESCRIPTOR,
21 };
22
23 enum class WebBluetoothMacOSErrors : int {
24 WEB_BLUETOOTH_MACOS_ERRORS_UNKNOWN_ERROR_DOMAIN = -1,
25 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_SUCCESS = 0,
ortuno 2017/05/31 06:59:52 Does this mean that we could get error != nil but
jlebel 2017/06/13 22:31:37 We are not supposed to receive it. This is when us
26 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INVALID_HANDLE = 1,
27 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_READ_NOT_PERMITTED = 2,
28 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_WRITE_NOT_PERMITTED = 3,
29 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INVALID_PDU = 4,
30 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INSUFFICIENT_AUTHENTICATION = 5,
31 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_REQUEST_NOT_SUPPORTED = 6,
32 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INVALID_OFFSET = 7,
33 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INSUFFICIENT_AUTHORIZATION = 8,
34 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_PREPARE_QUEUE_FULL = 9,
35 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_ATTRIBUTE_NOT_FOUND = 10,
36 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_ATTRIBUTE_NOT_LONG = 11,
37 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE = 12,
38 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INVALID_ATTRIBUTE_VALUE_LENGTH = 13,
39 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_UNLIKELY_ERROR = 14,
40 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INSUFFICIENT_ENCRYPTION = 15,
41 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_UNSUPPORTED_GROUP_TYPE = 16,
42 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_INSUFFICIENT_RESOURCES = 17,
43 WEB_BLUETOOTH_MACOS_ERRORS_CBATT_ERROR_MAX = 999,
44 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_UNKNOWN = 1000,
ortuno 2017/05/31 06:59:52 Do CBErrors values overlap with CBATT errors? If s
jlebel 2017/06/13 22:31:37 What do you mean overlap? for the integer values?
ortuno 2017/06/14 03:46:28 Yes, do the integer values overlap?
jlebel 2017/06/19 07:07:49 Yes, they do. They both start at 0 and increment.
45 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_INVALID_PARAMETERS = 1001,
46 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_INVALID_HANDLE = 1002,
47 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_NOT_CONNECTED = 1003,
48 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_OUT_OF_SPACE = 1004,
49 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_OPERATION_CANCELLED = 1005,
50 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_CONNECTION_TIMEOUT = 1005,
51 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_PERIPHERAL_DISCONNECTED = 1007,
52 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_UUID_NOT_ALLOWED = 1008,
53 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_ALREADY_ADVERTISING = 1010,
54 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_MAX_CONNECTION = 1011,
55 WEB_BLUETOOTH_MACOS_ERRORS_CBERROR_MAX = 1999,
56 WEB_BLUETOOTH_MACOS_ERRORS_MAX,
57 };
58
59 void LogNSErrorToHistogram(NSError* error,
60 WebBluetoothMacOSAPIs web_bluetooth_macos_apis);
61
62 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_MAC_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698