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

Unified Diff: src/inspector/v8-debugger-agent-impl.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-agent-impl.h ('k') | test/inspector/sessions/pause-on-console-assert.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger-agent-impl.cc
diff --git a/src/inspector/v8-debugger-agent-impl.cc b/src/inspector/v8-debugger-agent-impl.cc
index 0e073b81ca09a97ff9bc3f5e7075b7751c3efb76..db71c5d8d3fc8fe4624012951711a0c785df5eb4 100644
--- a/src/inspector/v8-debugger-agent-impl.cc
+++ b/src/inspector/v8-debugger-agent-impl.cc
@@ -764,6 +764,8 @@ Response V8DebuggerAgentImpl::setPauseOnExceptions(
}
void V8DebuggerAgentImpl::setPauseOnExceptionsImpl(int pauseState) {
+ // TODO(dgozman): this changes the global state and forces all context groups
+ // to pause. We should make this flag be per-context-group.
m_debugger->setPauseOnExceptionsState(
static_cast<v8::debug::ExceptionBreakState>(pauseState));
m_state->setInteger(DebuggerAgentState::pauseOnExceptionsState, pauseState);
@@ -1137,7 +1139,7 @@ void V8DebuggerAgentImpl::didPause(int contextId,
v8::Local<v8::Value> exception,
const std::vector<String16>& hitBreakpoints,
bool isPromiseRejection, bool isUncaught,
- bool isOOMBreak) {
+ bool isOOMBreak, bool isAssert) {
JavaScriptCallFrames frames = m_debugger->currentCallFrames();
m_pausedCallFrames.swap(frames);
v8::HandleScope handles(m_isolate);
@@ -1147,6 +1149,9 @@ void V8DebuggerAgentImpl::didPause(int contextId,
if (isOOMBreak) {
hitReasons.push_back(
std::make_pair(protocol::Debugger::Paused::ReasonEnum::OOM, nullptr));
+ } else if (isAssert) {
+ hitReasons.push_back(std::make_pair(
+ protocol::Debugger::Paused::ReasonEnum::Assert, nullptr));
} else if (!exception.IsEmpty()) {
InjectedScript* injectedScript = nullptr;
m_session->findInjectedScript(contextId, injectedScript);
@@ -1254,15 +1259,6 @@ void V8DebuggerAgentImpl::breakProgram(
}
}
-void V8DebuggerAgentImpl::breakProgramOnException(
- const String16& breakReason,
- std::unique_ptr<protocol::DictionaryValue> data) {
- if (!enabled() ||
- m_debugger->getPauseOnExceptionsState() == v8::debug::NoBreakOnException)
- return;
- breakProgram(breakReason, std::move(data));
-}
-
void V8DebuggerAgentImpl::setBreakpointAt(const String16& scriptId,
int lineNumber, int columnNumber,
BreakpointSource source,
« no previous file with comments | « src/inspector/v8-debugger-agent-impl.h ('k') | test/inspector/sessions/pause-on-console-assert.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698