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

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

Issue 2396193002: [inspector] move changeBreakpointState from debugger-script to native (Closed)
Patch Set: Created 4 years, 2 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
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index d393f81ad4a38a3a5ebf6ce4a92973c0fe91646b..2de5cf78091b3f26c95fdbe9e9093fb5da17ef01 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -55,7 +55,8 @@ V8Debugger::V8Debugger(v8::Isolate* isolate, V8InspectorImpl* inspector)
m_breakpointsActivated(true),
m_runningNestedMessageLoop(false),
m_ignoreScriptParsedEventsCounter(0),
- m_maxAsyncCallStackDepth(0) {}
+ m_maxAsyncCallStackDepth(0),
+ m_pauseOnExceptionsState(DontPauseOnExceptions) {}
V8Debugger::~V8Debugger() {}
@@ -66,6 +67,8 @@ void V8Debugger::enable() {
v8::Debug::SetDebugEventListener(m_isolate, &V8Debugger::v8DebugEventCallback,
v8::External::New(m_isolate, this));
m_debuggerContext.Reset(m_isolate, v8::Debug::GetDebugContext(m_isolate));
+ v8::Debug::ChangeBreakOnException(m_isolate, v8::NoBreakOnException);
+ m_pauseOnExceptionsState = DontPauseOnExceptions;
compileDebuggerScript();
}
@@ -251,26 +254,20 @@ void V8Debugger::setBreakpointsActivated(bool activated) {
V8Debugger::PauseOnExceptionsState V8Debugger::getPauseOnExceptionsState() {
DCHECK(enabled());
- v8::HandleScope scope(m_isolate);
- v8::Local<v8::Context> context = debuggerContext();
- v8::Context::Scope contextScope(context);
-
- v8::Local<v8::Value> argv[] = {v8::Undefined(m_isolate)};
- v8::Local<v8::Value> result =
- callDebuggerMethod("pauseOnExceptionsState", 0, argv).ToLocalChecked();
- return static_cast<V8Debugger::PauseOnExceptionsState>(
- result->Int32Value(context).FromJust());
+ return m_pauseOnExceptionsState;
}
void V8Debugger::setPauseOnExceptionsState(
PauseOnExceptionsState pauseOnExceptionsState) {
DCHECK(enabled());
- v8::HandleScope scope(m_isolate);
- v8::Context::Scope contextScope(debuggerContext());
-
- v8::Local<v8::Value> argv[] = {
- v8::Int32::New(m_isolate, pauseOnExceptionsState)};
- callDebuggerMethod("setPauseOnExceptionsState", 1, argv);
+ if (m_pauseOnExceptionsState == pauseOnExceptionsState) return;
+ if (pauseOnExceptionsState == DontPauseOnExceptions)
+ v8::Debug::ChangeBreakOnException(m_isolate, v8::NoBreakOnException);
+ else if (pauseOnExceptionsState == PauseOnUncaughtExceptions)
+ v8::Debug::ChangeBreakOnException(m_isolate, v8::BreakOnUncaughtException);
+ else
+ v8::Debug::ChangeBreakOnException(m_isolate, v8::BreakOnAnyException);
+ m_pauseOnExceptionsState = pauseOnExceptionsState;
}
void V8Debugger::setPauseOnNextStatement(bool pause) {

Powered by Google App Engine
This is Rietveld 408576698