1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* Tools for collecting and reporting layout and style telemetry */
9 #ifndef mozilla_LayoutTelemetryTools_h
10 #define mozilla_LayoutTelemetryTools_h
12 #include "mozilla/TimeStamp.h"
14 #define LAYOUT_TELEMETRY_RECORD(subsystem) \
15 mozilla::layout_telemetry::AutoRecord a( \
16 mozilla::layout_telemetry::LayoutSubsystem::subsystem)
18 namespace mozilla::layout_telemetry
{
20 // Send the current per-tick telemetry.
21 void PingPerTickTelemetry();
23 enum class LayoutSubsystem
: uint8_t {
35 explicit AutoRecord(LayoutSubsystem aSubsystem
);
39 AutoRecord
* const mParentRecord
;
40 const LayoutSubsystem mSubsystem
;
42 double mDurationMs
= 0.0;
45 } // namespace mozilla::layout_telemetry
47 #endif // !mozilla_LayoutTelemetryTools_h