Bug 1646266 - NoPayload default type, with specialized empty helper - r=gregtatum

`NoPayload` will be mostly used internally when adding markers without payload data.
It has an empty specialization of the MarkerTypeHelper (mainly to catch misuses), and the add-marker code will need to have different compile-time paths to handle it.

Differential Revision: https://phabricator.services.mozilla.com/D87252
This commit is contained in:
Gerald Squelart 2020-08-31 23:33:07 +00:00
parent 54c35aa7f1
commit 95eb9ec051
3 changed files with 21 additions and 0 deletions

View File

@ -93,6 +93,11 @@ struct MarkerTypeSerialization {
std::tuple_element_t<i, StreamFunctionUserParametersTuple>;
};
template <>
struct MarkerTypeSerialization<::mozilla::baseprofiler::markers::NoPayload> {
// Nothing! NoPayload has special handling avoiding payload work.
};
} // namespace mozilla::base_profiler_markers_detail
namespace mozilla {

View File

@ -633,6 +633,14 @@ MarkerOptions MarkerCategory::WithOptions(Options&&... aOptions) const {
} // namespace mozilla
namespace mozilla::baseprofiler::markers {
// Default marker payload types, with no extra information, not even a marker
// type and payload. This is intended for label-only markers.
struct NoPayload final {};
} // namespace mozilla::baseprofiler::markers
#endif // MOZ_GECKO_PROFILER
#endif // BaseProfilerMarkersPrerequisites_h

View File

@ -17,6 +17,14 @@
#ifdef MOZ_GECKO_PROFILER
namespace profilermarkers {
// Default marker payload types, with no extra information, not even a marker
// type and payload. This is intended for label-only markers.
using NoPayload = ::mozilla::baseprofiler::markers::NoPayload;
} // namespace profilermarkers
#endif // MOZ_GECKO_PROFILER
#endif // ProfilerMarkersPrerequisites_h