summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/InspectorDebuggerAgent.cpp
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-09-13 16:35:48 +0100
committerIain Merrick <husky@google.com>2010-09-16 12:10:42 +0100
commit5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch)
treeddce1aa5e3b6967a69691892e500897558ff8ab6 /WebCore/inspector/InspectorDebuggerAgent.cpp
parent12bec63ec71e46baba27f0bd9bd9d8067683690a (diff)
downloadexternal_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'WebCore/inspector/InspectorDebuggerAgent.cpp')
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/WebCore/inspector/InspectorDebuggerAgent.cpp b/WebCore/inspector/InspectorDebuggerAgent.cpp
index 357a043..fd9fdf3 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -56,11 +56,14 @@ PassOwnPtr<InspectorDebuggerAgent> InspectorDebuggerAgent::create(InspectorContr
return agent.release();
}
+InspectorDebuggerAgent* InspectorDebuggerAgent::s_debuggerAgentOnBreakpoint = 0;
+
InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorController, InspectorFrontend* frontend)
: m_inspectorController(inspectorController)
, m_frontend(frontend)
, m_pausedScriptState(0)
, m_breakpointsLoaded(false)
+ , m_breakProgramReason(InspectorValue::null())
{
}
@@ -68,6 +71,9 @@ InspectorDebuggerAgent::~InspectorDebuggerAgent()
{
ScriptDebugServer::shared().removeListener(this, m_inspectorController->inspectedPage());
m_pausedScriptState = 0;
+
+ if (this == s_debuggerAgentOnBreakpoint)
+ s_debuggerAgentOnBreakpoint = 0;
}
bool InspectorDebuggerAgent::isDebuggerAlwaysEnabled()
@@ -282,9 +288,12 @@ void InspectorDebuggerAgent::failedToParseSource(const String& url, const String
void InspectorDebuggerAgent::didPause(ScriptState* scriptState)
{
ASSERT(scriptState && !m_pausedScriptState);
+ ASSERT(m_breakProgramReason);
m_pausedScriptState = scriptState;
- RefPtr<InspectorValue> callFrames = currentCallFrames();
- m_frontend->pausedScript(callFrames.get());
+ RefPtr<InspectorObject> details = InspectorObject::create();
+ details->setValue("callFrames", currentCallFrames());
+ details->setValue("reason", m_breakProgramReason);
+ m_frontend->pausedScript(details);
}
void InspectorDebuggerAgent::didContinue()
@@ -293,6 +302,19 @@ void InspectorDebuggerAgent::didContinue()
m_frontend->resumedScript();
}
+void InspectorDebuggerAgent::breakProgram(PassRefPtr<InspectorValue> reason)
+{
+ s_debuggerAgentOnBreakpoint = this;
+ m_breakProgramReason = reason;
+
+ ScriptDebugServer::shared().breakProgram();
+ if (!s_debuggerAgentOnBreakpoint)
+ return;
+
+ s_debuggerAgentOnBreakpoint = 0;
+ m_breakProgramReason = InspectorValue::null();
+}
+
} // namespace WebCore
#endif // ENABLE(JAVASCRIPT_DEBUGGER)