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

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

Issue 529723002: [WIP] Protocol for sending information about Promises to frontend. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments + REBASE Created 6 years, 3 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/PromiseTracker.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 fcd4dcccfca8db6489a08463022ca1e8f2f3e2af..abdf1b9769d2fc8a2d11c102ed8ff76e1f744ca0 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -58,6 +58,7 @@ using blink::TypeBuilder::Debugger::CallFrame;
using blink::TypeBuilder::Debugger::CollectionEntry;
using blink::TypeBuilder::Debugger::ExceptionDetails;
using blink::TypeBuilder::Debugger::FunctionDetails;
+using blink::TypeBuilder::Debugger::PromiseDetails;
using blink::TypeBuilder::Debugger::ScriptId;
using blink::TypeBuilder::Debugger::StackTrace;
using blink::TypeBuilder::Runtime::RemoteObject;
@@ -77,6 +78,7 @@ static const char debuggerEnabled[] = "debuggerEnabled";
static const char javaScriptBreakpoints[] = "javaScriptBreakopints";
static const char pauseOnExceptionsState[] = "pauseOnExceptionsState";
static const char asyncCallStackDepth[] = "asyncCallStackDepth";
+static const char promiseTrackerEnabled[] = "promiseTrackerEnabled";
// Breakpoint properties.
static const char url[] = "url";
@@ -164,6 +166,7 @@ void InspectorDebuggerAgent::disable()
m_state->setString(DebuggerAgentState::skipStackPattern, "");
m_state->setBoolean(DebuggerAgentState::skipContentScripts, false);
m_state->setLong(DebuggerAgentState::asyncCallStackDepth, 0);
+ m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false);
m_instrumentingAgents->setInspectorDebuggerAgent(0);
scriptDebugServer().clearBreakpoints();
@@ -229,6 +232,7 @@ void InspectorDebuggerAgent::restore()
m_state->setBoolean(DebuggerAgentState::skipAllPauses, false);
}
asyncCallStackTracker().setAsyncCallStackDepth(m_state->getLong(DebuggerAgentState::asyncCallStackDepth));
+ m_promiseTracker.setEnabled(m_state->getBoolean(DebuggerAgentState::promiseTrackerEnabled));
}
}
@@ -1166,6 +1170,25 @@ void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString*, int depth)
asyncCallStackTracker().setAsyncCallStackDepth(depth);
}
+void InspectorDebuggerAgent::enablePromiseTracker(ErrorString*)
+{
+ m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, true);
+ m_promiseTracker.setEnabled(true);
+}
+
+void InspectorDebuggerAgent::disablePromiseTracker(ErrorString*)
+{
+ m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false);
+ m_promiseTracker.setEnabled(false);
+}
+
+void InspectorDebuggerAgent::getPromises(ErrorString*, RefPtr<Array<PromiseDetails> >& promises)
+{
+ if (!m_promiseTracker.isEnabled())
+ return;
+ promises = m_promiseTracker.promises();
+}
+
void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directiveText)
{
if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptions) {
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/PromiseTracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698