michangarrito/apps/backend/node_modules/react-native/ReactCommon/jsinspector-modern/TracingAgent.h
rckrdmrd 48dea7a5d0 feat: Initial commit - michangarrito
Marketplace móvil para negocios locales mexicanos.

Estructura inicial:
- apps/backend (NestJS API)
- apps/frontend (React Web)
- apps/mobile (Expo/React Native)
- apps/mcp-server (Claude MCP Server)
- apps/whatsapp-service (WhatsApp Business API)
- database/ (PostgreSQL DDL)
- docs/ (Documentación)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:41:02 -06:00

66 lines
1.9 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include "HostTarget.h"
#include "InspectorInterfaces.h"
#include <jsinspector-modern/cdp/CdpJson.h>
#include <jsinspector-modern/tracing/Timing.h>
#include <react/timing/primitives.h>
namespace facebook::react::jsinspector_modern {
/**
* Provides an agent for handling CDP's Tracing.start, Tracing.stop.
*/
class TracingAgent {
public:
/**
* \param frontendChannel A channel used to send responses to the
* frontend.
* \param sessionState The state of the session that created this agent.
* \param hostTargetController An interface to the HostTarget that this agent
* is attached to. The caller is responsible for ensuring that the
* HostTargetDelegate and underlying HostTarget both outlive the agent.
*/
TracingAgent(FrontendChannel frontendChannel, SessionState &sessionState, HostTargetController &hostTargetController);
~TracingAgent();
/**
* Handle a CDP request. The response will be sent over the provided
* \c FrontendChannel synchronously or asynchronously.
* \param req The parsed request.
*/
bool handleRequest(const cdp::PreparsedRequest &req);
/**
* Emits the Trace Recording that was stashed externally by the HostTarget.
*/
void emitExternalTraceRecording(tracing::TraceRecordingState traceRecording) const;
private:
/**
* A channel used to send responses and events to the frontend.
*/
FrontendChannel frontendChannel_;
SessionState &sessionState_;
HostTargetController &hostTargetController_;
/**
* Emits the captured Trace Recording state in a series of
* Tracing.dataCollected events, followed by a Tracing.tracingComplete event.
*/
void emitTraceRecording(tracing::TraceRecordingState traceRecording) const;
};
} // namespace facebook::react::jsinspector_modern