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

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

Issue 177773002: Support Promises instrumentation on backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: V8PromiseCustom::setState -> (anonymous namespace)::setStateForPromise + REBASE Created 6 years, 9 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/InspectorInstrumentation.idl » ('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 6e8c6f7e3ac5947b6da24c02ce90c54b0126aaf7..d18518d8559c464f866f493c3a5e262512592aff 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -798,6 +798,29 @@ void InspectorDebuggerAgent::didPerformPromiseTask()
m_asyncCallStackTracker.didFireAsyncCall();
}
+bool InspectorDebuggerAgent::isPromiseTrackerEnabled()
+{
+ return m_promiseTracker.isEnabled();
+}
+
+void InspectorDebuggerAgent::didCreatePromise(const ScriptObject& promise)
+{
+ if (m_promiseTracker.isEnabled())
+ m_promiseTracker.didCreatePromise(promise);
+}
+
+void InspectorDebuggerAgent::didUpdatePromiseParent(const ScriptObject& promise, const ScriptObject& parentPromise)
+{
+ if (m_promiseTracker.isEnabled())
+ m_promiseTracker.didUpdatePromiseParent(promise, parentPromise);
+}
+
+void InspectorDebuggerAgent::didUpdatePromiseState(const ScriptObject& promise, V8PromiseCustom::PromiseState state, const ScriptValue& result)
+{
+ if (m_promiseTracker.isEnabled())
+ m_promiseTracker.didUpdatePromiseState(promise, state, result);
+}
+
void InspectorDebuggerAgent::pause(ErrorString*)
{
if (m_javaScriptPauseScheduled)
@@ -1224,6 +1247,7 @@ void InspectorDebuggerAgent::clear()
m_scripts.clear();
m_breakpointIdToDebugServerBreakpointIds.clear();
m_asyncCallStackTracker.clear();
+ m_promiseTracker.clear();
m_continueToLocationBreakpointId = String();
clearBreakDetails();
m_javaScriptPauseScheduled = false;
@@ -1263,6 +1287,7 @@ void InspectorDebuggerAgent::reset()
m_scripts.clear();
m_breakpointIdToDebugServerBreakpointIds.clear();
m_asyncCallStackTracker.clear();
+ m_promiseTracker.clear();
if (m_frontend)
m_frontend->globalObjectCleared();
}
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/InspectorInstrumentation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698