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

Unified Diff: src/inspector/java-script-call-frame.cc

Issue 2510093002: [inspector] gracefully handle stack overflows in the inspector. (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
Index: src/inspector/java-script-call-frame.cc
diff --git a/src/inspector/java-script-call-frame.cc b/src/inspector/java-script-call-frame.cc
index 2da4f042497a97dee0034422de43f515aeeb3165..9334bb19331faa9a103051efb6e9110d0293368d 100644
--- a/src/inspector/java-script-call-frame.cc
+++ b/src/inspector/java-script-call-frame.cc
@@ -91,7 +91,7 @@ bool JavaScriptCallFrame::isAtReturn() const {
return result.As<v8::Boolean>()->BooleanValue(context).FromMaybe(false);
}
-v8::Local<v8::Object> JavaScriptCallFrame::details() const {
+v8::MaybeLocal<v8::Value> JavaScriptCallFrame::details() const {
kozy 2016/11/17 16:36:25 Can we return v8::MaybeLocal<v8::Object> and check
Yang 2016/12/12 12:23:20 Removed.
v8::MicrotasksScope microtasks(m_isolate,
v8::MicrotasksScope::kDoNotRunMicrotasks);
v8::Local<v8::Context> context =
@@ -101,8 +101,8 @@ v8::Local<v8::Object> JavaScriptCallFrame::details() const {
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(
callFrame->Get(context, toV8StringInternalized(m_isolate, "details"))
.ToLocalChecked());
- return v8::Local<v8::Object>::Cast(
- func->Call(context, callFrame, 0, nullptr).ToLocalChecked());
+ v8::TryCatch try_catch;
+ return func->Call(context, callFrame, 0, nullptr);
}
v8::MaybeLocal<v8::Value> JavaScriptCallFrame::evaluate(
@@ -116,6 +116,7 @@ v8::MaybeLocal<v8::Value> JavaScriptCallFrame::evaluate(
v8::Local<v8::Function> evalFunction = v8::Local<v8::Function>::Cast(
callFrame->Get(context, toV8StringInternalized(m_isolate, "evaluate"))
.ToLocalChecked());
+ v8::TryCatch try_catch;
kozy 2016/11/17 16:36:25 We have try_catch in V8DebuggerAgentImpl::evaluate
Yang 2016/12/12 12:23:20 Done.
return evalFunction->Call(context, callFrame, 1, &expression);
}
@@ -129,6 +130,7 @@ v8::MaybeLocal<v8::Value> JavaScriptCallFrame::restart() {
v8::Local<v8::Function> restartFunction = v8::Local<v8::Function>::Cast(
callFrame->Get(context, toV8StringInternalized(m_isolate, "restart"))
.ToLocalChecked());
+ v8::TryCatch try_catch;
v8::DebugInterface::SetLiveEditEnabled(m_isolate, true);
v8::MaybeLocal<v8::Value> result = restartFunction->Call(
m_debuggerContext.Get(m_isolate), callFrame, 0, nullptr);
@@ -154,6 +156,7 @@ v8::MaybeLocal<v8::Value> JavaScriptCallFrame::setVariableValue(
v8::Local<v8::Value> argv[] = {
v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)),
variableName, newValue};
+ v8::TryCatch try_catch;
return setVariableValueFunction->Call(context, callFrame, arraysize(argv),
argv);
}

Powered by Google App Engine
This is Rietveld 408576698