From 999cfd9979b5f57b1269119679ab8cdf60897de9 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Tue, 20 Feb 2024 02:21:31 -0800 Subject: [PATCH] Save exported state across RuntimeAgent instances Summary: X-link: https://github.com/facebook/react-native/pull/43098 Changelog: [Internal] Wraps Hermes's `CDPHandler::getState()` API in an engine-agnostic abstraction (`RuntimeAgentDelegate::getExportedState`). An Agent's lifetime ends when its Target is destroyed, but it can occasionally be useful to persist some state for the "next" Target+Agent of the same type (in the same session) to read. `RuntimeAgentDelegate` is polymorphic and can't just write arbitrary data to SessionState. Instead, it can now *export* a state object that we'll store and pass to the next `RuntimeTargetDelegate::createAgentDelegate` call. Reviewed By: huntie Differential Revision: D53919696 fbshipit-source-id: a8e9b921bc8fc2d195c5dddea9537e6ead3d0358 --- API/hermes/inspector/chrome/CDPHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/API/hermes/inspector/chrome/CDPHandler.h b/API/hermes/inspector/chrome/CDPHandler.h index 463292057bf..17255a8ef25 100644 --- a/API/hermes/inspector/chrome/CDPHandler.h +++ b/API/hermes/inspector/chrome/CDPHandler.h @@ -128,7 +128,7 @@ class INSPECTOR_EXPORT CDPHandler { /// Public-facing wrapper for internal CDP state that can be preserved across /// reloads. -struct State { +struct INSPECTOR_EXPORT State { /// Incomplete type that stores the actual state. struct Private;