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

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

Issue 2851853002: [inspector] entered into context before getPossibleBreakpoints call (Closed)
Patch Set: debugger context.. Created 3 years, 8 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 | « no previous file | test/inspector/debugger/get-possible-breakpoints-lazy-error.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 431c297a744888b244eaec5a3ec4ac42c11693be..8af7d5243418c7e559b1b5ce5d7fa2087d9a1217 100644
--- a/src/inspector/v8-debugger-agent-impl.cc
+++ b/src/inspector/v8-debugger-agent-impl.cc
@@ -456,11 +456,15 @@ Response V8DebuggerAgentImpl::getPossibleBreakpoints(
}
auto it = m_scripts.find(scriptId);
if (it == m_scripts.end()) return Response::Error("Script not found");
-
std::vector<v8::debug::BreakLocation> v8Locations;
- if (!it->second->getPossibleBreakpoints(
- v8Start, v8End, restrictToFunction.fromMaybe(false), &v8Locations)) {
- return Response::InternalError();
+ {
+ v8::HandleScope handleScope(m_isolate);
+ v8::Local<v8::Context> debuggerContext =
+ v8::debug::GetDebugContext(m_isolate);
+ v8::Context::Scope contextScope(debuggerContext);
+ v8::TryCatch tryCatch(m_isolate);
+ it->second->getPossibleBreakpoints(
jgruber 2017/05/02 07:00:23 For my understanding, why do we neither check the
kozy 2017/05/04 15:23:41 Reason of linked issue is lazy compilation of scri
jgruber 2017/05/04 15:26:39 I see, thanks for the explanation.
+ v8Start, v8End, restrictToFunction.fromMaybe(false), &v8Locations);
}
*locations = protocol::Array<protocol::Debugger::BreakLocation>::create();
« no previous file with comments | « no previous file | test/inspector/debugger/get-possible-breakpoints-lazy-error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698