// AUTOGENERATED BY glean_parser. DO NOT EDIT.
/* 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
#ifndef mozilla_GleanMiniwindowMetrics_h
#define mozilla_GleanMiniwindowMetrics_h
#include "mozilla/glean/bindings/MetricTypes.h"
namespace mozilla::glean {
namespace mini_window {
/**
* generated from mini_window.closed
*/
struct ClosedExtra {
mozilla::Maybe<uint32_t> durationMs;
mozilla::Maybe<nsCString> method;
mozilla::Maybe<nsCString> type;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (durationMs) {
extraKeys.AppendElement()->AssignASCII("duration_ms");
extraValues.AppendElement()->AppendInt(durationMs.value());
}
if (method) {
extraKeys.AppendElement()->AssignASCII("method");
extraValues.EmplaceBack(method.value());
}
if (type) {
extraKeys.AppendElement()->AssignASCII("type");
extraValues.EmplaceBack(type.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when a mini window closes, whichever way it was ended.
*/
constexpr impl::EventMetric<ClosedExtra> closed(701);
/**
* generated from mini_window.created
*/
struct CreatedExtra {
mozilla::Maybe<uint32_t> concurrentOpen;
mozilla::Maybe<nsCString> entryPoint;
mozilla::Maybe<nsCString> type;
mozilla::Maybe<bool> wasLastTab;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (concurrentOpen) {
extraKeys.AppendElement()->AssignASCII("concurrent_open");
extraValues.AppendElement()->AppendInt(concurrentOpen.value());
}
if (entryPoint) {
extraKeys.AppendElement()->AssignASCII("entry_point");
extraValues.EmplaceBack(entryPoint.value());
}
if (type) {
extraKeys.AppendElement()->AssignASCII("type");
extraValues.EmplaceBack(type.value());
}
if (wasLastTab) {
extraKeys.AppendElement()->AssignASCII("was_last_tab");
extraValues.AppendElement()->AssignASCII(wasLastTab.value() ? "true" : "false");
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when a mini window is created, after the tab has been moved into it. A failed move is not recorded.
*/
constexpr impl::EventMetric<CreatedExtra> created(702);
/**
* generated from mini_window.open_duration
*/
enum class OpenDurationLabel: uint16_t {
eFullTab = 0,
eFragment = 1,
e__Other__,
};
/**
* How long a mini window stayed open, split by which flavour it was.
*/
constexpr impl::Labeled<impl::TimingDistributionMetric, OpenDurationLabel> open_duration(703);
}
} // namespace mozilla::glean
#endif // mozilla_GleanMiniwindowMetrics_h