Index: src/inspector/v8-debugger.cc |
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc |
index 5e5f460679c94b1d55bbf5301f168888eddc05fb..1749efcf25d287949f1731d062c39e1b5de92c7e 100644 |
--- a/src/inspector/v8-debugger.cc |
+++ b/src/inspector/v8-debugger.cc |
@@ -345,16 +345,7 @@ void V8Debugger::breakProgram() { |
// Don't allow nested breaks. |
if (isPaused()) return; |
if (!canBreakProgram()) return; |
- |
- v8::HandleScope scope(m_isolate); |
- v8::Local<v8::Function> breakFunction; |
- if (!v8::Function::New(m_isolate->GetCurrentContext(), |
- &V8Debugger::breakProgramCallback, |
- v8::External::New(m_isolate, this), 0, |
- v8::ConstructorBehavior::kThrow) |
- .ToLocal(&breakFunction)) |
- return; |
- v8::debug::Call(debuggerContext(), breakFunction).ToLocalChecked(); |
+ v8::debug::BreakRightNow(m_isolate); |
} |
void V8Debugger::continueProgram() { |
@@ -505,25 +496,6 @@ JavaScriptCallFrames V8Debugger::currentCallFrames(int limit) { |
return callFrames; |
} |
-static V8Debugger* toV8Debugger(v8::Local<v8::Value> data) { |
- void* p = v8::Local<v8::External>::Cast(data)->Value(); |
- return static_cast<V8Debugger*>(p); |
-} |
- |
-void V8Debugger::breakProgramCallback( |
- const v8::FunctionCallbackInfo<v8::Value>& info) { |
- DCHECK_EQ(info.Length(), 2); |
- V8Debugger* thisPtr = toV8Debugger(info.Data()); |
- if (!thisPtr->enabled()) return; |
- v8::Local<v8::Context> pausedContext = |
- thisPtr->m_isolate->GetCurrentContext(); |
- v8::Local<v8::Value> exception; |
- v8::Local<v8::Array> hitBreakpoints; |
- thisPtr->handleProgramBreak(pausedContext, |
- v8::Local<v8::Object>::Cast(info[0]), exception, |
- hitBreakpoints); |
-} |
- |
void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext, |
v8::Local<v8::Object> executionState, |
v8::Local<v8::Value> exception, |