summaryrefslogtreecommitdiffstats
path: root/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h')
-rw-r--r--toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h
new file mode 100644
index 0000000000..e77ca95391
--- /dev/null
+++ b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 2; 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 TelemetryIPCAccumulator_h__
+#define TelemetryIPCAccumulator_h__
+
+#include "mozilla/AlreadyAddRefed.h"
+#include "mozilla/Maybe.h"
+#include "nsStringFwd.h"
+#include "mozilla/Telemetry.h" // for EventExtraEntry
+#include "mozilla/TelemetryComms.h" // for ScalarActionType, Scala...
+#include "mozilla/TelemetryHistogramEnums.h" // for HistogramID
+
+class nsIRunnable;
+class nsITimer;
+
+namespace mozilla {
+
+class TimeStamp;
+
+namespace TelemetryIPCAccumulator {
+
+// Histogram accumulation functions.
+void AccumulateChildHistogram(mozilla::Telemetry::HistogramID aId,
+ uint32_t aSample);
+void AccumulateChildKeyedHistogram(mozilla::Telemetry::HistogramID aId,
+ const nsCString& aKey, uint32_t aSample);
+
+// Scalar accumulation functions.
+void RecordChildScalarAction(uint32_t aId, bool aDynamic,
+ mozilla::Telemetry::ScalarActionType aAction,
+ const mozilla::Telemetry::ScalarVariant& aValue);
+
+void RecordChildKeyedScalarAction(
+ uint32_t aId, bool aDynamic, const nsAString& aKey,
+ mozilla::Telemetry::ScalarActionType aAction,
+ const mozilla::Telemetry::ScalarVariant& aValue);
+
+void RecordChildEvent(
+ const mozilla::TimeStamp& timestamp, const nsACString& category,
+ const nsACString& method, const nsACString& object,
+ const mozilla::Maybe<nsCString>& value,
+ const nsTArray<mozilla::Telemetry::EventExtraEntry>& extra);
+
+void IPCTimerFired(nsITimer* aTimer, void* aClosure);
+
+void DeInitializeGlobalState();
+
+void DispatchToMainThread(already_AddRefed<nsIRunnable>&& aEvent);
+
+} // namespace TelemetryIPCAccumulator
+} // namespace mozilla
+
+#endif // TelemetryIPCAccumulator_h__