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

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

Issue 1334763002: bluetooth: Subscribe to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Fix global interface test Created 5 years, 2 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 11 matching lines...) Expand all
22 // General Metrics 22 // General Metrics
23 23
24 // Enumaration of each Web Bluetooth API entry point. 24 // Enumaration of each Web Bluetooth API entry point.
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,
33 CHARACTERISTIC_STOP_NOTIFICATIONS = 7,
32 // NOTE: Add new actions immediately above this line. Make sure to update 34 // NOTE: Add new actions immediately above this line. Make sure to update
33 // the enum list in tools/metrics/histograms/histograms.xml accordingly. 35 // the enum list in tools/metrics/histograms/histograms.xml accordingly.
34 COUNT 36 COUNT
35 }; 37 };
36 38
37 // There should be a call to this function for every call to the Web Bluetooth 39 // There should be a call to this function for every call to the Web Bluetooth
38 // API. 40 // API.
39 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function); 41 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function);
40 42
41 // requestDevice() Metrics 43 // requestDevice() Metrics
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 NOT_SUPPORTED = 12, 154 NOT_SUPPORTED = 12,
153 // Note: Add new GATT Outcomes immediately above this line. 155 // Note: Add new GATT Outcomes immediately above this line.
154 // Make sure to update the enum list in 156 // Make sure to update the enum list in
155 // tools/metrics/histograms/histograms.xml accordingly. 157 // tools/metrics/histograms/histograms.xml accordingly.
156 COUNT 158 COUNT
157 }; 159 };
158 160
159 enum class UMAGATTOperation { 161 enum class UMAGATTOperation {
160 CHARACTERISTIC_READ, 162 CHARACTERISTIC_READ,
161 CHARACTERISTIC_WRITE, 163 CHARACTERISTIC_WRITE,
164 START_NOTIFICATIONS,
162 // Note: Add new GATT Operations immediately above this line. 165 // Note: Add new GATT Operations immediately above this line.
163 COUNT 166 COUNT
164 }; 167 };
165 168
166 // Records the outcome of a GATT operation. 169 // Records the outcome of a GATT operation.
167 // There should be a call to this function whenever the corresponding operation 170 // There should be a call to this function whenever the corresponding operation
168 // doesn't have a call to Record[Operation]Outcome. 171 // doesn't have a call to Record[Operation]Outcome.
169 void RecordGATTOperationOutcome(UMAGATTOperation operation, 172 void RecordGATTOperationOutcome(UMAGATTOperation operation,
170 UMAGATTOperationOutcome outcome); 173 UMAGATTOperationOutcome outcome);
171 174
172 // Characteristic.readValue() Metrics 175 // Characteristic.readValue() Metrics
173 // There should be a call to this function for every call to 176 // There should be a call to this function for every call to
174 // Send(BluetoothMsg_ReadCharacteristicValueSuccess) and 177 // Send(BluetoothMsg_ReadCharacteristicValueSuccess) and
175 // Send(BluetoothMsg_ReadCharacteristicValueError). 178 // Send(BluetoothMsg_ReadCharacteristicValueError).
176 void RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome error); 179 void RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome error);
177 180
178 // Characteristic.writeValue() Metrics 181 // Characteristic.writeValue() Metrics
179 // There should be a call to this function for every call to 182 // There should be a call to this function for every call to
180 // Send(BluetoothMsg_WriteCharacteristicValueSuccess) and 183 // Send(BluetoothMsg_WriteCharacteristicValueSuccess) and
181 // Send(BluetoothMsg_WriteCharacteristicValueError). 184 // Send(BluetoothMsg_WriteCharacteristicValueError).
182 void RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome error); 185 void RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome error);
183 186
187 // Characteristic.startNotifications() Metrics
188 // There should be a call to this function for every call to
189 // Send(BluetoothMsg_StartNotificationsSuccess) and
190 // Send(BluetoothMsg_StopNotificationsError).
191 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome);
192
184 } // namespace content 193 } // namespace content
185 194
186 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ 195 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_
OLDNEW
« no previous file with comments | « content/browser/bluetooth/bluetooth_dispatcher_host.cc ('k') | content/browser/bluetooth/bluetooth_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698