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

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

Issue 2482513002: [inspector] use debuggerContext as current in getPossibleBreakpoints (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | test/inspector/debugger/get-possible-breakpoints.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 8c9e9054a2143706c066d249d13c66b42ca9d7fa..325d0a2a34b90eeda91062163e011abecfef25d5 100644
--- a/src/inspector/v8-debugger-agent-impl.cc
+++ b/src/inspector/v8-debugger-agent-impl.cc
@@ -355,9 +355,10 @@ Response V8DebuggerAgentImpl::getPossibleBreakpoints(
std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) {
String16 scriptId = start->getScriptId();
- if (start->getLineNumber() < 0 || start->getColumnNumber(0) < 0)
+ if (start->getLineNumber() < 0 || start->getColumnNumber(0) < 0) {
return Response::Error(
"start.lineNumber and start.columnNumber should be >= 0");
+ }
v8::DebugInterface::Location v8Start(start->getLineNumber(),
start->getColumnNumber(0));
@@ -375,6 +376,9 @@ Response V8DebuggerAgentImpl::getPossibleBreakpoints(
auto it = m_scripts.find(scriptId);
if (it == m_scripts.end()) return Response::Error("Script not found");
+ v8::HandleScope handleScope(m_isolate);
+ v8::Context::Scope scope(v8::DebugInterface::GetDebugContext(m_isolate));
+
std::vector<v8::DebugInterface::Location> v8Locations;
if (!it->second->getPossibleBreakpoints(v8Start, v8End, &v8Locations))
return Response::InternalError();
« no previous file with comments | « no previous file | test/inspector/debugger/get-possible-breakpoints.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698