From f1f69462fde2d39add2fdbed2693163a3333b18f Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH] Expose a public getter on a TracingAgent for background mode (#54282) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54282 # Changelog: [Internal] It is already in a tracing session state, we are going to use it in RuntimeTarget. Reviewed By: huntie Differential Revision: D85440638 fbshipit-source-id: 34e9a485b2701580f6ceef4262537a5a428dfcee --- .../ReactCommon/jsinspector-modern/RuntimeAgent.h | 2 +- .../jsinspector-modern/tracing/TargetTracingAgent.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h index 7e0b62b442e..74d5c935a57 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/tracing/TargetTracingAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h index f92ffe7b263..a1a1260c649 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_; };