v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8-inspector-session-impl.h
Go to the documentation of this file.
1// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_INSPECTOR_V8_INSPECTOR_SESSION_IMPL_H_
6#define V8_INSPECTOR_V8_INSPECTOR_SESSION_IMPL_H_
7
8#include <memory>
9#include <vector>
10
11#include "src/base/macros.h"
12#include "src/inspector/protocol/Forward.h"
13#include "src/inspector/protocol/Runtime.h"
14#include "src/inspector/protocol/Schema.h"
15
17
18namespace v8_inspector {
19
20class InjectedScript;
21class RemoteObjectIdBase;
22class V8ConsoleAgentImpl;
23class V8DebuggerAgentImpl;
24class V8DebuggerBarrier;
25class V8InspectorImpl;
26class V8HeapProfilerAgentImpl;
27class V8ProfilerAgentImpl;
28class V8RuntimeAgentImpl;
29class V8SchemaAgentImpl;
30
31using protocol::Response;
32
34 public protocol::FrontendChannel {
35 public:
36 static std::unique_ptr<V8InspectorSessionImpl> create(
40 std::shared_ptr<V8DebuggerBarrier>);
41 ~V8InspectorSessionImpl() override;
44
54 int contextGroupId() const { return m_contextGroupId; }
55 int sessionId() const { return m_sessionId; }
56
57 Response findInjectedScript(int contextId, InjectedScript*&);
59 void reset();
63 std::unique_ptr<protocol::Runtime::RemoteObject> wrapObject(
65 bool generatePreview);
66 std::unique_ptr<protocol::Runtime::RemoteObject> wrapTable(
69 std::vector<std::unique_ptr<protocol::Schema::Domain>> supportedDomainsImpl();
70 Response unwrapObject(const String16& objectId, v8::Local<v8::Value>*,
71 v8::Local<v8::Context>*, String16* objectGroup);
72 void releaseObjectGroup(const String16& objectGroup);
73
74 // V8InspectorSession implementation.
75 void dispatchProtocolMessage(StringView message) override;
76 std::vector<uint8_t> state() override;
77 std::vector<std::unique_ptr<protocol::Schema::API::Domain>> supportedDomains()
78 override;
80 std::unique_ptr<V8InspectorSession::Inspectable>) override;
82 StringView breakDetails) override;
83 void cancelPauseOnNextStatement() override;
84 void breakProgram(StringView breakReason, StringView breakDetails) override;
85 void setSkipAllPauses(bool) override;
86 void resume(bool terminateOnResume = false) override;
87 void stepOver() override;
88 std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>>
89 searchInTextByLines(StringView text, StringView query, bool caseSensitive,
90 bool isRegex) override;
91 void releaseObjectGroup(StringView objectGroup) override;
92 bool unwrapObject(std::unique_ptr<StringBuffer>*, StringView objectId,
94 std::unique_ptr<StringBuffer>* objectGroup) override;
95 std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(
97 bool generatePreview) override;
98
100 static const unsigned kInspectedObjectBufferSize = 5;
101
102 void triggerPreciseCoverageDeltaUpdate(StringView occasion) override;
104 bool includeCommandLineAPI = false) override;
105 void stop() override;
106
110
111 private:
115 std::shared_ptr<V8DebuggerBarrier>);
116 protocol::DictionaryValue* agentState(const String16& name);
117
118 // protocol::FrontendChannel implementation.
120 int callId, std::unique_ptr<protocol::Serializable> message) override;
122 std::unique_ptr<protocol::Serializable> message) override;
123 void FallThrough(int callId, v8_crdtp::span<uint8_t> method,
124 v8_crdtp::span<uint8_t> message) override;
125 void FlushProtocolNotifications() override;
126
127 std::unique_ptr<StringBuffer> serializeForFrontend(
128 std::unique_ptr<protocol::Serializable> message);
134
135 protocol::UberDispatcher m_dispatcher;
136 std::unique_ptr<protocol::DictionaryValue> m_state;
137
138 std::unique_ptr<V8RuntimeAgentImpl> m_runtimeAgent;
139 std::unique_ptr<V8DebuggerAgentImpl> m_debuggerAgent;
140 std::unique_ptr<V8HeapProfilerAgentImpl> m_heapProfilerAgent;
141 std::unique_ptr<V8ProfilerAgentImpl> m_profilerAgent;
142 std::unique_ptr<V8ConsoleAgentImpl> m_consoleAgent;
143 std::unique_ptr<V8SchemaAgentImpl> m_schemaAgent;
144 std::vector<std::unique_ptr<V8InspectorSession::Inspectable>>
148};
149
150} // namespace v8_inspector
151
152#endif // V8_INSPECTOR_V8_INSPECTOR_SESSION_IMPL_H_
protocol::DictionaryValue * agentState(const String16 &name)
V8Inspector::ClientTrustLevel clientTrustLevel()
std::vector< std::unique_ptr< protocol::Schema::Domain > > supportedDomainsImpl()
std::unique_ptr< V8ConsoleAgentImpl > m_consoleAgent
V8InspectorSession::Inspectable * inspectedObject(unsigned num)
Response findInjectedScript(int contextId, InjectedScript *&)
std::unique_ptr< protocol::DictionaryValue > m_state
std::unique_ptr< V8DebuggerAgentImpl > m_debuggerAgent
V8InspectorSessionImpl & operator=(const V8InspectorSessionImpl &)=delete
std::vector< std::unique_ptr< protocol::Schema::API::Domain > > supportedDomains() override
void addInspectedObject(std::unique_ptr< V8InspectorSession::Inspectable >) override
std::vector< std::unique_ptr< V8InspectorSession::Inspectable > > m_inspectedObjects
void schedulePauseOnNextStatement(StringView breakReason, StringView breakDetails) override
std::unique_ptr< StringBuffer > serializeForFrontend(std::unique_ptr< protocol::Serializable > message)
void FallThrough(int callId, v8_crdtp::span< uint8_t > method, v8_crdtp::span< uint8_t > message) override
void resume(bool terminateOnResume=false) override
std::unique_ptr< protocol::Runtime::RemoteObject > wrapObject(v8::Local< v8::Context >, v8::Local< v8::Value >, const String16 &groupName, bool generatePreview)
V8Inspector::ClientTrustLevel m_clientTrustLevel
std::vector< std::unique_ptr< protocol::Debugger::API::SearchMatch > > searchInTextByLines(StringView text, StringView query, bool caseSensitive, bool isRegex) override
void releaseObjectGroup(const String16 &objectGroup)
void SendProtocolResponse(int callId, std::unique_ptr< protocol::Serializable > message) override
void SendProtocolNotification(std::unique_ptr< protocol::Serializable > message) override
std::unique_ptr< V8ProfilerAgentImpl > m_profilerAgent
void breakProgram(StringView breakReason, StringView breakDetails) override
static std::unique_ptr< V8InspectorSessionImpl > create(V8InspectorImpl *, int contextGroupId, int sessionId, V8Inspector::Channel *, StringView state, v8_inspector::V8Inspector::ClientTrustLevel, std::shared_ptr< V8DebuggerBarrier >)
std::unique_ptr< V8HeapProfilerAgentImpl > m_heapProfilerAgent
std::vector< uint8_t > state() override
std::unique_ptr< V8SchemaAgentImpl > m_schemaAgent
std::unique_ptr< protocol::Runtime::RemoteObject > wrapTable(v8::Local< v8::Context >, v8::Local< v8::Object > table, v8::MaybeLocal< v8::Array > columns)
void dispatchProtocolMessage(StringView message) override
Response unwrapObject(const String16 &objectId, v8::Local< v8::Value > *, v8::Local< v8::Context > *, String16 *objectGroup)
void triggerPreciseCoverageDeltaUpdate(StringView occasion) override
std::unique_ptr< V8RuntimeAgentImpl > m_runtimeAgent
V8InspectorSessionImpl(const V8InspectorSessionImpl &)=delete
EvaluateResult evaluate(v8::Local< v8::Context > context, StringView expression, bool includeCommandLineAPI=false) override
Symbol method