diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h index 7e0b62b442e7ff..74d5c935a5716b 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h @@ -99,7 +99,7 @@ class RuntimeAgent final { * Lifetime of this agent is bound to the lifetime of the Tracing session - * HostTargetTraceRecording and to the lifetime of the RuntimeTarget. */ -class RuntimeTracingAgent : tracing::TargetTracingAgent { +class RuntimeTracingAgent : public tracing::TargetTracingAgent { public: explicit RuntimeTracingAgent(tracing::TraceRecordingState &state, RuntimeTargetController &targetController); diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h index 236cf83e7de381..a2598d026f83fe 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h @@ -207,19 +207,6 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis createTracingAgent(tracing::TraceRecordingState &state); - /** - * Start sampling profiler for a particular JavaScript runtime. - */ - void enableSamplingProfiler(); - /** - * Stop sampling profiler for a particular JavaScript runtime. - */ - void disableSamplingProfiler(); - /** - * Return recorded sampling profile for the previous sampling session. - */ - tracing::RuntimeSamplingProfile collectSamplingProfile(); - private: using Domain = RuntimeTargetController::Domain; @@ -275,6 +262,18 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis tracingAgent_; + /** + * Start sampling profiler for a particular JavaScript runtime. + */ + void enableSamplingProfiler(); + /** + * Stop sampling profiler for a particular JavaScript runtime. + */ + void disableSamplingProfiler(); + /** + * Return recorded sampling profile for the previous sampling session. + */ + tracing::RuntimeSamplingProfile collectSamplingProfile(); /** * Adds a function with the given name on the runtime's global object, that diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h index f92ffe7b263156..a1a1260c649437 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h @@ -27,6 +27,11 @@ class TargetTracingAgent { (void)state_; } + bool isRunningInBackgroundMode() + { + return state_.mode == tracing::Mode::Background; + } + protected: TraceRecordingState &state_; };