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

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

Issue 2738503006: [inspector] don't make v8::debug::Call for breakProgram. (Closed)
Patch Set: addressed comments Created 3 years, 9 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 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,
« 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