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

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

Issue 2816043006: [inspector] avoid cloning of async call chains (Closed)
Patch Set: rebased 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
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 81e48085570b648f330e986ab8f895707d677e7a..68d337f681b51a216b8921d9139e72826541e4ce 100644
--- a/src/inspector/v8-debugger-agent-impl.cc
+++ b/src/inspector/v8-debugger-agent-impl.cc
@@ -34,7 +34,6 @@ using protocol::Debugger::BreakpointId;
using protocol::Debugger::CallFrame;
using protocol::Runtime::ExceptionDetails;
using protocol::Runtime::ScriptId;
-using protocol::Runtime::StackTrace;
using protocol::Runtime::RemoteObject;
namespace DebuggerAgentState {
@@ -598,7 +597,8 @@ Response V8DebuggerAgentImpl::searchInContent(
Response V8DebuggerAgentImpl::setScriptSource(
const String16& scriptId, const String16& newContent, Maybe<bool> dryRun,
Maybe<protocol::Array<protocol::Debugger::CallFrame>>* newCallFrames,
- Maybe<bool>* stackChanged, Maybe<StackTrace>* asyncStackTrace,
+ Maybe<bool>* stackChanged,
+ Maybe<protocol::Runtime::StackTrace>* asyncStackTrace,
Maybe<protocol::Runtime::ExceptionDetails>* optOutCompileError) {
if (!enabled()) return Response::Error(kDebuggerNotEnabled);
@@ -631,7 +631,7 @@ Response V8DebuggerAgentImpl::setScriptSource(
Response V8DebuggerAgentImpl::restartFrame(
const String16& callFrameId,
std::unique_ptr<Array<CallFrame>>* newCallFrames,
- Maybe<StackTrace>* asyncStackTrace) {
+ Maybe<protocol::Runtime::StackTrace>* asyncStackTrace) {
if (!isPaused()) return Response::Error(kDebuggerNotPaused);
InjectedScript::CallFrameScope scope(m_inspector, m_session->contextGroupId(),
callFrameId);
@@ -1028,9 +1028,14 @@ Response V8DebuggerAgentImpl::currentCallFrames(
return Response::OK();
}
-std::unique_ptr<StackTrace> V8DebuggerAgentImpl::currentAsyncStackTrace() {
- if (!isPaused()) return nullptr;
- return V8StackTraceImpl::buildInspectorObjectForTail(m_debugger);
+std::unique_ptr<protocol::Runtime::StackTrace>
+V8DebuggerAgentImpl::currentAsyncStackTrace() {
+ std::shared_ptr<AsyncStackTrace> asyncParent =
+ m_debugger->currentAsyncParent();
+ if (!asyncParent) return nullptr;
+ return asyncParent->buildInspectorObject(
+ m_debugger->currentAsyncCreation().get(),
+ m_debugger->maxAsyncCallChainDepth() - 1);
dgozman 2017/04/17 23:03:15 Why -1? Should we turn the parameter into maxChain
kozy 2017/04/18 01:04:38 I'd like to have this value aligned with maxDepth
}
bool V8DebuggerAgentImpl::isPaused() const { return m_debugger->isPaused(); }

Powered by Google App Engine
This is Rietveld 408576698