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-09-02 03:59:30 +00:00
Родитель e31033f92d
Коммит 092e6ca746
1 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -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