Bug 1903805 - Added additional allowed characters to search-config-icons-schema.json...
[gecko.git] / layout / base / LayoutTelemetryTools.h
blobeff5aad07cf3c570b7fbb646257dafee65a5833e
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 {
24 Restyle,
25 Reflow,
26 ReflowFlex,
27 ReflowGrid,
28 ReflowTable,
29 ReflowText,
30 Count
33 class AutoRecord {
34 public:
35 explicit AutoRecord(LayoutSubsystem aSubsystem);
36 ~AutoRecord();
38 private:
39 AutoRecord* const mParentRecord;
40 const LayoutSubsystem mSubsystem;
41 TimeStamp mStartTime;
42 double mDurationMs = 0.0;
45 } // namespace mozilla::layout_telemetry
47 #endif // !mozilla_LayoutTelemetryTools_h