5 #ifndef V8_V8_INSPECTOR_H_ 6 #define V8_V8_INSPECTOR_H_ 38 StringView() : m_is8Bit(
true), m_length(0), m_characters8(
nullptr) {}
40 StringView(
const uint8_t* characters,
size_t length)
41 : m_is8Bit(
true), m_length(length), m_characters8(characters) {}
43 StringView(
const uint16_t* characters,
size_t length)
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; }
51 const uint8_t* characters8()
const {
return m_characters8; }
52 const uint16_t* characters16()
const {
return m_characters16; }
58 const uint8_t* m_characters8;
59 const uint16_t* m_characters16;
68 static std::unique_ptr<StringBuffer> create(
const StringView&);
76 contextGroupId(contextGroupId),
77 humanReadableName(humanReadableName),
78 hasMemoryOnConsole(
false) {}
86 bool hasMemoryOnConsole;
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;
167 virtual void runMessageLoopOnPause(
int contextGroupId) {}
168 virtual void quitMessageLoopOnPause() {}
169 virtual void runIfWaitingForDebugger(
int contextGroupId) {}
171 virtual void muteMetrics(
int contextGroupId) {}
172 virtual void unmuteMetrics(
int contextGroupId) {}
174 virtual void beginUserGesture() {}
175 virtual void endUserGesture() {}
186 int contextGroupId) {
189 virtual void beginEnsureAllContextsInGroup(
int contextGroupId) {}
190 virtual void endEnsureAllContextsInGroup(
int contextGroupId) {}
194 virtual void consoleAPIMessage(
int contextGroupId,
195 v8::Isolate::MessageErrorLevel level,
204 virtual void consoleTime(
const StringView& title) {}
205 virtual void consoleTimeEnd(
const StringView& title) {}
206 virtual void consoleTimeStamp(
const StringView& title) {}
207 virtual void consoleClear(
int contextGroupId) {}
208 virtual double currentTimeMS() {
return 0; }
209 typedef void (*TimerCallback)(
void*);
210 virtual void startRepeatingTimer(
double, TimerCallback,
void* data) {}
211 virtual void cancelTimer(
void* data) {}
215 virtual bool canExecuteScripts(
int contextGroupId) {
return true; }
217 virtual void maxAsyncCallStackDepthChanged(
int depth) {}
219 virtual std::unique_ptr<StringBuffer> resourceNameToUrl(
230 std::pair<int64_t, int64_t> debugger_id;
236 bool IsInvalid()
const;
247 virtual void resetContextGroup(
int contextGroupId) = 0;
252 virtual void idleStarted() = 0;
253 virtual void idleFinished() = 0;
256 virtual void asyncTaskScheduled(
const StringView& taskName,
void* task,
258 virtual void asyncTaskCanceled(
void* task) = 0;
259 virtual void asyncTaskStarted(
void* task) = 0;
260 virtual void asyncTaskFinished(
void* task) = 0;
261 virtual void allAsyncTasksCanceled() = 0;
265 virtual void externalAsyncTaskStarted(
const V8StackTraceId& parent) = 0;
266 virtual void externalAsyncTaskFinished(
const V8StackTraceId& parent) = 0;
269 virtual unsigned exceptionThrown(
272 const StringView& url,
unsigned lineNumber,
unsigned columnNumber,
273 std::unique_ptr<V8StackTrace>,
int scriptId) = 0;
281 virtual void sendResponse(
int callId,
282 std::unique_ptr<StringBuffer> message) = 0;
283 virtual void sendNotification(std::unique_ptr<StringBuffer> message) = 0;
284 virtual void flushProtocolNotifications() = 0;
286 virtual std::unique_ptr<V8InspectorSession> connect(
290 virtual std::unique_ptr<V8StackTrace> createStackTrace(
292 virtual std::unique_ptr<V8StackTrace> captureStackTrace(
bool fullStack) = 0;
297 #endif // V8_V8_INSPECTOR_H_