Skip to content

Commit 05fa935

Browse files
coadofacebook-github-bot
authored andcommitted
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
1 parent b735789 commit 05fa935

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/react-native/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include "HostAgent.h"
1313
#include "HostTarget.h"

‎packages/react-native/ReactCommon/jsinspector-modern/HostTargetTracing.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include "InspectorInterfaces.h"
1313

‎packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include "HostTarget.h"
1313
#include "InspectorInterfaces.h"

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include "FrameTimingSequence.h"
1313
#include "HostTracingProfile.h"

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include <algorithm>
1313
#include <functional>

0 commit comments

Comments
 (0)