Cleanup legacy tracing endpoints from Agents (#52965)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52965

# Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D79434656

fbshipit-source-id: 8c6b690ac6c22df8376651d14b940f74cf23dca3
This commit is contained in:
Ruslan Lesiutin
2025-08-06 05:48:35 -07:00
committed by Facebook GitHub Bot
parent f618ca4872
commit 8e97de473e
6 changed files with 0 additions and 72 deletions
@@ -311,8 +311,6 @@ class HostAgent::Impl final {
}
void setCurrentInstanceAgent(std::shared_ptr<InstanceAgent> instanceAgent) {
tracingAgent_.setCurrentInstanceAgent(instanceAgent);
auto previousInstanceAgent = std::move(instanceAgent_);
instanceAgent_ = std::move(instanceAgent);
@@ -156,27 +156,6 @@ void InstanceAgent::maybeSendPendingConsoleMessages() {
}
}
void InstanceAgent::startTracing() {
if (runtimeAgent_) {
runtimeAgent_->enableSamplingProfiler();
}
}
void InstanceAgent::stopTracing() {
if (runtimeAgent_) {
runtimeAgent_->disableSamplingProfiler();
}
}
tracing::InstanceTracingProfileLegacy InstanceAgent::collectTracingProfile() {
tracing::RuntimeSamplingProfile runtimeSamplingProfile =
runtimeAgent_->collectSamplingProfile();
return tracing::InstanceTracingProfileLegacy{
.runtimeSamplingProfile = std::move(runtimeSamplingProfile),
};
}
#pragma mark - Tracing
InstanceTracingAgent::InstanceTracingAgent(tracing::TraceRecordingState& state)
@@ -60,23 +60,6 @@ class InstanceAgent final {
*/
void sendConsoleMessage(SimpleConsoleMessage message);
/**
* Notify Instance about started Tracing session. Should be initiated by
* TracingAgent on Tracing.start CDP method.
*/
void startTracing();
/**
* Notify Instance about stopped Tracing session. Should be initiated by
* TracingAgent on Tracing.end CDP method.
*/
void stopTracing();
/**
* Return recorded profile for the previous tracing session.
*/
tracing::InstanceTracingProfileLegacy collectTracingProfile();
private:
void maybeSendExecutionContextCreatedNotification();
void sendConsoleMessageImmediately(SimpleConsoleMessage message);
@@ -95,9 +95,4 @@ bool TracingAgent::handleRequest(const cdp::PreparsedRequest& req) {
return false;
}
void TracingAgent::setCurrentInstanceAgent(
std::shared_ptr<InstanceAgent> instanceAgent) {
instanceAgent_ = std::move(instanceAgent);
}
} // namespace facebook::react::jsinspector_modern
@@ -9,7 +9,6 @@
#include "HostTarget.h"
#include "InspectorInterfaces.h"
#include "InstanceAgent.h"
#include <jsinspector-modern/cdp/CdpJson.h>
#include <jsinspector-modern/tracing/Timing.h>
@@ -38,32 +37,12 @@ class TracingAgent {
*/
bool handleRequest(const cdp::PreparsedRequest& req);
/**
* Replace the current InstanceAgent with the given one.
* \param agent The new InstanceAgent. May be null to signify that there is
* currently no active instance.
*/
void setCurrentInstanceAgent(std::shared_ptr<InstanceAgent> agent);
private:
/**
* A channel used to send responses and events to the frontend.
*/
FrontendChannel frontendChannel_;
/**
* Current InstanceAgent. May be null to signify that there is
* currently no active instance.
*/
std::shared_ptr<InstanceAgent> instanceAgent_;
/**
* Timestamp of when we started tracing of an Instance, will be used as a
* a start of JavaScript samples recording and as a time origin for the events
* in this trace.
*/
HighResTimeStamp instanceTracingStartTimestamp_;
const SessionState& sessionState_;
HostTargetController& hostTargetController_;
@@ -7,16 +7,10 @@
#pragma once
#include "RuntimeSamplingProfile.h"
#include "TraceEvent.h"
namespace facebook::react::jsinspector_modern::tracing {
struct InstanceTracingProfileLegacy {
public:
RuntimeSamplingProfile runtimeSamplingProfile;
};
struct InstanceTracingProfile {
std::vector<TraceEvent> performanceTraceEvents;
};