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

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

Issue 374903002: DevTools: Async call stacks for Promises and Object.observe. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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/InspectorDebuggerAgent.h ('k') | Source/core/inspector/ScriptDebugListener.h » ('j') | 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 464f54a6feca08ddca75cf972c032b5c62f2cd17..367ee470d56351c9fa08006a28934814eca24a1a 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -60,6 +60,14 @@ using WebCore::TypeBuilder::Debugger::ScriptId;
using WebCore::TypeBuilder::Debugger::StackTrace;
using WebCore::TypeBuilder::Runtime::RemoteObject;
+namespace {
+
+static const char v8AsyncTaskEventEnqueue[] = "enqueue";
+static const char v8AsyncTaskEventWillHandle[] = "willHandle";
+static const char v8AsyncTaskEventDidHandle[] = "didHandle";
+
+}
+
namespace WebCore {
namespace DebuggerAgentState {
@@ -834,6 +842,20 @@ void InspectorDebuggerAgent::didPerformExecutionContextTask()
m_asyncCallStackTracker.didFireAsyncCall();
}
+void InspectorDebuggerAgent::didReceiveV8AsyncTaskEvent(ExecutionContext* context, const String& eventType, const String& eventName, int id)
+{
+ if (!m_asyncCallStackTracker.isEnabled())
+ return;
+ if (eventType == v8AsyncTaskEventEnqueue)
+ m_asyncCallStackTracker.didEnqueueV8AsyncTask(context, eventName, id, scriptDebugServer().currentCallFramesForAsyncStack());
+ else if (eventType == v8AsyncTaskEventWillHandle)
+ m_asyncCallStackTracker.willHandleV8AsyncTask(context, eventName, id);
+ else if (eventType == v8AsyncTaskEventDidHandle)
+ m_asyncCallStackTracker.didFireAsyncCall();
+ else
+ ASSERT_NOT_REACHED();
+}
+
void InspectorDebuggerAgent::pause(ErrorString*)
{
if (m_javaScriptPauseScheduled || isPaused())
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/ScriptDebugListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698