Skip to content

Commit c544f0d

Browse files
Dawid Małeckimeta-codesync[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 the host target and how it 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. - `HostAgent` handles CDP requests for a host target. `HostTarget.h` only forward-declares it, and it is only used by `HostAgent.cpp`, `HostTarget.cpp` and `HostTargetTraceRecording.h`. - `InstanceAgent` handles CDP requests for an instance target. `InstanceTarget.h` only forward-declares it, and it is only used by `HostAgent.h`, `HostAgent.cpp`, `InstanceAgent.cpp` and `InstanceTarget.cpp`. - `InspectorUtilities.h` provides connection adapters for `InspectorInterfaces`: `CallbackLocalConnection`, `CallbackRemoteConnection`, `RAIIRemoteConnection` and `NullRemoteConnection`. It is only used by `HostTarget.cpp` and `InspectorUtilities.cpp`, and was already not exported in Buck. Headers that include one another change together: `HostTargetTracing.h` includes `HostTracingProfileSerializer.h`, `HostTargetTraceRecording.h` stores a `TimeWindowedBuffer` by value and includes `HostAgent.h`, and `HostAgent.h` includes `InstanceAgent.h`, so keeping any of these includers 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 5ce5418 commit c544f0d

11 files changed

Lines changed: 86 additions & 353 deletions

File tree

‎packages/react-native/ReactCommon/jsinspector-modern/HostAgent.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

‎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/InspectorUtilities.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/InstanceAgent.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 "RuntimeTarget.h"
1313
#include "SessionState.h"

‎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>

‎scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api‎

Lines changed: 26 additions & 115 deletions
Large diffs are not rendered by default.

‎scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api‎

Lines changed: 26 additions & 115 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)