diff --git a/tools/profiler/core/ProfilerMarkerPayload.cpp b/tools/profiler/core/ProfilerMarkerPayload.cpp index 909f0b419250..755460bc9095 100644 --- a/tools/profiler/core/ProfilerMarkerPayload.cpp +++ b/tools/profiler/core/ProfilerMarkerPayload.cpp @@ -816,6 +816,32 @@ void GCSliceMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter, } } +ProfileBufferEntryWriter::Length BudgetMarkerPayload::TagAndSerializationBytes() + const { + return CommonPropsTagAndSerializationBytes(); +} + +void BudgetMarkerPayload::SerializeTagAndPayload( + ProfileBufferEntryWriter& aEntryWriter) const { + static const DeserializerTag tag = TagForDeserializer(Deserialize); + SerializeTagAndCommonProps(tag, aEntryWriter); +} + +// static +UniquePtr BudgetMarkerPayload::Deserialize( + ProfileBufferEntryReader& aEntryReader) { + ProfilerMarkerPayload::CommonProps props = + DeserializeCommonProps(aEntryReader); + return UniquePtr( + new BudgetMarkerPayload(std::move(props))); +} + +void BudgetMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter, + const TimeStamp& aProcessStartTime, + UniqueStacks& aUniqueStacks) const { + StreamCommonProps("Budget", aWriter, aProcessStartTime, aUniqueStacks); +} + ProfileBufferEntryWriter::Length GCMajorMarkerPayload::TagAndSerializationBytes() const { return CommonPropsTagAndSerializationBytes() + diff --git a/tools/profiler/public/ProfilerMarkerPayload.h b/tools/profiler/public/ProfilerMarkerPayload.h index 5b5a6a0fcf96..089bc30c6631 100644 --- a/tools/profiler/public/ProfilerMarkerPayload.h +++ b/tools/profiler/public/ProfilerMarkerPayload.h @@ -228,6 +228,19 @@ class TracingMarkerPayload : public ProfilerMarkerPayload { TracingKind mKind; }; +class BudgetMarkerPayload : public ProfilerMarkerPayload { + public: + BudgetMarkerPayload(const mozilla::TimeStamp& aStartTime, + const mozilla::TimeStamp& aEndTime) + : ProfilerMarkerPayload(aStartTime, aEndTime) {} + + DECL_STREAM_PAYLOAD + + private: + explicit BudgetMarkerPayload(CommonProps&& aCommonProps) + : ProfilerMarkerPayload(std::move(aCommonProps)) {} +}; + class FileIOMarkerPayload : public ProfilerMarkerPayload { public: FileIOMarkerPayload(