Chromium Code Reviews| Index: third_party/WebKit/Source/modules/bluetooth/BluetoothMetrics.h |
| diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothMetrics.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothMetrics.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..09c4f7cd9e1a4a8e56051ad9a02c8c314dbd2845 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothMetrics.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BluetoothMetrics_h |
| +#define BluetoothMetrics_h |
| + |
| +namespace blink { |
| + |
| +// Enumeration of each Web Bluetooth API entry point. |
| +enum class UMAWebBluetoothFunction { |
| + REQUEST_DEVICE = 0, |
| + CONNECT_GATT = 1, |
| + GET_PRIMARY_SERVICE = 2, |
| + SERVICE_GET_CHARACTERISTIC = 3, |
| + CHARACTERISTIC_READ_VALUE = 4, |
| + CHARACTERISTIC_WRITE_VALUE = 5, |
| + CHARACTERISTIC_START_NOTIFICATIONS = 6, |
| + CHARACTERISTIC_STOP_NOTIFICATIONS = 7, |
| + REMOTE_GATT_SERVER_DISCONNECT = 8, |
| + SERVICE_GET_CHARACTERISTICS = 9, |
| + GET_PRIMARY_SERVICES = 10, |
| + DESCRIPTOR_READ_VALUE = 11, |
| + DESCRIPTOR_WRITE_VALUE = 12, |
| + CHARACTERISTIC_GET_DESCRIPTOR = 13, |
| + CHARACTERISTIC_GET_DESCRIPTORS = 14, |
| + // NOTE: Add new actions immediately above this line. Make sure to update |
| + // the enum list in tools/metrics/histograms/histograms.xml accordingly. |
| + COUNT |
| +}; |
| + |
| +// There should be a call to this function for every call to the Web Bluetooth |
| +// API. |
| +void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction); |
|
haraken
2017/03/23 23:36:34
Nit: We normally create a static class.
class Blu
juncai
2017/03/27 19:08:57
Done.
|
| + |
| +} // namespace blink |
| + |
| +#endif // BluetoothMetrics_h |