UseCounterMetrics.h (1391B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #ifndef UseCounterMetrics_h_ 7 #define UseCounterMetrics_h_ 8 9 #include "stdint.h" 10 11 namespace mozilla { 12 enum UseCounter : int16_t; 13 enum class UseCounterWorker : int16_t; 14 15 namespace dom { 16 enum WorkerKind : uint8_t; 17 18 /** 19 * Increments the metric associated with the specific use counter. 20 * 21 * @param aUseCounter - The use counter for the feature that was used. 22 * @param aIsPage - Whether we should record to the page or document metric. 23 * @returns The name of the metric that was incremented, or "". 24 */ 25 const char* IncrementUseCounter(UseCounter aUseCounter, bool aIsPage); 26 27 /** 28 * Increments the metric associated with the specific worker use counter. 29 * 30 * @param aUseCounter - The use counter for the feature that was used. 31 * @param aKind - The kind of worker that triggered the use counter. 32 * @returns The name of the metric that was incremented, or "". 33 */ 34 const char* IncrementWorkerUseCounter(UseCounterWorker aUseCounter, 35 WorkerKind aKind); 36 37 } // namespace dom 38 } // namespace mozilla 39 40 #endif // UseCounterMetrics_h_