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

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

Issue 1723723002: bluetooth: Implement Service.getCharacteristics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address jyasskin's comments and add moar tests Created 4 years, 10 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
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 14 matching lines...) Expand all
25 enum class UMAWebBluetoothFunction { 25 enum class UMAWebBluetoothFunction {
26 REQUEST_DEVICE = 0, 26 REQUEST_DEVICE = 0,
27 CONNECT_GATT = 1, 27 CONNECT_GATT = 1,
28 GET_PRIMARY_SERVICE = 2, 28 GET_PRIMARY_SERVICE = 2,
29 GET_CHARACTERISTIC = 3, 29 GET_CHARACTERISTIC = 3,
30 CHARACTERISTIC_READ_VALUE = 4, 30 CHARACTERISTIC_READ_VALUE = 4,
31 CHARACTERISTIC_WRITE_VALUE = 5, 31 CHARACTERISTIC_WRITE_VALUE = 5,
32 CHARACTERISTIC_START_NOTIFICATIONS = 6, 32 CHARACTERISTIC_START_NOTIFICATIONS = 6,
33 CHARACTERISTIC_STOP_NOTIFICATIONS = 7, 33 CHARACTERISTIC_STOP_NOTIFICATIONS = 7,
34 REMOTE_GATT_SERVER_DISCONNECT = 8, 34 REMOTE_GATT_SERVER_DISCONNECT = 8,
35 SERVICE_GET_CHARACTERISTICS = 9,
35 // NOTE: Add new actions immediately above this line. Make sure to update 36 // NOTE: Add new actions immediately above this line. Make sure to update
36 // the enum list in tools/metrics/histograms/histograms.xml accordingly. 37 // the enum list in tools/metrics/histograms/histograms.xml accordingly.
37 COUNT 38 COUNT
38 }; 39 };
39 40
40 // There should be a call to this function for every call to the Web Bluetooth 41 // There should be a call to this function for every call to the Web Bluetooth
41 // API. 42 // API.
42 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); 43 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function);
43 44
44 // Enumation for outcomes of querying the bluetooth cache. 45 // Enumation for outcomes of querying the bluetooth cache.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // called if QueryCacheForDevice fails. 145 // called if QueryCacheForDevice fails.
145 void RecordGetPrimaryServiceOutcome(CacheQueryOutcome outcome); 146 void RecordGetPrimaryServiceOutcome(CacheQueryOutcome outcome);
146 147
147 // getCharacteristic() Metrics 148 // getCharacteristic() Metrics
148 enum class UMAGetCharacteristicOutcome { 149 enum class UMAGetCharacteristicOutcome {
149 SUCCESS = 0, 150 SUCCESS = 0,
150 NO_DEVICE = 1, 151 NO_DEVICE = 1,
151 NO_SERVICE = 2, 152 NO_SERVICE = 2,
152 NOT_FOUND = 3, 153 NOT_FOUND = 3,
153 BLACKLISTED = 4, 154 BLACKLISTED = 4,
155 NO_CHARACTERISTICS = 5,
154 // Note: Add new outcomes immediately above this line. 156 // Note: Add new outcomes immediately above this line.
155 // Make sure to update the enum list in 157 // Make sure to update the enum list in
156 // tools/metrisc/histogram/histograms.xml accordingly. 158 // tools/metrisc/histogram/histograms.xml accordingly.
157 COUNT 159 COUNT
158 }; 160 };
159 // There should be a call to this function for every call to 161 // There should be a call to this function for every call to
160 // Send(BluetoothMsg_GetCharacteristicSuccess) and 162 // Send(BluetoothMsg_GetCharacteristicSuccess) and
161 // Send(BluetoothMsg_GetCharacteristicError). 163 // Send(BluetoothMsg_GetCharacteristicError).
162 void RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome outcome); 164 void RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome outcome);
163 // Records the outcome of the cache query for getCharacteristic. Should only be 165 // Records the outcome of the cache query for getCharacteristic. Should only be
164 // called if QueryCacheForService fails. 166 // called if QueryCacheForService fails.
165 void RecordGetCharacteristicOutcome(CacheQueryOutcome outcome); 167 void RecordGetCharacteristicOutcome(CacheQueryOutcome outcome);
166 // Records the UUID of the characteristic used when calling getCharacteristic. 168 // Records the UUID of the characteristic used when calling getCharacteristic.
167 void RecordGetCharacteristicCharacteristic(const std::string& characteristic); 169 void RecordGetCharacteristicCharacteristic(const std::string& characteristic);
168 170
171 // getCharacteristics() Metrics
172 // There should be a call to this function for every call to
173 // Send(BluetoothMsg_GetCharacteristicsSuccess) and
174 // Send(BluetoothMsg_GetCharacteristicsError).
175 void RecordGetCharacteristicsOutcome(UMAGetCharacteristicOutcome outcome);
176 // Records the outcome of the cache query for getCharacteristics. Should only be
177 // called if QueryCacheForService fails.
178 void RecordGetCharacteristicsOutcome(CacheQueryOutcome outcome);
179 // Records the UUID of the characteristic used when calling getCharacteristic.
180 void RecordGetCharacteristicsCharacteristic(const std::string& characteristic);
181
169 // GATT Operations Metrics 182 // GATT Operations Metrics
170 183
171 // These are the possible outcomes when performing GATT operations i.e. 184 // These are the possible outcomes when performing GATT operations i.e.
172 // characteristic.readValue/writeValue descriptor.readValue/writeValue. 185 // characteristic.readValue/writeValue descriptor.readValue/writeValue.
173 enum UMAGATTOperationOutcome { 186 enum UMAGATTOperationOutcome {
174 SUCCESS = 0, 187 SUCCESS = 0,
175 NO_DEVICE = 1, 188 NO_DEVICE = 1,
176 NO_SERVICE = 2, 189 NO_SERVICE = 2,
177 NO_CHARACTERISTIC = 3, 190 NO_CHARACTERISTIC = 3,
178 NO_DESCRIPTOR = 4, 191 NO_DESCRIPTOR = 4,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // Send(BluetoothMsg_StartNotificationsSuccess) and 240 // Send(BluetoothMsg_StartNotificationsSuccess) and
228 // Send(BluetoothMsg_StopNotificationsError). 241 // Send(BluetoothMsg_StopNotificationsError).
229 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); 242 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome);
230 // Records the outcome of a cache query for startNotifications. Should only be 243 // Records the outcome of a cache query for startNotifications. Should only be
231 // called if QueryCacheForCharacteristic fails. 244 // called if QueryCacheForCharacteristic fails.
232 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome); 245 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome);
233 246
234 } // namespace content 247 } // namespace content
235 248
236 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ 249 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698