11cb0ef41Sopenharmony_ci#ifndef SRC_INSPECTOR_TRACING_AGENT_H_
21cb0ef41Sopenharmony_ci#define SRC_INSPECTOR_TRACING_AGENT_H_
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci#include "node/inspector/protocol/NodeTracing.h"
51cb0ef41Sopenharmony_ci#include "tracing/agent.h"
61cb0ef41Sopenharmony_ci#include "v8.h"
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_cinamespace node {
101cb0ef41Sopenharmony_ciclass Environment;
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_cinamespace inspector {
131cb0ef41Sopenharmony_ciclass MainThreadHandle;
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_cinamespace protocol {
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciclass TracingAgent : public NodeTracing::Backend {
181cb0ef41Sopenharmony_ci public:
191cb0ef41Sopenharmony_ci  explicit TracingAgent(Environment*, std::shared_ptr<MainThreadHandle>);
201cb0ef41Sopenharmony_ci  ~TracingAgent() override;
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ci  void Wire(UberDispatcher* dispatcher);
231cb0ef41Sopenharmony_ci
241cb0ef41Sopenharmony_ci  DispatchResponse start(
251cb0ef41Sopenharmony_ci      std::unique_ptr<protocol::NodeTracing::TraceConfig> traceConfig) override;
261cb0ef41Sopenharmony_ci  DispatchResponse stop() override;
271cb0ef41Sopenharmony_ci  DispatchResponse getCategories(
281cb0ef41Sopenharmony_ci      std::unique_ptr<protocol::Array<String>>* categories) override;
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_ci private:
311cb0ef41Sopenharmony_ci  Environment* env_;
321cb0ef41Sopenharmony_ci  std::shared_ptr<MainThreadHandle> main_thread_;
331cb0ef41Sopenharmony_ci  tracing::AgentWriterHandle trace_writer_;
341cb0ef41Sopenharmony_ci  int frontend_object_id_ = 0;
351cb0ef41Sopenharmony_ci  std::shared_ptr<NodeTracing::Frontend> frontend_;
361cb0ef41Sopenharmony_ci};
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ci
391cb0ef41Sopenharmony_ci}  // namespace protocol
401cb0ef41Sopenharmony_ci}  // namespace inspector
411cb0ef41Sopenharmony_ci}  // namespace node
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_ci#endif  // SRC_INSPECTOR_TRACING_AGENT_H_
44