1 /* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_widget_Telemetry_h__
7 #define mozilla_widget_Telemetry_h__
9 #include "mozilla/java/TelemetryUtilsNatives.h"
10 #include "nsAppShell.h"
11 #include "nsIAndroidBridge.h"
13 #include "mozilla/TimeStamp.h"
14 #include "mozilla/glean/GleanMetrics.h"
19 class Telemetry final
: public java::TelemetryUtils::Natives
<Telemetry
> {
23 static void AddHistogram(jni::String::Param aName
, int32_t aValue
) {
25 nsCString name
= aName
->ToCString();
26 if (name
.EqualsLiteral("GV_STARTUP_RUNTIME_MS")) {
27 glean::geckoview::startup_runtime
.AccumulateRawDuration(
28 TimeDuration::FromMilliseconds(aValue
));
29 } else if (name
.EqualsLiteral("GV_CONTENT_PROCESS_LIFETIME_MS")) {
30 glean::geckoview::content_process_lifetime
.AccumulateRawDuration(
31 TimeDuration::FromMilliseconds(aValue
));
37 } // namespace mozilla
39 #endif // mozilla_widget_Telemetry_h__