From 05fa93520540e65e4d0bf3f5e1ed7588a03ccc63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Fri, 2 Oct 2026 03:54:44 -0700 Subject: [PATCH] Make host target tracing implementation headers private Summary: Mark the following headers as private instead of for-frameworks. All of them are implementation details of how the host target records and serializes a trace, and no for-frameworks header includes them: - `HostTracingProfileSerializer` transforms a `HostTracingProfile` into serialized trace events. It is only used by its own source and `HostTargetTracing.h`. - `HostTargetTracing.h` provides `emitNotificationsForTracingProfile`, which uses the serializer to send a captured profile to frontend channels as `Tracing.dataCollected` events followed by `Tracing.tracingComplete`. It is only used by `HostTarget.cpp` and `TracingAgent.cpp`, and was already not exported in Buck. - `HostTargetTraceRecording` holds the state of an in-progress host trace recording. `HostTarget.h` only forward-declares it, and it is only used by `HostTarget.cpp`, `HostTargetTraceRecording.cpp` and `HostTargetTracing.cpp`. - `TimeWindowedBuffer` is a generic buffer that keeps only elements inside a time window. It is only used by `HostTargetTraceRecording` and its own unit test. - `TracingAgent` handles the CDP `Tracing.start` and `Tracing.stop` requests for the host agent. It is only used by `HostAgent.cpp` and `TracingAgent.cpp`, and was already not exported in Buck. Headers that include one another change together: `HostTargetTracing.h` includes `HostTracingProfileSerializer.h`, and `HostTargetTraceRecording.h` stores a `TimeWindowedBuffer` by value, so keeping either includer for-frameworks would expose a private header. `HostTracingProfile.h`, `FrameTimingSequence.h`, `TraceRecordingState.h` and `TracingCategory.h` stay for-frameworks because other for-frameworks headers include them. React Native's own targets define `RN_BUILDING`, so the private guard does not affect them. Changelog: [Internal] Differential Revision: D122791607 --- .../ReactCommon/jsinspector-modern/HostTargetTraceRecording.h | 2 +- .../ReactCommon/jsinspector-modern/HostTargetTracing.h | 2 +- .../react-native/ReactCommon/jsinspector-modern/TracingAgent.h | 2 +- .../jsinspector-modern/tracing/HostTracingProfileSerializer.h | 2 +- .../ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h b/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h index b341811e822f..e35afee3b899 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include "HostAgent.h" #include "HostTarget.h" diff --git a/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTracing.h b/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTracing.h index 9392075d538a..970e95412008 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTracing.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/HostTargetTracing.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include "InspectorInterfaces.h" diff --git a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h index c58c6cf48e5a..e77bb113adf3 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include "HostTarget.h" #include "InspectorInterfaces.h" diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h index 1c811939bfd5..27fc82711335 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include "FrameTimingSequence.h" #include "HostTracingProfile.h" diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h index 182b3c78975c..e2dd190541b5 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include