Bug 1646266 - Marker option: MarkerInnerWindowId - r=gregtatum

This option can take an inner window id.

Differential Revision: https://phabricator.services.mozilla.com/D87248
This commit is contained in:
Gerald Squelart 2020-08-31 23:31:36 +00:00
parent aee45f966e
commit fd497a7bf1

View File

@ -535,6 +535,27 @@ class MarkerStack {
ProfileChunkedBuffer* mChunkedBuffer = nullptr;
};
// This marker option captures a given inner window id.
class MarkerInnerWindowId {
public:
// Default constructor, it leaves the id unspecified.
constexpr MarkerInnerWindowId() = default;
// Constructor with a specified inner window id.
constexpr explicit MarkerInnerWindowId(uint64_t i) : mInnerWindowId(i) {}
// Explicit option with unspecified id.
constexpr static MarkerInnerWindowId NoId() { return MarkerInnerWindowId{}; }
[[nodiscard]] bool IsUnspecified() const { return mInnerWindowId == scNoId; }
[[nodiscard]] constexpr uint64_t Id() const { return mInnerWindowId; }
private:
static constexpr uint64_t scNoId = 0;
uint64_t mInnerWindowId = scNoId;
};
} // namespace mozilla
#endif // MOZ_GECKO_PROFILER