Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: src/inspector/v8-debugger.cc

Issue 2916363002: [inspector] Make pausing on console.assert work with multiple sessions (Closed)
Patch Set: rebased Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index 1c0f823cd79e2aa15f793b4e2d7b48174f46f69f..5729fde00a29b4d96fcc13a5b723d81f946fe37d 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -363,6 +363,18 @@ void V8Debugger::continueProgram(int targetContextGroupId) {
m_executionState.Clear();
}
+void V8Debugger::breakProgramOnAssert(int targetContextGroupId) {
+ if (!enabled()) return;
+ if (m_pauseOnExceptionsState == v8::debug::NoBreakOnException) return;
+ // Don't allow nested breaks.
+ if (isPaused()) return;
+ if (!canBreakProgram()) return;
+ DCHECK(targetContextGroupId);
+ m_targetContextGroupId = targetContextGroupId;
+ m_scheduledAssertBreak = true;
+ v8::debug::BreakRightNow(m_isolate);
+}
+
void V8Debugger::stepIntoStatement(int targetContextGroupId) {
DCHECK(isPaused());
DCHECK(!m_executionState.IsEmpty());
@@ -599,6 +611,7 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
m_breakRequested = false;
bool scheduledOOMBreak = m_scheduledOOMBreak;
+ bool scheduledAssertBreak = m_scheduledAssertBreak;
auto agentCheck = [&scheduledOOMBreak](V8DebuggerAgentImpl* agent) {
return agent->enabled() && (scheduledOOMBreak || !agent->skipAllPauses());
};
@@ -636,12 +649,13 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
m_inspector->forEachSession(
contextGroupId, [&agentCheck, &pausedContext, &exception, &breakpointIds,
- &isPromiseRejection, &isUncaught,
- &scheduledOOMBreak](V8InspectorSessionImpl* session) {
+ &isPromiseRejection, &isUncaught, &scheduledOOMBreak,
+ &scheduledAssertBreak](V8InspectorSessionImpl* session) {
if (agentCheck(session->debuggerAgent())) {
session->debuggerAgent()->didPause(
InspectedContext::contextId(pausedContext), exception,
- breakpointIds, isPromiseRejection, isUncaught, scheduledOOMBreak);
+ breakpointIds, isPromiseRejection, isUncaught, scheduledOOMBreak,
+ scheduledAssertBreak);
}
});
{
@@ -660,6 +674,7 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
if (m_scheduledOOMBreak) m_isolate->RestoreOriginalHeapLimit();
m_scheduledOOMBreak = false;
+ m_scheduledAssertBreak = false;
m_pausedContext.Clear();
m_executionState.Clear();
}
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698