Commit ba14e4d0 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by V8 LUCI CQ

[inspector] Introduce instrumentation pause distinction

Introduce an inspector client interface method for running an
"instrumentation pause" (when an instrumentation breakpoint is hit).
This allows the client to run a more restrictive version of message
pumping on instrumentation breakpoint hits.

If not overriden, the instrumentation pause message loop handler will
run the normal message loop. Such an implementation preserves the
behavior for existing clients.

Bug: chromium:1354043
Change-Id: Id33bb10503d73b59b24e63fd9d24631611f68dee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3863256Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82881}
parent 886cd431
...@@ -219,6 +219,9 @@ class V8_EXPORT V8InspectorClient { ...@@ -219,6 +219,9 @@ class V8_EXPORT V8InspectorClient {
virtual ~V8InspectorClient() = default; virtual ~V8InspectorClient() = default;
virtual void runMessageLoopOnPause(int contextGroupId) {} virtual void runMessageLoopOnPause(int contextGroupId) {}
virtual void runMessageLoopOnInstrumentationPause(int contextGroupId) {
runMessageLoopOnPause(contextGroupId);
}
virtual void quitMessageLoopOnPause() {} virtual void quitMessageLoopOnPause() {}
virtual void runIfWaitingForDebugger(int contextGroupId) {} virtual void runIfWaitingForDebugger(int contextGroupId) {}
......
...@@ -535,7 +535,7 @@ void V8Debugger::BreakOnInstrumentation( ...@@ -535,7 +535,7 @@ void V8Debugger::BreakOnInstrumentation(
}); });
{ {
v8::Context::Scope scope(pausedContext); v8::Context::Scope scope(pausedContext);
m_inspector->client()->runMessageLoopOnPause(contextGroupId); m_inspector->client()->runMessageLoopOnInstrumentationPause(contextGroupId);
m_pausedContextGroupId = 0; m_pausedContextGroupId = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment