• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef SRC_INSPECTOR_TRACING_AGENT_H_
2 #define SRC_INSPECTOR_TRACING_AGENT_H_
3 
4 #include "node/inspector/protocol/NodeTracing.h"
5 #include "tracing/agent.h"
6 #include "v8.h"
7 
8 
9 namespace node {
10 class Environment;
11 
12 namespace inspector {
13 class MainThreadHandle;
14 
15 namespace protocol {
16 
17 class TracingAgent : public NodeTracing::Backend {
18  public:
19   explicit TracingAgent(Environment*, std::shared_ptr<MainThreadHandle>);
20   ~TracingAgent() override;
21 
22   void Wire(UberDispatcher* dispatcher);
23 
24   DispatchResponse start(
25       std::unique_ptr<protocol::NodeTracing::TraceConfig> traceConfig) override;
26   DispatchResponse stop() override;
27   DispatchResponse getCategories(
28       std::unique_ptr<protocol::Array<String>>* categories) override;
29 
30  private:
31   Environment* env_;
32   std::shared_ptr<MainThreadHandle> main_thread_;
33   tracing::AgentWriterHandle trace_writer_;
34   int frontend_object_id_;
35   std::shared_ptr<NodeTracing::Frontend> frontend_;
36 };
37 
38 
39 }  // namespace protocol
40 }  // namespace inspector
41 }  // namespace node
42 
43 #endif  // SRC_INSPECTOR_TRACING_AGENT_H_
44