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

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

Issue 2396193002: [inspector] move changeBreakpointState from debugger-script to native (Closed)
Patch Set: rebased 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
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.cc » ('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 f84e96d9e1ad14aff0a29f0a62279c161ee7371f..9ef84ecfb71f601f116d45e6823e83df6e473ed2 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(v8::DebugInterface::NoBreakOnException) {}
V8Debugger::~V8Debugger() {}
@@ -68,6 +69,9 @@ void V8Debugger::enable() {
v8::External::New(m_isolate, this));
m_debuggerContext.Reset(m_isolate,
v8::DebugInterface::GetDebugContext(m_isolate));
+ v8::DebugInterface::ChangeBreakOnException(
+ m_isolate, v8::DebugInterface::NoBreakOnException);
+ m_pauseOnExceptionsState = v8::DebugInterface::NoBreakOnException;
compileDebuggerScript();
}
@@ -252,28 +256,18 @@ void V8Debugger::setBreakpointsActivated(bool activated) {
m_breakpointsActivated = activated;
}
-V8Debugger::PauseOnExceptionsState V8Debugger::getPauseOnExceptionsState() {
+v8::DebugInterface::ExceptionBreakState
+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) {
+ v8::DebugInterface::ExceptionBreakState 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;
+ v8::DebugInterface::ChangeBreakOnException(m_isolate, pauseOnExceptionsState);
+ m_pauseOnExceptionsState = pauseOnExceptionsState;
}
void V8Debugger::setPauseOnNextStatement(bool pause) {
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698