Skip to content

Commit

Permalink
Save exported state across RuntimeAgent instances
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/react-native#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
  • Loading branch information
motiz88 authored and facebook-github-bot committed Feb 20, 2024
1 parent 5f28c30 commit 999cfd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion API/hermes/inspector/chrome/CDPHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 999cfd9

Please sign in to comment.