Copy as Markdown

Other Tools

// -*- mode: C++ -*-
// 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
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_GleanTabnotesMetrics_h
#define mozilla_GleanTabnotesMetrics_h
#include "mozilla/glean/bindings/MetricTypes.h"
namespace mozilla::glean {
namespace tab_notes {
/**
* generated from tab_notes.added
*/
struct AddedExtra {
mozilla::Maybe<nsCString> source;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (source) {
extraKeys.AppendElement()->AssignASCII("source");
extraValues.EmplaceBack(source.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when a user creates a new note for a tab.
*/
constexpr impl::EventMetric<AddedExtra> added(1034);
/**
* generated from tab_notes.deleted
*/
struct DeletedExtra {
mozilla::Maybe<uint32_t> noteAgeHours;
mozilla::Maybe<nsCString> source;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (noteAgeHours) {
extraKeys.AppendElement()->AssignASCII("note_age_hours");
extraValues.AppendElement()->AppendInt(noteAgeHours.value());
}
if (source) {
extraKeys.AppendElement()->AssignASCII("source");
extraValues.EmplaceBack(source.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when a user deletes an existing note for a tab.
*/
constexpr impl::EventMetric<DeletedExtra> deleted(1035);
/**
* generated from tab_notes.edited
*/
struct EditedExtra {
mozilla::Maybe<nsCString> source;
std::tuple<nsTArray<nsCString>, nsTArray<nsCString>> ToFfiExtra() const {
nsTArray<nsCString> extraKeys;
nsTArray<nsCString> extraValues;
if (source) {
extraKeys.AppendElement()->AssignASCII("source");
extraValues.EmplaceBack(source.value());
}
return std::make_tuple(std::move(extraKeys), std::move(extraValues));
}
};
/**
* Recorded when a user edits an existing tab note.
*/
constexpr impl::EventMetric<EditedExtra> edited(1036);
}
} // namespace mozilla::glean
#endif // mozilla_GleanTabnotesMetrics_h