0

Forward-declare chrome_track_event.pbzero.h definitions in ui and viz.

These headers are very widely included, and this generated header is
enormous (about 18k LOC). This is estimated to trim about 1.4 GB off
Chrome's preprocessed source size (0.33%).

Bug: 40318405
Change-Id: I86abec3db39cb7989566bcf0fc266e89444813a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6266086
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420469}
This commit is contained in:
Jeremy Roman
2025-02-14 06:36:00 -08:00
committed by Chromium LUCI CQ
parent d103026519
commit f44cbeb741
5 changed files with 41 additions and 10 deletions

@ -8,6 +8,8 @@
#include <string_view>
#include "base/strings/stringprintf.h"
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_proto.h"
namespace viz {

@ -13,9 +13,15 @@
#include <string_view>
#include "base/hash/hash.h"
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "components/viz/common/viz_common_export.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_proto.h"
namespace perfetto {
template <typename MessageType>
class TracedProto;
namespace protos::pbzero {
class FrameSinkId;
}
} // namespace perfetto
namespace viz {

@ -9,6 +9,8 @@
#include "base/hash/hash.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_proto.h"
namespace viz {

@ -12,11 +12,17 @@
#include <limits>
#include <string>
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "base/unguessable_token.h"
#include "components/viz/common/viz_common_export.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_proto.h"
namespace perfetto {
template <typename MessageType>
class TracedProto;
namespace protos::pbzero {
class LocalSurfaceId;
}
} // namespace perfetto
namespace viz {
namespace mojom {

@ -10,10 +10,8 @@
#include "base/containers/flat_map.h"
#include "base/time/time.h"
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "build/blink_buildflags.h"
#include "build/build_config.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_latency_info.pbzero.h"
#if BUILDFLAG(USE_BLINK)
#include "ipc/ipc_param_traits.h" // nogncheck
@ -22,7 +20,24 @@
namespace perfetto {
class EventContext;
}
// These enums are somewhat arduous to forward-declare, but it's worth it
// because the header which defines them is enormous and this header is widely
// used.
namespace protos::pbzero {
namespace perfetto_pbzero_enum_ChromeLatencyInfo2 {
enum InputResultState : int32_t;
enum InputType : int32_t;
enum Step : int32_t;
} // namespace perfetto_pbzero_enum_ChromeLatencyInfo2
class ChromeLatencyInfo2;
using ChromeLatencyInfo2_InputResultState =
perfetto_pbzero_enum_ChromeLatencyInfo2::InputResultState;
using ChromeLatencyInfo2_InputType =
perfetto_pbzero_enum_ChromeLatencyInfo2::InputType;
using ChromeLatencyInfo2_Step = perfetto_pbzero_enum_ChromeLatencyInfo2::Step;
} // namespace protos::pbzero
} // namespace perfetto
namespace ui {
@ -115,11 +130,11 @@ class LatencyInfo {
static perfetto::protos::pbzero::ChromeLatencyInfo2* FillTraceEvent(
perfetto::EventContext& ctx,
int64_t latency_trace_id,
perfetto::protos::pbzero::ChromeLatencyInfo2::Step step,
std::optional<perfetto::protos::pbzero::ChromeLatencyInfo2::InputType>
perfetto::protos::pbzero::ChromeLatencyInfo2_Step step,
std::optional<perfetto::protos::pbzero::ChromeLatencyInfo2_InputType>
input_type = std::nullopt,
std::optional<
perfetto::protos::pbzero::ChromeLatencyInfo2::InputResultState>
perfetto::protos::pbzero::ChromeLatencyInfo2_InputResultState>
input_result_state = std::nullopt);
// Add timestamps for components that are in |other| but not in |this|.