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

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: Created 6 years, 4 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
Index: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index ad65eddec478c5bb615129e2b80ef6d230b0956c..7935b5bee9ca9dabbd3f18314033604ff86c4d7c 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";
@@ -162,6 +164,7 @@ void InspectorDebuggerAgent::disable()
m_state->setString(DebuggerAgentState::skipStackPattern, "");
m_state->setLong(DebuggerAgentState::asyncCallStackDepth, 0);
m_instrumentingAgents->setInspectorDebuggerAgent(0);
+ m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false);
aandrey 2014/09/01 13:39:27 move 1 line above
Alexandra Mikhaylova 2014/09/02 11:39:29 Done.
scriptDebugServer().clearBreakpoints();
scriptDebugServer().clearCompiledScripts();
@@ -225,6 +228,10 @@ void InspectorDebuggerAgent::restore()
m_state->setBoolean(DebuggerAgentState::skipAllPauses, false);
}
asyncCallStackTracker().setAsyncCallStackDepth(m_state->getLong(DebuggerAgentState::asyncCallStackDepth));
+ if (m_state->getBoolean(DebuggerAgentState::promiseTrackerEnabled))
+ m_promiseTracker.enable();
aandrey 2014/09/01 13:39:27 setEnabled()?
Alexandra Mikhaylova 2014/09/02 11:39:29 Done, should we also change InspectorDebuggerAgent
+ else
+ m_promiseTracker.disable();
}
}
@@ -1163,6 +1170,25 @@ void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString*, int depth)
asyncCallStackTracker().setAsyncCallStackDepth(depth);
}
+void InspectorDebuggerAgent::enablePromiseTracker(ErrorString*)
+{
+ m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, true);
+ m_promiseTracker.enable();
+}
+
+void InspectorDebuggerAgent::disablePromiseTracker(ErrorString*)
+{
+ m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false);
+ m_promiseTracker.disable();
+}
+
+void InspectorDebuggerAgent::getPromises(ErrorString*, RefPtr<Array<PromiseDetails> >& promises)
+{
+ if (!m_promiseTracker.isEnabled())
+ return;
+ promises = m_promiseTracker.getPromises();
+}
+
void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directiveText)
{
if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptions) {

Powered by Google App Engine
This is Rietveld 408576698