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

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: Clean up 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // There should be a call to this function for every call to 159 // There should be a call to this function for every call to
159 // Send(BluetoothMsg_GetCharacteristicSuccess) and 160 // Send(BluetoothMsg_GetCharacteristicSuccess) and
160 // Send(BluetoothMsg_GetCharacteristicError). 161 // Send(BluetoothMsg_GetCharacteristicError).
161 void RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome outcome); 162 void RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome outcome);
162 // Records the outcome of the cache query for getCharacteristic. Should only be 163 // Records the outcome of the cache query for getCharacteristic. Should only be
163 // called if QueryCacheForService fails. 164 // called if QueryCacheForService fails.
164 void RecordGetCharacteristicOutcome(CacheQueryOutcome outcome); 165 void RecordGetCharacteristicOutcome(CacheQueryOutcome outcome);
165 // Records the UUID of the characteristic used when calling getCharacteristic. 166 // Records the UUID of the characteristic used when calling getCharacteristic.
166 void RecordGetCharacteristicCharacteristic(const std::string& characteristic); 167 void RecordGetCharacteristicCharacteristic(const std::string& characteristic);
167 168
169 // getCharacteristics() Metrics
170 // There should be a call to this function for every call to
171 // Send(BluetoothMsg_GetCharacteristicsSuccess) and
172 // Send(BluetoothMsg_GetCharacteristicsError).
173 void RecordGetCharacteristicsOutcome(UMAGetCharacteristicOutcome outcome);
174 // Records the outcome of the cache query for getCharacteristics. Should only be
175 // called if QueryCacheForService fails.
176 void RecordGetCharacteristicsOutcome(CacheQueryOutcome outcome);
177 // Records the UUID of the characteristic used when calling getCharacteristic.
178 void RecordGetCharacteristicsCharacteristic(const std::string& characteristic);
179
168 // GATT Operations Metrics 180 // GATT Operations Metrics
169 181
170 // These are the possible outcomes when performing GATT operations i.e. 182 // These are the possible outcomes when performing GATT operations i.e.
171 // characteristic.readValue/writeValue descriptor.readValue/writeValue. 183 // characteristic.readValue/writeValue descriptor.readValue/writeValue.
172 enum UMAGATTOperationOutcome { 184 enum UMAGATTOperationOutcome {
173 SUCCESS = 0, 185 SUCCESS = 0,
174 NO_DEVICE = 1, 186 NO_DEVICE = 1,
175 NO_SERVICE = 2, 187 NO_SERVICE = 2,
176 NO_CHARACTERISTIC = 3, 188 NO_CHARACTERISTIC = 3,
177 NO_DESCRIPTOR = 4, 189 NO_DESCRIPTOR = 4,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // Send(BluetoothMsg_StartNotificationsSuccess) and 238 // Send(BluetoothMsg_StartNotificationsSuccess) and
227 // Send(BluetoothMsg_StopNotificationsError). 239 // Send(BluetoothMsg_StopNotificationsError).
228 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome); 240 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome);
229 // Records the outcome of a cache query for startNotifications. Should only be 241 // Records the outcome of a cache query for startNotifications. Should only be
230 // called if QueryCacheForCharacteristic fails. 242 // called if QueryCacheForCharacteristic fails.
231 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome); 243 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome);
232 244
233 } // namespace content 245 } // namespace content
234 246
235 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ 247 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698