5#ifndef V8_V8_INSPECTOR_H_
6#define V8_V8_INSPECTOR_H_
52 StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {}
55 : m_is8Bit(true), m_length(length), m_characters8(characters) {}
58 : m_is8Bit(false), m_length(length), m_characters16(characters) {}
60 bool is8Bit()
const {
return m_is8Bit; }
61 size_t length()
const {
return m_length; }
90 contextGroupId(contextGroupId),
91 humanReadableName(humanReadableName),
92 hasMemoryOnConsole(false) {}
106 void*
operator new(size_t) =
delete;
108 void*
operator new(size_t,
void*) =
delete;
127 std::pair<int64_t, int64_t>
pair()
const;
130 friend class internal::V8DebuggerId;
134 int64_t m_second = 0;
155 virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
157 virtual std::unique_ptr<StringBuffer>
toString()
const = 0;
160 virtual std::unique_ptr<V8StackTrace>
clone() = 0;
162 virtual std::vector<V8StackFrame>
frames()
const = 0;
180 virtual std::vector<uint8_t>
state() = 0;
181 virtual std::vector<std::unique_ptr<protocol::Schema::API::Domain>>
191 virtual void resume(
bool setTerminateOnResume =
false) = 0;
193 virtual std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>>
198 virtual std::unique_ptr<protocol::Runtime::API::RemoteObject>
wrapObject(
200 bool generatePreview) = 0;
205 std::unique_ptr<StringBuffer>* objectGroup) = 0;
223 bool includeCommandLineAPI =
false) = 0;
232 : type(std::move(type)), value(value) {}
233 std::unique_ptr<StringBuffer>
type;
239 std::unique_ptr<DeepSerializedValue> serializedValue)
240 : serializedValue(std::move(serializedValue)), isSuccess(true) {}
242 : errorMessage(std::move(errorMessage)), isSuccess(false) {}
256 runMessageLoopOnPause(contextGroupId);
282 int contextGroupId) {
308 typedef void (*TimerCallback)(
void*);
337 bool should_pause =
false;
349 bool IsInvalid() const;
385 unsigned lineNumber,
unsigned columnNumber,
386 std::unique_ptr<V8StackTrace>,
400 std::unique_ptr<StringBuffer> message) = 0;
407 virtual std::unique_ptr<V8InspectorSession>
connect(
Definition: v8-isolate.h:212
MessageErrorLevel
Definition: v8-isolate.h:571
Definition: v8-local-handle.h:266
Definition: v8-local-handle.h:632
Definition: v8-inspector.h:77
virtual ~StringBuffer()=default
virtual StringView string() const =0
static std::unique_ptr< StringBuffer > create(StringView)
Definition: v8-inspector.h:50
const uint8_t * m_characters8
Definition: v8-inspector.h:72
size_t length() const
Definition: v8-inspector.h:61
StringView()
Definition: v8-inspector.h:52
const uint8_t * characters8() const
Definition: v8-inspector.h:65
const uint16_t * characters16() const
Definition: v8-inspector.h:66
StringView(const uint8_t *characters, size_t length)
Definition: v8-inspector.h:54
bool is8Bit() const
Definition: v8-inspector.h:60
StringView(const uint16_t *characters, size_t length)
Definition: v8-inspector.h:57
const uint16_t * m_characters16
Definition: v8-inspector.h:73
Definition: v8-inspector.h:85
v8::Local< v8::Context > context
Definition: v8-inspector.h:94
V8ContextInfo(const V8ContextInfo &)=delete
bool hasMemoryOnConsole
Definition: v8-inspector.h:100
StringView humanReadableName
Definition: v8-inspector.h:97
int contextGroupId
Definition: v8-inspector.h:96
V8ContextInfo & operator=(const V8ContextInfo &)=delete
static int executionContextId(v8::Local< v8::Context > context)
V8ContextInfo(v8::Local< v8::Context > context, int contextGroupId, StringView humanReadableName)
Definition: v8-inspector.h:87
StringView origin
Definition: v8-inspector.h:98
StringView auxData
Definition: v8-inspector.h:99
NotNullTagEnum
Definition: v8-inspector.h:105
Definition: v8-inspector.h:119
std::unique_ptr< StringBuffer > toString() const
std::pair< int64_t, int64_t > pair() const
V8DebuggerId(const V8DebuggerId &)=default
V8DebuggerId & operator=(const V8DebuggerId &)=default
Definition: v8-inspector.h:250
virtual void beginEnsureAllContextsInGroup(int contextGroupId)
Definition: v8-inspector.h:285
virtual void consoleClear(int contextGroupId)
Definition: v8-inspector.h:306
virtual bool isInspectableHeapObject(v8::Local< v8::Object >)
Definition: v8-inspector.h:279
virtual std::unique_ptr< StringBuffer > descriptionForValueSubtype(v8::Local< v8::Context >, v8::Local< v8::Value >)
Definition: v8-inspector.h:275
virtual void endUserGesture()
Definition: v8-inspector.h:265
virtual ~V8InspectorClient()=default
virtual void unmuteMetrics(int contextGroupId)
Definition: v8-inspector.h:262
virtual void startRepeatingTimer(double, TimerCallback, void *data)
Definition: v8-inspector.h:309
virtual void muteMetrics(int contextGroupId)
Definition: v8-inspector.h:261
virtual v8::Local< v8::Context > ensureDefaultContextInGroup(int contextGroupId)
Definition: v8-inspector.h:281
virtual void runIfWaitingForDebugger(int contextGroupId)
Definition: v8-inspector.h:259
virtual void consoleTimeStamp(v8::Isolate *isolate, v8::Local< v8::String > label)
Definition: v8-inspector.h:303
virtual void consoleTime(v8::Isolate *isolate, v8::Local< v8::String > label)
Definition: v8-inspector.h:300
virtual bool canExecuteScripts(int contextGroupId)
Definition: v8-inspector.h:314
virtual void dispatchError(v8::Local< v8::Context >, v8::Local< v8::Message >, v8::Local< v8::Value >)
Definition: v8-inspector.h:327
virtual void beginUserGesture()
Definition: v8-inspector.h:264
virtual void consoleTimeEnd(v8::Isolate *isolate, v8::Local< v8::String > label)
Definition: v8-inspector.h:301
virtual v8::MaybeLocal< v8::Value > memoryInfo(v8::Isolate *, v8::Local< v8::Context >)
Definition: v8-inspector.h:295
virtual std::unique_ptr< StringBuffer > valueSubtype(v8::Local< v8::Value >)
Definition: v8-inspector.h:272
virtual double currentTimeMS()
Definition: v8-inspector.h:307
virtual void consoleAPIMessage(int contextGroupId, v8::Isolate::MessageErrorLevel level, const StringView &message, const StringView &url, unsigned lineNumber, unsigned columnNumber, V8StackTrace *)
Definition: v8-inspector.h:290
virtual void installAdditionalCommandLineAPI(v8::Local< v8::Context >, v8::Local< v8::Object >)
Definition: v8-inspector.h:288
virtual std::unique_ptr< DeepSerializationResult > deepSerialize(v8::Local< v8::Value > v8Value, int maxDepth, v8::Local< v8::Object > additionalParameters)
Definition: v8-inspector.h:267
virtual int64_t generateUniqueId()
Definition: v8-inspector.h:325
virtual void runMessageLoopOnPause(int contextGroupId)
Definition: v8-inspector.h:254
virtual void runMessageLoopOnInstrumentationPause(int contextGroupId)
Definition: v8-inspector.h:255
virtual void quitMessageLoopOnPause()
Definition: v8-inspector.h:258
virtual std::unique_ptr< StringBuffer > resourceNameToUrl(const StringView &resourceName)
Definition: v8-inspector.h:318
virtual void cancelTimer(void *data)
Definition: v8-inspector.h:310
virtual void maxAsyncCallStackDepthChanged(int depth)
Definition: v8-inspector.h:316
virtual void endEnsureAllContextsInGroup(int contextGroupId)
Definition: v8-inspector.h:286
Definition: v8-inspector.h:170
virtual v8::Local< v8::Value > get(v8::Local< v8::Context >)=0
virtual ~Inspectable()=default
Definition: v8-inspector.h:165
virtual void releaseObjectGroup(StringView)=0
virtual std::vector< std::unique_ptr< protocol::Schema::API::Domain > > supportedDomains()=0
static bool canDispatchMethod(StringView method)
virtual bool unwrapObject(std::unique_ptr< StringBuffer > *error, StringView objectId, v8::Local< v8::Value > *, v8::Local< v8::Context > *, std::unique_ptr< StringBuffer > *objectGroup)=0
virtual void addInspectedObject(std::unique_ptr< Inspectable >)=0
virtual void breakProgram(StringView breakReason, StringView breakDetails)=0
virtual std::unique_ptr< protocol::Runtime::API::RemoteObject > wrapObject(v8::Local< v8::Context >, v8::Local< v8::Value >, StringView groupName, bool generatePreview)=0
virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion)=0
virtual void stepOver()=0
virtual ~V8InspectorSession()=default
virtual void dispatchProtocolMessage(StringView message)=0
virtual std::vector< std::unique_ptr< protocol::Debugger::API::SearchMatch > > searchInTextByLines(StringView text, StringView query, bool caseSensitive, bool isRegex)=0
virtual void schedulePauseOnNextStatement(StringView breakReason, StringView breakDetails)=0
virtual void cancelPauseOnNextStatement()=0
virtual EvaluateResult evaluate(v8::Local< v8::Context > context, StringView expression, bool includeCommandLineAPI=false)=0
virtual void setSkipAllPauses(bool)=0
virtual std::vector< uint8_t > state()=0
virtual void resume(bool setTerminateOnResume=false)=0
Definition: v8-inspector.h:396
virtual void sendNotification(std::unique_ptr< StringBuffer > message)=0
virtual void flushProtocolNotifications()=0
virtual ~Channel()=default
virtual void sendResponse(int callId, std::unique_ptr< StringBuffer > message)=0
Definition: v8-inspector.h:353
virtual void externalAsyncTaskFinished(const V8StackTraceId &parent)=0
virtual void asyncTaskStarted(void *task)=0
static std::unique_ptr< V8Inspector > create(v8::Isolate *, V8InspectorClient *)
virtual unsigned exceptionThrown(v8::Local< v8::Context >, StringView message, v8::Local< v8::Value > exception, StringView detailedMessage, StringView url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr< V8StackTrace >, int scriptId)=0
virtual void contextCreated(const V8ContextInfo &)=0
virtual void allAsyncTasksCanceled()=0
virtual ~V8Inspector()=default
virtual V8StackTraceId storeCurrentStackTrace(StringView description)=0
virtual void contextDestroyed(v8::Local< v8::Context >)=0
virtual v8::MaybeLocal< v8::Context > contextById(int contextId)=0
virtual std::unique_ptr< V8InspectorSession > connect(int contextGroupId, Channel *, StringView state, ClientTrustLevel client_trust_level, SessionPauseState=kNotWaitingForDebugger)
Definition: v8-inspector.h:407
virtual void idleFinished()=0
virtual bool associateExceptionData(v8::Local< v8::Context >, v8::Local< v8::Value > exception, v8::Local< v8::Name > key, v8::Local< v8::Value > value)=0
virtual void asyncTaskScheduled(StringView taskName, void *task, bool recurring)=0
virtual void idleStarted()=0
virtual void asyncTaskFinished(void *task)=0
SessionPauseState
Definition: v8-inspector.h:405
virtual void resetContextGroup(int contextGroupId)=0
virtual void exceptionRevoked(v8::Local< v8::Context >, unsigned exceptionId, StringView message)=0
virtual std::unique_ptr< V8StackTrace > captureStackTrace(bool fullStack)=0
ClientTrustLevel
Definition: v8-inspector.h:404
virtual void asyncTaskCanceled(void *task)=0
virtual V8DebuggerId uniqueDebuggerId(int contextId)=0
virtual std::unique_ptr< V8StackTrace > createStackTrace(v8::Local< v8::StackTrace >)=0
virtual void externalAsyncTaskStarted(const V8StackTraceId &parent)=0
Definition: v8-inspector.h:144
virtual StringView topFunctionName() const =0
virtual std::unique_ptr< V8StackTrace > clone()=0
virtual int topLineNumber() const =0
virtual StringView firstNonEmptySourceURL() const =0
virtual std::unique_ptr< protocol::Runtime::API::StackTrace > buildInspectorObject(int maxAsyncDepth) const =0
virtual StringView topSourceURL() const =0
virtual std::unique_ptr< StringBuffer > toString() const =0
virtual int topColumnNumber() const =0
virtual bool isEmpty() const =0
virtual ~V8StackTrace()=default
virtual int topScriptId() const =0
virtual std::vector< V8StackFrame > frames() const =0
Definition: v8-inspector.h:24
Definition: libplatform.h:15
Definition: v8-inspector.h:237
std::unique_ptr< DeepSerializedValue > serializedValue
Definition: v8-inspector.h:245
bool isSuccess
Definition: v8-inspector.h:247
std::unique_ptr< StringBuffer > errorMessage
Definition: v8-inspector.h:246
DeepSerializationResult(std::unique_ptr< DeepSerializedValue > serializedValue)
Definition: v8-inspector.h:238
DeepSerializationResult(std::unique_ptr< StringBuffer > errorMessage)
Definition: v8-inspector.h:241
Definition: v8-inspector.h:229
DeepSerializedValue(std::unique_ptr< StringBuffer > type, v8::MaybeLocal< v8::Value > value={})
Definition: v8-inspector.h:230
std::unique_ptr< StringBuffer > type
Definition: v8-inspector.h:233
v8::MaybeLocal< v8::Value > value
Definition: v8-inspector.h:234
Definition: v8-inspector.h:209
v8::Local< v8::Value > value
Definition: v8-inspector.h:217
ResultType
Definition: v8-inspector.h:210
ResultType type
Definition: v8-inspector.h:216
Definition: v8-inspector.h:137
StringView functionName
Definition: v8-inspector.h:139
int columnNumber
Definition: v8-inspector.h:141
StringView sourceURL
Definition: v8-inspector.h:138
int lineNumber
Definition: v8-inspector.h:140
Definition: v8-inspector.h:334
V8StackTraceId & operator=(const V8StackTraceId &)=default
V8StackTraceId(uintptr_t id, const std::pair< int64_t, int64_t > debugger_id)
V8StackTraceId(StringView)
V8StackTraceId(const V8StackTraceId &)=default
V8StackTraceId & operator=(V8StackTraceId &&) noexcept=default
V8StackTraceId(uintptr_t id, const std::pair< int64_t, int64_t > debugger_id, bool should_pause)
std::pair< int64_t, int64_t > debugger_id
Definition: v8-inspector.h:336
uintptr_t id
Definition: v8-inspector.h:335
#define V8_EXPORT
Definition: v8config.h:793