diff --git a/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp b/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp index 1c29f8e7e82..21c4fb8dbd7 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp @@ -311,8 +311,6 @@ class HostAgent::Impl final { } void setCurrentInstanceAgent(std::shared_ptr instanceAgent) { - tracingAgent_.setCurrentInstanceAgent(instanceAgent); - auto previousInstanceAgent = std::move(instanceAgent_); instanceAgent_ = std::move(instanceAgent); diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp b/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp index 1e0ffe558ad..870ff718230 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp @@ -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) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.h index bf886edcb73..d465601254d 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.h @@ -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); diff --git a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp index 5864a5f0bc2..883bfaf9f32 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp @@ -95,9 +95,4 @@ bool TracingAgent::handleRequest(const cdp::PreparsedRequest& req) { return false; } -void TracingAgent::setCurrentInstanceAgent( - std::shared_ptr instanceAgent) { - instanceAgent_ = std::move(instanceAgent); -} - } // namespace facebook::react::jsinspector_modern diff --git a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h index c96ca1d9d64..6d029c149cf 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.h @@ -9,7 +9,6 @@ #include "HostTarget.h" #include "InspectorInterfaces.h" -#include "InstanceAgent.h" #include #include @@ -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 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_; - - /** - * 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_; diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/InstanceTracingProfile.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/InstanceTracingProfile.h index 4831f14598e..59493bca2ac 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/InstanceTracingProfile.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/InstanceTracingProfile.h @@ -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 performanceTraceEvents; };