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

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

Issue 74063002: DevTools: Support asynchronous call stacks on backend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 7 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: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index 07b9e851bc62e4b192bc884b774652bb6a491061..48d806950988088429edc5f7003185b8b63a2089 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -655,11 +655,62 @@ void InspectorDebuggerAgent::cancelPauseOnNextStatement()
scriptDebugServer().setPauseOnNextStatement(false);
}
+void InspectorDebuggerAgent::requestAsyncCallFramesIfNeeded()
+{
+ if (m_asyncCallStackTracker.isEnabled())
+ scriptDebugServer().requestAsyncCallFrames();
+}
+
+void InspectorDebuggerAgent::didRequestAsyncCallFrames(ScriptValue callFrames)
+{
+ m_asyncCallStackTracker.didRequestAsyncCallFrames(callFrames);
+}
+
+void InspectorDebuggerAgent::didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singleShot)
+{
+ m_asyncCallStackTracker.didInstallTimer(timerId, singleShot);
+ requestAsyncCallFramesIfNeeded();
+}
+
+void InspectorDebuggerAgent::didRemoveTimer(ExecutionContext*, int timerId)
+{
+ m_asyncCallStackTracker.didRemoveTimer(timerId);
+}
+
+bool InspectorDebuggerAgent::willFireTimer(ExecutionContext*, int timerId)
+{
+ m_asyncCallStackTracker.willFireTimer(timerId);
+ return true;
+}
+
void InspectorDebuggerAgent::didFireTimer()
{
+ m_asyncCallStackTracker.didAsyncCall();
cancelPauseOnNextStatement();
}
+void InspectorDebuggerAgent::didRequestAnimationFrame(Document*, int callbackId)
+{
+ m_asyncCallStackTracker.didRequestAnimationFrame(callbackId);
+ requestAsyncCallFramesIfNeeded();
+}
+
+void InspectorDebuggerAgent::didCancelAnimationFrame(Document*, int callbackId)
+{
+ m_asyncCallStackTracker.didCancelAnimationFrame(callbackId);
+}
+
+bool InspectorDebuggerAgent::willFireAnimationFrame(Document*, int callbackId)
+{
+ m_asyncCallStackTracker.willFireAnimationFrame(callbackId);
+ return true;
+}
+
+void InspectorDebuggerAgent::didFireAnimationFrame()
+{
+ m_asyncCallStackTracker.didAsyncCall();
+}
+
void InspectorDebuggerAgent::didHandleEvent()
{
cancelPauseOnNextStatement();
@@ -987,7 +1038,7 @@ void InspectorDebuggerAgent::didPause(ScriptState* scriptState, const ScriptValu
InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
if (!injectedScript.hasNoValue()) {
m_breakReason = InspectorFrontend::Debugger::Reason::Exception;
- m_breakAuxData = injectedScript.wrapObject(exception, "backtrace")->openAccessors();
+ m_breakAuxData = injectedScript.wrapObject(exception, InspectorDebuggerAgent::backtraceObjectGroup)->openAccessors();
// m_breakAuxData might be null after this.
}
}
@@ -1045,6 +1096,7 @@ void InspectorDebuggerAgent::clear()
m_currentCallStack = ScriptValue();
m_scripts.clear();
m_breakpointIdToDebugServerBreakpointIds.clear();
+ m_asyncCallStackTracker.clear();
m_continueToLocationBreakpointId = String();
clearBreakDetails();
m_javaScriptPauseScheduled = false;
@@ -1083,6 +1135,7 @@ void InspectorDebuggerAgent::reset()
{
m_scripts.clear();
m_breakpointIdToDebugServerBreakpointIds.clear();
+ m_asyncCallStackTracker.clear();
if (m_frontend)
m_frontend->globalObjectCleared();
}

Powered by Google App Engine
This is Rietveld 408576698