Files
tubestation/toolkit/components/perfmonitoring/PerformanceUtils.h
Tarek Ziadé ff711b57c6 Bug 1447768 - part 1 - Add PerformanceUtils helpers - r=baku
This new module simplifies how we interact with PerformanceInfo counters:

- CollectPerformanceInfo: returns all PerformanceInfo instances
- NotifyPerformanceInfo: converts PerformanceInfo in XPCOM and notify them

MozReview-Commit-ID: JedKEtsbQTF
2018-04-04 10:12:02 +02:00

27 lines
881 B
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef PerformanceCollector_h
#define PerformanceCollector_h
#include "mozilla/dom/DOMTypes.h" // defines PerformanceInfo
namespace mozilla {
/**
* Collects all performance info in the current process
* and adds then in the aMetrics arrey
*/
void CollectPerformanceInfo(nsTArray<dom::PerformanceInfo>& aMetrics);
/**
* Converts a PerformanceInfo array into a nsIPerformanceMetricsData and
* sends a performance-metrics notification with it
*/
nsresult NotifyPerformanceInfo(const nsTArray<dom::PerformanceInfo>& aMetrics);
} // namespace mozilla
#endif // PerformanceCollector_h