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

Unified Diff: Source/core/inspector/InspectorDebuggerAgent.cpp

Issue 136333007: DevTools: Implement evaluation on async call frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 11 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 | « Source/core/inspector/InjectedScriptSource.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index 10aa097e4bbec4a348c3f9ee8b50a47a6f265feb..24ec4dd8fba72482a07e04a36e928b95ce7729b7 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -902,7 +902,17 @@ void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const
muteConsole();
}
- injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, returnByValue ? *returnByValue : false, generatePreview ? *generatePreview : false, &result, wasThrown);
+ Vector<ScriptValue> asyncCallStacks;
+ const AsyncCallStackTracker::AsyncCallChain* asyncChain = m_asyncCallStackTracker.isEnabled() ? m_asyncCallStackTracker.currentAsyncCallChain() : 0;
+ if (asyncChain) {
+ const AsyncCallStackTracker::AsyncCallStackVector& callStacks = asyncChain->callStacks();
+ asyncCallStacks.resize(callStacks.size());
+ AsyncCallStackTracker::AsyncCallStackVector::const_iterator it = callStacks.begin();
+ for (size_t i = 0; it != callStacks.end(); ++it, ++i)
+ asyncCallStacks[i] = (*it)->callFrames();
+ }
+
+ injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, asyncCallStacks, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, returnByValue ? *returnByValue : false, generatePreview ? *generatePreview : false, &result, wasThrown);
if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) {
unmuteConsole();
@@ -1036,7 +1046,7 @@ PassRefPtr<Array<CallFrame> > InspectorDebuggerAgent::currentCallFrames()
ASSERT_NOT_REACHED();
return Array<CallFrame>::create();
}
- return injectedScript.wrapCallFrames(m_currentCallStack);
+ return injectedScript.wrapCallFrames(m_currentCallStack, 0);
}
PassRefPtr<StackTrace> InspectorDebuggerAgent::currentAsyncStackTrace()
@@ -1055,9 +1065,10 @@ PassRefPtr<StackTrace> InspectorDebuggerAgent::currentAsyncStackTrace()
if (callStacks.isEmpty())
return 0;
RefPtr<StackTrace> result;
+ int asyncOrdinal = callStacks.size();
for (AsyncCallStackTracker::AsyncCallStackVector::const_reverse_iterator it = callStacks.rbegin(); it != callStacks.rend(); ++it) {
RefPtr<StackTrace> next = StackTrace::create()
- .setCallFrames(injectedScript.wrapCallFrames((*it)->callFrames()))
+ .setCallFrames(injectedScript.wrapCallFrames((*it)->callFrames(), asyncOrdinal--))
.release();
next->setDescription((*it)->description());
if (result)
« no previous file with comments | « Source/core/inspector/InjectedScriptSource.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698