5 #ifndef V8_V8_INSPECTOR_H_ 6 #define V8_V8_INSPECTOR_H_ 38 StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {}
41 : m_is8Bit(true), m_length(length), m_characters8(characters) {}
44 : m_is8Bit(false), m_length(length), m_characters16(characters) {}
46 bool is8Bit()
const {
return m_is8Bit; }
47 size_t length()
const {
return m_length; }
68 static std::unique_ptr<StringBuffer> create(
const StringView&);
76 contextGroupId(contextGroupId),
77 humanReadableName(humanReadableName),
78 hasMemoryOnConsole(false) {}
92 enum NotNullTagEnum { NotNullLiteral };
93 void*
operator new(size_t) =
delete;
94 void*
operator new(size_t, NotNullTagEnum,
void*) =
delete;
95 void*
operator new(size_t,
void*) =
delete;
102 virtual StringView firstNonEmptySourceURL()
const = 0;
103 virtual bool isEmpty()
const = 0;
105 virtual int topLineNumber()
const = 0;
106 virtual int topColumnNumber()
const = 0;
108 virtual StringView topFunctionName()
const = 0;
111 virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
112 buildInspectorObject()
const = 0;
113 virtual std::unique_ptr<StringBuffer> toString()
const = 0;
116 virtual std::unique_ptr<V8StackTrace> clone() = 0;
129 virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0;
132 static bool canDispatchMethod(
const StringView& method);
133 virtual void dispatchProtocolMessage(
const StringView& message) = 0;
134 virtual std::unique_ptr<StringBuffer> stateJSON() = 0;
135 virtual std::vector<std::unique_ptr<protocol::Schema::API::Domain>>
136 supportedDomains() = 0;
139 virtual void schedulePauseOnNextStatement(
const StringView& breakReason,
141 virtual void cancelPauseOnNextStatement() = 0;
142 virtual void breakProgram(
const StringView& breakReason,
144 virtual void setSkipAllPauses(
bool) = 0;
145 virtual void resume() = 0;
146 virtual void stepOver() = 0;
147 virtual std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>>
149 bool caseSensitive,
bool isRegex) = 0;
152 virtual std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(
154 bool generatePreview) = 0;
156 virtual bool unwrapObject(std::unique_ptr<StringBuffer>* error,
159 std::unique_ptr<StringBuffer>* objectGroup) = 0;
160 virtual void releaseObjectGroup(
const StringView&) = 0;
186 int contextGroupId) {
209 typedef void (*TimerCallback)(
void*);
233 V8StackTraceId(uintptr_t
id,
const std::pair<int64_t, int64_t> debugger_id);
236 bool IsInvalid()
const;
247 virtual void resetContextGroup(
int contextGroupId) = 0;
251 virtual void idleStarted() = 0;
252 virtual void idleFinished() = 0;
255 virtual void asyncTaskScheduled(
const StringView& taskName,
void* task,
257 virtual void asyncTaskCanceled(
void* task) = 0;
258 virtual void asyncTaskStarted(
void* task) = 0;
259 virtual void asyncTaskFinished(
void* task) = 0;
260 virtual void allAsyncTasksCanceled() = 0;
264 virtual void externalAsyncTaskStarted(
const V8StackTraceId& parent) = 0;
265 virtual void externalAsyncTaskFinished(
const V8StackTraceId& parent) = 0;
268 virtual unsigned exceptionThrown(
271 const StringView& url,
unsigned lineNumber,
unsigned columnNumber,
272 std::unique_ptr<V8StackTrace>,
int scriptId) = 0;
280 virtual void sendResponse(
int callId,
281 std::unique_ptr<StringBuffer> message) = 0;
282 virtual void sendNotification(std::unique_ptr<StringBuffer> message) = 0;
283 virtual void flushProtocolNotifications() = 0;
285 virtual std::unique_ptr<V8InspectorSession> connect(
289 virtual std::unique_ptr<V8StackTrace> createStackTrace(
291 virtual std::unique_ptr<V8StackTrace> captureStackTrace(
bool fullStack) = 0;
296 #endif // V8_V8_INSPECTOR_H_
virtual v8::Local< v8::Context > ensureDefaultContextInGroup(int contextGroupId)
virtual void cancelTimer(void *data)
virtual void runMessageLoopOnPause(int contextGroupId)
const uint8_t * m_characters8
StringView(const uint16_t *characters, size_t length)
std::pair< int64_t, int64_t > debugger_id
virtual void maxAsyncCallStackDepthChanged(int depth)
virtual bool canExecuteScripts(int contextGroupId)
virtual void runIfWaitingForDebugger(int contextGroupId)
virtual std::unique_ptr< StringBuffer > resourceNameToUrl(const StringView &resourceName)
v8::Local< v8::Context > context
virtual void installAdditionalCommandLineAPI(v8::Local< v8::Context >, v8::Local< v8::Object >)
virtual void consoleTime(const StringView &title)
virtual bool isInspectableHeapObject(v8::Local< v8::Object >)
V8ContextInfo(v8::Local< v8::Context > context, int contextGroupId, const StringView &humanReadableName)
StringView(const uint8_t *characters, size_t length)
virtual bool formatAccessorsAsProperties(v8::Local< v8::Value >)
virtual v8::MaybeLocal< v8::Value > memoryInfo(v8::Isolate *, v8::Local< v8::Context >)
virtual void endEnsureAllContextsInGroup(int contextGroupId)
virtual std::unique_ptr< StringBuffer > valueSubtype(v8::Local< v8::Value >)
virtual void unmuteMetrics(int contextGroupId)
StringView humanReadableName
virtual void beginEnsureAllContextsInGroup(int contextGroupId)
const uint16_t * m_characters16
virtual double currentTimeMS()
const uint8_t * characters8() const
virtual void consoleAPIMessage(int contextGroupId, v8::Isolate::MessageErrorLevel level, const StringView &message, const StringView &url, unsigned lineNumber, unsigned columnNumber, V8StackTrace *)
const uint16_t * characters16() const
virtual void consoleTimeEnd(const StringView &title)
virtual void quitMessageLoopOnPause()
virtual void muteMetrics(int contextGroupId)
virtual void beginUserGesture()
virtual void consoleTimeStamp(const StringView &title)
virtual void startRepeatingTimer(double, TimerCallback, void *data)
virtual void consoleClear(int contextGroupId)
virtual void endUserGesture()