<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[162799] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/162799">162799</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-26 00:39:12 -0800 (Sun, 26 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Move InspectorDebuggerAgent into JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=127629
Rubber-stamped by Sam Weinig.
Source/JavaScriptCore:
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
- Add new files to the build.
- Also, since non REMOTE_INSPECTOR ports cannot yet connect to a
JSGlobalObject for inspection remove those files as they don't
need to be built.
* inspector/EventLoop.cpp: Added.
(Inspector::EventLoop::cycle):
* inspector/EventLoop.h: Added.
(Inspector::EventLoop::EventLoop):
(Inspector::EventLoop::ended):
Add a JavaScriptCore version of EventLoop. This is currently only
used by the Mac port for JSGlobalObject remote inspection. Keep
the WebCore/platform version alive because for the Mac port it does
slightly different things involving AppKit.
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
Create DebuggerAgent and hook up ScriptDebugServer where needed.
* inspector/JSGlobalObjectScriptDebugServer.cpp: Added.
(Inspector::JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer):
(Inspector::JSGlobalObjectScriptDebugServer::addListener):
(Inspector::JSGlobalObjectScriptDebugServer::removeListener):
(Inspector::JSGlobalObjectScriptDebugServer::recompileAllJSFunctions):
(Inspector::JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused):
* inspector/JSGlobalObjectScriptDebugServer.h: Added.
Simple implementation of ScriptDebugServer with a JSGlobalObject.
* inspector/agents/InspectorDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDebuggerAgent.cpp.
* inspector/agents/InspectorDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDebuggerAgent.h.
Copied from WebCore. A few methods need to be made virtual so that Web implementations
can override and extend the funcitonality. E.g. sourceMapURLForScript and enable/disable.
* inspector/agents/JSGlobalObjectDebuggerAgent.cpp: Added.
* inspector/agents/JSGlobalObjectDebuggerAgent.h: Added.
(Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent):
(Inspector::JSGlobalObjectDebuggerAgent::startListeningScriptDebugServer):
(Inspector::JSGlobalObjectDebuggerAgent::stopListeningScriptDebugServer):
(Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):
Simple implementation of DebuggerAGent with a JSGlobalObject.
Source/WebCore:
Test: inspector-protocol/debugger/pause-on-assert.html
* CMakeLists.txt:
* ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h: Added.
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
- Remove InspectorDebuggerAgent.
- Add WebDebuggerAgent (shared between Page and Worker).
* inspector/WebDebuggerAgent.h: Added.
(WebCore::WebDebuggerAgent::~WebDebuggerAgent):
* inspector/WebDebuggerAgent.cpp: Added.
(WebCore::WebDebuggerAgent::WebDebuggerAgent):
(WebCore::WebDebuggerAgent::enable):
(WebCore::WebDebuggerAgent::disable):
Shared code for Page and Worker debugger agents.
Instrumenting agents is a concept in WebCore only,
and the Debugger agent is only in the instrumenting
agents list when it is enabled and removed when disabled.
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorDebuggerAgent):
(WebCore::InstrumentingAgents::setInspectorDebuggerAgent):
* inspector/InspectorDOMDebuggerAgent.cpp:
* inspector/InspectorDOMDebuggerAgent.h:
Update namespace for debugger agent.
* inspector/InspectorInstrumentation.cpp:
(WebCore::isConsoleAssertMessage):
(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
DebuggerAgent in JavaScriptCore does not yet know about console
types. So temporarily handle it here. We need to give JavaScriptCore
some concept of Console messages and types.
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::enable):
(WebCore::PageDebuggerAgent::disable):
(WebCore::PageDebuggerAgent::sourceMapURLForScript):
(WebCore::PageDebuggerAgent::injectedScriptForEval):
* inspector/PageDebuggerAgent.h:
* inspector/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):
* inspector/WorkerDebuggerAgent.h:
Modernize the Page and Worker debugger agents.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
New constructors for the debugger agents.
LayoutTests:
Add a test that we pause in the debugger for console.assert failures
when the DebuggerAgent is enabled.
* inspector-protocol/debugger/pause-on-assert-expected.txt: Added.
* inspector-protocol/debugger/pause-on-assert.html: Added.
* inspector-protocol/debugger/resources/assert.js: Added.
(assertTrue):
(assertFalse):
(assertCondition):
(assertConditionWithMessage):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreGNUmakefilelistam">trunk/Source/JavaScriptCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorAllInOnecpp">trunk/Source/WebCore/inspector/InspectorAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllercpp">trunk/Source/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllerh">trunk/Source/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMDebuggerAgenth">trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationcpp">trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInstrumentingAgentsh">trunk/Source/WebCore/inspector/InstrumentingAgents.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageDebuggerAgentcpp">trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageDebuggerAgenth">trunk/Source/WebCore/inspector/PageDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerDebuggerAgentcpp">trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerDebuggerAgenth">trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerInspectorControllercpp">trunk/Source/WebCore/inspector/WorkerInspectorController.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggerpauseonassertexpectedtxt">trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggerpauseonasserthtml">trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert.html</a></li>
<li><a href="#trunkLayoutTestsinspectorprotocoldebuggerresourcesassertjs">trunk/LayoutTests/inspector-protocol/debugger/resources/assert.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorEventLoopcpp">trunk/Source/JavaScriptCore/inspector/EventLoop.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorEventLooph">trunk/Source/JavaScriptCore/inspector/EventLoop.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServerh">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgenth">trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgenth">trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersinspectoragentsInspectorDebuggerAgenth">trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebDebuggerAgentcpp">trunk/Source/WebCore/inspector/WebDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebDebuggerAgenth">trunk/Source/WebCore/inspector/WebDebuggerAgent.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreinspectorInspectorDebuggerAgentcpp">trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDebuggerAgenth">trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/LayoutTests/ChangeLog        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-01-26 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Move InspectorDebuggerAgent into JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=127629
+
+ Rubber-stamped by Sam Weinig.
+
+ Add a test that we pause in the debugger for console.assert failures
+ when the DebuggerAgent is enabled.
+
+ * inspector-protocol/debugger/pause-on-assert-expected.txt: Added.
+ * inspector-protocol/debugger/pause-on-assert.html: Added.
+ * inspector-protocol/debugger/resources/assert.js: Added.
+ (assertTrue):
+ (assertFalse):
+ (assertCondition):
+ (assertConditionWithMessage):
+
</ins><span class="cx"> 2014-01-25 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove dead code from the JSC profiler.
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggerpauseonassertexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert-expected.txt (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert-expected.txt         (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert-expected.txt        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+CONSOLE MESSAGE: line 10: Should always fail.
+CONSOLE MESSAGE: line 22: ASSERT message
+Test that a failing console.assert will pause in the debugger with an optional message.
+
+Should not pause on passing assert.
+inside assertOkay
+Should pause on failing assert.
+inside assertFalse
+PASS: Paused!
+Should not pause on passing assert.
+inside assertCondition, and condition is true
+Should pause on failing assert.
+inside assertCondition, and condition is false
+PASS: Paused!
+Should not pause on passing assert.
+inside assertConditionWithMessage, and condition is true
+Should pause on failing assert and include a message.
+inside assertConditionWithMessage, and condition is false
+PASS: Paused!
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggerpauseonasserthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert.html (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert.html         (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger/pause-on-assert.html        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+<html>
+<head>
+<script src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
+<script src="resources/assert.js"></script>
+<script>
+function test()
+{
+ InspectorTest.sendCommand("Debugger.enable", {});
+ InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorTest.checkForError);
+
+ var step = null;
+ var steps = [
+ {
+ message: "Should not pause on passing assert.",
+ evaluate: "assertTrue()",
+ pause: false,
+ },
+ {
+ message: "Should pause on failing assert.",
+ evaluate: "assertFalse()",
+ pause: true,
+ },
+ {
+ message: "Should not pause on passing assert.",
+ evaluate: "assertCondition(window)",
+ pause: false,
+ },
+ {
+ message: "Should pause on failing assert.",
+ evaluate: "assertCondition(window === null)",
+ pause: true,
+ },
+ {
+ message: "Should not pause on passing assert.",
+ evaluate: "assertConditionWithMessage(window, 'Should not happen')",
+ pause: false,
+ },
+ {
+ message: "Should pause on failing assert and include a message.",
+ evaluate: "assertConditionWithMessage(window === null, 'ASSERT message')",
+ pause: true,
+ },
+ ];
+
+ InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
+ {
+ if (step.pause)
+ InspectorTest.log("PASS: Paused!");
+ else
+ InspectorTest.log("FAIL: Paused when unexpected");
+
+ InspectorTest.sendCommand("Debugger.resume", {}, runNextStep);
+ }
+
+ function runNextStep() {
+ step = steps.shift();
+ if (!step) {
+ InspectorTest.completeTest();
+ return;
+ }
+
+ // Evalute the command inside a setTimeout so that we can hit exceptions and break.
+ // Otherwise, evaluating through RuntimeAgent will not trigger a pause.
+ // Likewise, if no pause is expected wait for a bit before continuing.
+ InspectorTest.log(step.message);
+ InspectorTest.sendCommand("Runtime.evaluate", {expression: "setTimeout(function(){" + step.evaluate + "}, 0)"}, function(responseObject) {
+ InspectorTest.checkForError(responseObject);
+ if (!step.pause)
+ setTimeout(runNextStep, 20);
+ });
+ }
+
+ runNextStep();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Test that a failing console.assert will pause in the debugger with an optional message.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorprotocoldebuggerresourcesassertjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector-protocol/debugger/resources/assert.js (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector-protocol/debugger/resources/assert.js         (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger/resources/assert.js        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+function assertTrue()
+{
+ log("inside assertOkay");
+ console.assert(true, "Should never happen.");
+}
+
+function assertFalse()
+{
+ log("inside assertFalse");
+ console.assert(false, "Should always fail.");
+}
+
+function assertCondition(condition)
+{
+ log("inside assertCondition, and condition is " + !!condition);
+ console.assert(condition);
+}
+
+function assertConditionWithMessage(condition, message)
+{
+ log("inside assertConditionWithMessage, and condition is " + !!condition);
+ console.assert(condition, message);
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -242,8 +242,8 @@
</span><span class="cx"> inspector/JavaScriptCallFrame.cpp
</span><span class="cx"> inspector/ScriptDebugServer.cpp
</span><span class="cx"> inspector/agents/InspectorAgent.cpp
</span><ins>+ inspector/agents/InspectorDebuggerAgent.cpp
</ins><span class="cx"> inspector/agents/InspectorRuntimeAgent.cpp
</span><del>- inspector/agents/JSGlobalObjectRuntimeAgent.cpp
</del><span class="cx">
</span><span class="cx"> interpreter/AbstractPC.cpp
</span><span class="cx"> interpreter/CallFrame.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2014-01-26 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Move InspectorDebuggerAgent into JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=127629
+
+ Rubber-stamped by Sam Weinig.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ - Add new files to the build.
+ - Also, since non REMOTE_INSPECTOR ports cannot yet connect to a
+ JSGlobalObject for inspection remove those files as they don't
+ need to be built.
+
+ * inspector/EventLoop.cpp: Added.
+ (Inspector::EventLoop::cycle):
+ * inspector/EventLoop.h: Added.
+ (Inspector::EventLoop::EventLoop):
+ (Inspector::EventLoop::ended):
+ Add a JavaScriptCore version of EventLoop. This is currently only
+ used by the Mac port for JSGlobalObject remote inspection. Keep
+ the WebCore/platform version alive because for the Mac port it does
+ slightly different things involving AppKit.
+
+ * inspector/JSGlobalObjectInspectorController.cpp:
+ (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
+ Create DebuggerAgent and hook up ScriptDebugServer where needed.
+
+ * inspector/JSGlobalObjectScriptDebugServer.cpp: Added.
+ (Inspector::JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer):
+ (Inspector::JSGlobalObjectScriptDebugServer::addListener):
+ (Inspector::JSGlobalObjectScriptDebugServer::removeListener):
+ (Inspector::JSGlobalObjectScriptDebugServer::recompileAllJSFunctions):
+ (Inspector::JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused):
+ * inspector/JSGlobalObjectScriptDebugServer.h: Added.
+ Simple implementation of ScriptDebugServer with a JSGlobalObject.
+
+ * inspector/agents/InspectorDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDebuggerAgent.cpp.
+ * inspector/agents/InspectorDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDebuggerAgent.h.
+ Copied from WebCore. A few methods need to be made virtual so that Web implementations
+ can override and extend the funcitonality. E.g. sourceMapURLForScript and enable/disable.
+
+ * inspector/agents/JSGlobalObjectDebuggerAgent.cpp: Added.
+ * inspector/agents/JSGlobalObjectDebuggerAgent.h: Added.
+ (Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent):
+ (Inspector::JSGlobalObjectDebuggerAgent::startListeningScriptDebugServer):
+ (Inspector::JSGlobalObjectDebuggerAgent::stopListeningScriptDebugServer):
+ (Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):
+ Simple implementation of DebuggerAGent with a JSGlobalObject.
+
</ins><span class="cx"> 2014-01-25 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> Gardening: fix build breakage from previous commit.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/GNUmakefile.list.am (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -665,10 +665,10 @@
</span><span class="cx">         Source/JavaScriptCore/inspector/ScriptDebugServer.h \
</span><span class="cx">         Source/JavaScriptCore/inspector/agents/InspectorAgent.h \
</span><span class="cx">         Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp \
</span><ins>+        Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h \
+        Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp \
</ins><span class="cx">         Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h \
</span><span class="cx">         Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp \
</span><del>-        Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h \
-        Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp \
</del><span class="cx">         Source/JavaScriptCore/interpreter/AbstractPC.cpp \
</span><span class="cx">         Source/JavaScriptCore/interpreter/AbstractPC.h \
</span><span class="cx">         Source/JavaScriptCore/interpreter/CachedCall.h \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -491,8 +491,8 @@
</span><span class="cx"> <ClCompile Include="..\inspector\JavaScriptCallFrame.cpp" />
</span><span class="cx"> <ClCompile Include="..\inspector\ScriptDebugServer.cpp" />
</span><span class="cx"> <ClCompile Include="..\inspector\agents\InspectorAgent.cpp" />
</span><ins>+ <ClCompile Include="..\inspector\agents\InspectorDebuggerAgent.cpp" />
</ins><span class="cx"> <ClCompile Include="..\inspector\agents\InspectorRuntimeAgent.cpp" />
</span><del>- <ClCompile Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.cpp" />
</del><span class="cx"> <ClCompile Include="..\interpreter\AbstractPC.cpp" />
</span><span class="cx"> <ClCompile Include="..\interpreter\CallFrame.cpp" />
</span><span class="cx"> <ClCompile Include="..\interpreter\Interpreter.cpp" />
</span><span class="lines">@@ -1070,8 +1070,8 @@
</span><span class="cx"> <ClInclude Include="..\inspector\ScriptDebugListener.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\ScriptDebugServer.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\agents\InspectorAgent.h" />
</span><ins>+ <ClInclude Include="..\inspector\agents\InspectorDebuggerAgent.h" />
</ins><span class="cx"> <ClInclude Include="..\inspector\agents\InspectorRuntimeAgent.h" />
</span><del>- <ClInclude Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.h" />
</del><span class="cx"> <ClInclude Include="..\interpreter\AbstractPC.h" />
</span><span class="cx"> <ClInclude Include="..\interpreter\CachedCall.h" />
</span><span class="cx"> <ClInclude Include="..\interpreter\CallFrame.h" />
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -300,10 +300,10 @@
</span><span class="cx"> <ClCompile Include="..\inspector\agents\InspectorAgent.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\agents\InspectorRuntimeAgent.cpp">
</del><ins>+ <ClCompile Include="..\inspector\agents\InspectorDebuggerAgent.cpp">
</ins><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.cpp">
</del><ins>+ <ClCompile Include="..\inspector\agents\InspectorRuntimeAgent.cpp">
</ins><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="..\interpreter\AbstractPC.cpp">
</span><span class="lines">@@ -1802,10 +1802,10 @@
</span><span class="cx"> <ClInclude Include="..\inspector\agents\InspectorAgent.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\inspector\agents\InspectorRuntimeAgent.h">
</del><ins>+ <ClInclude Include="..\inspector\agents\InspectorDebuggerAgent.h">
</ins><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.h">
</del><ins>+ <ClInclude Include="..\inspector\agents\InspectorRuntimeAgent.h">
</ins><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="cx"> <ClInclude Include="..\interpreter\AbstractPC.h">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -910,6 +910,8 @@
</span><span class="cx">                 A503FA22188EFF6800110F14 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA20188EFF6800110F14 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A503FA25188EFFFD00110F14 /* ScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA23188EFFFD00110F14 /* ScriptDebugServer.cpp */; };
</span><span class="cx">                 A503FA26188EFFFD00110F14 /* ScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA24188EFFFD00110F14 /* ScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A503FA29188F105900110F14 /* JSGlobalObjectScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA27188F105900110F14 /* JSGlobalObjectScriptDebugServer.cpp */; };
+                A503FA2A188F105900110F14 /* JSGlobalObjectScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA28188F105900110F14 /* JSGlobalObjectScriptDebugServer.h */; };
</ins><span class="cx">                 A50E4B6118809DD50068A46D /* InspectorRuntimeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A50E4B5D18809DD50068A46D /* InspectorRuntimeAgent.cpp */; };
</span><span class="cx">                 A50E4B6218809DD50068A46D /* InspectorRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A50E4B5E18809DD50068A46D /* InspectorRuntimeAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A50E4B6318809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A50E4B5F18809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp */; };
</span><span class="lines">@@ -938,6 +940,8 @@
</span><span class="cx">                 A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324391185696E6002ED692 /* generate-combined-inspector-json.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A53243981856A489002ED692 /* InspectorJS.json in Headers */ = {isa = PBXBuildFile; fileRef = A53243951856A475002ED692 /* InspectorJS.json */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A54982031891D0B00081E5B8 /* EventLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54982011891D0B00081E5B8 /* EventLoop.cpp */; };
+                A54982041891D0B00081E5B8 /* EventLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = A54982021891D0B00081E5B8 /* EventLoop.h */; };
</ins><span class="cx">                 A54CF2F5184EAB2400237F19 /* ScriptValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54CF2F2184EAB2400237F19 /* ScriptValue.cpp */; };
</span><span class="cx">                 A54CF2F6184EAB2400237F19 /* ScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A54CF2F3184EAB2400237F19 /* ScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A54CF2F9184EAEDA00237F19 /* ScriptObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54CF2F7184EAEDA00237F19 /* ScriptObject.cpp */; };
</span><span class="lines">@@ -945,6 +949,10 @@
</span><span class="cx">                 A55D93A5185012A800400DED /* ScriptFunctionCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */; };
</span><span class="cx">                 A55D93A6185012A800400DED /* ScriptFunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93A4185012A800400DED /* ScriptFunctionCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A55D93AC18514F7900400DED /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A57D23E51890CEBF0031C7FA /* InspectorDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D23E31890CEBF0031C7FA /* InspectorDebuggerAgent.cpp */; };
+                A57D23E61890CEBF0031C7FA /* InspectorDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A57D23E41890CEBF0031C7FA /* InspectorDebuggerAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                A57D23E91891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D23E71891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp */; };
+                A57D23EA1891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A57D23E81891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h */; };
</ins><span class="cx">                 A57D23ED1891B5540031C7FA /* RegularExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D23EB1891B5540031C7FA /* RegularExpression.cpp */; };
</span><span class="cx">                 A57D23EE1891B5540031C7FA /* RegularExpression.h in Headers */ = {isa = PBXBuildFile; fileRef = A57D23EC1891B5540031C7FA /* RegularExpression.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A57D23F11891B5B40031C7FA /* ContentSearchUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D23EF1891B5B40031C7FA /* ContentSearchUtilities.cpp */; };
</span><span class="lines">@@ -2312,6 +2320,8 @@
</span><span class="cx">                 A503FA20188EFF6800110F14 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
</span><span class="cx">                 A503FA23188EFFFD00110F14 /* ScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptDebugServer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A503FA24188EFFFD00110F14 /* ScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugServer.h; sourceTree = "<group>"; };
</span><ins>+                A503FA27188F105900110F14 /* JSGlobalObjectScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectScriptDebugServer.cpp; sourceTree = "<group>"; };
+                A503FA28188F105900110F14 /* JSGlobalObjectScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectScriptDebugServer.h; sourceTree = "<group>"; };
</ins><span class="cx">                 A50E4B5D18809DD50068A46D /* InspectorRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorRuntimeAgent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A50E4B5E18809DD50068A46D /* InspectorRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorRuntimeAgent.h; sourceTree = "<group>"; };
</span><span class="cx">                 A50E4B5F18809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectRuntimeAgent.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -2345,6 +2355,8 @@
</span><span class="cx">                 A5324391185696E6002ED692 /* generate-combined-inspector-json.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-combined-inspector-json.py"; sourceTree = "<group>"; };
</span><span class="cx">                 A53243951856A475002ED692 /* InspectorJS.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = InspectorJS.json; sourceTree = "<group>"; };
</span><span class="cx">                 A53243961856A475002ED692 /* InspectorJSBackendCommands.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InspectorJSBackendCommands.js; sourceTree = "<group>"; };
</span><ins>+                A54982011891D0B00081E5B8 /* EventLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventLoop.cpp; sourceTree = "<group>"; };
+                A54982021891D0B00081E5B8 /* EventLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventLoop.h; sourceTree = "<group>"; };
</ins><span class="cx">                 A54CF2F2184EAB2400237F19 /* ScriptValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptValue.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A54CF2F3184EAB2400237F19 /* ScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptValue.h; sourceTree = "<group>"; };
</span><span class="cx">                 A54CF2F7184EAEDA00237F19 /* ScriptObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptObject.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -2352,6 +2364,10 @@
</span><span class="cx">                 A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptFunctionCall.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A55D93A4185012A800400DED /* ScriptFunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFunctionCall.h; sourceTree = "<group>"; };
</span><span class="cx">                 A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTypeBuilder.h; sourceTree = "<group>"; };
</span><ins>+                A57D23E31890CEBF0031C7FA /* InspectorDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDebuggerAgent.cpp; sourceTree = "<group>"; };
+                A57D23E41890CEBF0031C7FA /* InspectorDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDebuggerAgent.h; sourceTree = "<group>"; };
+                A57D23E71891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectDebuggerAgent.cpp; sourceTree = "<group>"; };
+                A57D23E81891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectDebuggerAgent.h; sourceTree = "<group>"; };
</ins><span class="cx">                 A57D23EB1891B5540031C7FA /* RegularExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegularExpression.cpp; path = yarr/RegularExpression.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A57D23EC1891B5540031C7FA /* RegularExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegularExpression.h; path = yarr/RegularExpression.h; sourceTree = "<group>"; };
</span><span class="cx">                 A57D23EF1891B5B40031C7FA /* ContentSearchUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentSearchUtilities.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -4366,8 +4382,12 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */,
</span><span class="cx">                                 A5CEEE13187F3BAD00E55C99 /* InspectorAgent.h */,
</span><ins>+                                A57D23E31890CEBF0031C7FA /* InspectorDebuggerAgent.cpp */,
+                                A57D23E41890CEBF0031C7FA /* InspectorDebuggerAgent.h */,
</ins><span class="cx">                                 A50E4B5D18809DD50068A46D /* InspectorRuntimeAgent.cpp */,
</span><span class="cx">                                 A50E4B5E18809DD50068A46D /* InspectorRuntimeAgent.h */,
</span><ins>+                                A57D23E71891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp */,
+                                A57D23E81891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h */,
</ins><span class="cx">                                 A50E4B5F18809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp */,
</span><span class="cx">                                 A50E4B6018809DD50068A46D /* JSGlobalObjectRuntimeAgent.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -4410,6 +4430,8 @@
</span><span class="cx">                                 A532438E185696CE002ED692 /* scripts */,
</span><span class="cx">                                 A57D23EF1891B5B40031C7FA /* ContentSearchUtilities.cpp */,
</span><span class="cx">                                 A57D23F01891B5B40031C7FA /* ContentSearchUtilities.h */,
</span><ins>+                                A54982011891D0B00081E5B8 /* EventLoop.cpp */,
+                                A54982021891D0B00081E5B8 /* EventLoop.h */,
</ins><span class="cx">                                 A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */,
</span><span class="cx">                                 A513E5B6185B8BD3007E95AD /* InjectedScript.h */,
</span><span class="cx">                                 A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */,
</span><span class="lines">@@ -4433,6 +4455,8 @@
</span><span class="cx">                                 A593CF811840377100BFCE27 /* InspectorValues.h */,
</span><span class="cx">                                 A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */,
</span><span class="cx">                                 A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */,
</span><ins>+                                A503FA27188F105900110F14 /* JSGlobalObjectScriptDebugServer.cpp */,
+                                A503FA28188F105900110F14 /* JSGlobalObjectScriptDebugServer.h */,
</ins><span class="cx">                                 A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */,
</span><span class="cx">                                 A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */,
</span><span class="cx">                                 A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */,
</span><span class="lines">@@ -4607,6 +4631,7 @@
</span><span class="cx">                                 BC1166020E1997B4008066DD /* DateInstance.h in Headers */,
</span><span class="cx">                                 14A1563210966365006FA260 /* DateInstanceCache.h in Headers */,
</span><span class="cx">                                 BCD2034C0E17135E002C7E82 /* DatePrototype.h in Headers */,
</span><ins>+                                A503FA2A188F105900110F14 /* JSGlobalObjectScriptDebugServer.h in Headers */,
</ins><span class="cx">                                 BCD203E80E1718F4002C7E82 /* DatePrototype.lut.h in Headers */,
</span><span class="cx">                                 BC18C3FA0E16F5CD00B34460 /* Debugger.h in Headers */,
</span><span class="cx">                                 BC3135640F302FA3003DFD3A /* DebuggerActivation.h in Headers */,
</span><span class="lines">@@ -4675,6 +4700,7 @@
</span><span class="cx">                                 A7D89CFA17A0B8CC00773AD8 /* DFGFlushLivenessAnalysisPhase.h in Headers */,
</span><span class="cx">                                 86EC9DC61328DF82002B2AD7 /* DFGGenerationInfo.h in Headers */,
</span><span class="cx">                                 86EC9DC81328DF82002B2AD7 /* DFGGraph.h in Headers */,
</span><ins>+                                A57D23E61890CEBF0031C7FA /* InspectorDebuggerAgent.h in Headers */,
</ins><span class="cx">                                 0FB14E211812570B009B6B4D /* DFGInlineCacheWrapper.h in Headers */,
</span><span class="cx">                                 0FB14E2318130955009B6B4D /* DFGInlineCacheWrapperInlines.h in Headers */,
</span><span class="cx">                                 A704D90617A0BAA8006BA554 /* DFGInPlaceAbstractState.h in Headers */,
</span><span class="lines">@@ -4735,6 +4761,7 @@
</span><span class="cx">                                 0FBE0F7716C1DB120082C5E8 /* DFGUnificationPhase.h in Headers */,
</span><span class="cx">                                 0F34B14A16D42013001CDA5A /* DFGUseKind.h in Headers */,
</span><span class="cx">                                 0F3B3A2C15475002003ED0FF /* DFGValidate.h in Headers */,
</span><ins>+                                A57D23EA1891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h in Headers */,
</ins><span class="cx">                                 0F2BDC471522802500CD8910 /* DFGValueRecoveryOverride.h in Headers */,
</span><span class="cx">                                 0F2BDC481522802900CD8910 /* DFGValueSource.h in Headers */,
</span><span class="cx">                                 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
</span><span class="lines">@@ -4858,6 +4885,7 @@
</span><span class="cx">                                 860BD801148EA6F200112B2F /* Intrinsic.h in Headers */,
</span><span class="cx">                                 BC18C4130E16F5CD00B34460 /* JavaScript.h in Headers */,
</span><span class="cx">                                 BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
</span><ins>+                                A54982041891D0B00081E5B8 /* EventLoop.h in Headers */,
</ins><span class="cx">                                 BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */,
</span><span class="cx">                                 1429D9300ED22D7000B89619 /* JIT.h in Headers */,
</span><span class="cx">                                 86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */,
</span><span class="lines">@@ -5807,6 +5835,7 @@
</span><span class="cx">                                 0F34B14916D42010001CDA5A /* DFGUseKind.cpp in Sources */,
</span><span class="cx">                                 0F3B3A2B15475000003ED0FF /* DFGValidate.cpp in Sources */,
</span><span class="cx">                                 A55D93A5185012A800400DED /* ScriptFunctionCall.cpp in Sources */,
</span><ins>+                                A503FA29188F105900110F14 /* JSGlobalObjectScriptDebugServer.cpp in Sources */,
</ins><span class="cx">                                 0F2BDC4F15228BF300CD8910 /* DFGValueSource.cpp in Sources */,
</span><span class="cx">                                 0FDDBFB51666EED800C55FEF /* DFGVariableAccessDataDump.cpp in Sources */,
</span><span class="cx">                                 0F2BDC5115228FFD00CD8910 /* DFGVariableEvent.cpp in Sources */,
</span><span class="lines">@@ -5841,6 +5870,7 @@
</span><span class="cx">                                 0F235BD817178E1C00690C7F /* FTLExitThunkGenerator.cpp in Sources */,
</span><span class="cx">                                 0F235BDA17178E1C00690C7F /* FTLExitValue.cpp in Sources */,
</span><span class="cx">                                 A7F2996B17A0BB670010417A /* FTLFail.cpp in Sources */,
</span><ins>+                                A57D23E51890CEBF0031C7FA /* InspectorDebuggerAgent.cpp in Sources */,
</ins><span class="cx">                                 0FD8A31917D51F2200CA2C40 /* FTLForOSREntryJITCode.cpp in Sources */,
</span><span class="cx">                                 0F25F1AF181635F300522F39 /* FTLInlineCacheSize.cpp in Sources */,
</span><span class="cx">                                 0FEA0A281709623B00BB722C /* FTLIntrinsicRepository.cpp in Sources */,
</span><span class="lines">@@ -5903,6 +5933,7 @@
</span><span class="cx">                                 0FB14E1E18124ACE009B6B4D /* JITInlineCacheGenerator.cpp in Sources */,
</span><span class="cx">                                 BCDD51EB0FB8DF74004A8BDC /* JITOpcodes.cpp in Sources */,
</span><span class="cx">                                 A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */,
</span><ins>+                                A54982031891D0B00081E5B8 /* EventLoop.cpp in Sources */,
</ins><span class="cx">                                 2A4EC90B1860D6C20094F782 /* WriteBarrierBuffer.cpp in Sources */,
</span><span class="cx">                                 0F24E54C17EE274900ABB217 /* JITOperations.cpp in Sources */,
</span><span class="cx">                                 86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */,
</span><span class="lines">@@ -5980,6 +6011,7 @@
</span><span class="cx">                                 A503FA1B188E0FB000110F14 /* JSJavaScriptCallFrame.cpp in Sources */,
</span><span class="cx">                                 86E3C618167BABEE006D760A /* JSWrapperMap.mm in Sources */,
</span><span class="cx">                                 14280870107EC1340013E7B2 /* JSWrapperObject.cpp in Sources */,
</span><ins>+                                A57D23E91891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp in Sources */,
</ins><span class="cx">                                 BCFD8C920EEB2EE700283848 /* JumpTable.cpp in Sources */,
</span><span class="cx">                                 0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */,
</span><span class="cx">                                 95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorEventLoopcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/EventLoop.cpp (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/EventLoop.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/EventLoop.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EventLoop.h"
+
+#if OS(WINDOWS)
+#include <windows.h>
+#elif USE(CF)
+#include <CoreFoundation/CFRunLoop.h>
+#elif PLATFORM(EFL)
+#include <Ecore.h>
+#elif PLATFORM(GTK)
+#include <glib.h>
+#endif
+
+namespace Inspector {
+
+void EventLoop::cycle()
+{
+#if OS(WINDOWS)
+ MSG msg;
+ if (!GetMessage(&msg, 0, 0, 0)) {
+ m_ended = true;
+ return;
+ }
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+#elif USE(CF)
+ CFTimeInterval timeInterval = 0.05;
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeInterval, true);
+#elif PLATFORM(EFL)
+ ecore_main_loop_iterate();
+#elif PLATFORM(GTK)
+ g_main_context_iteration(NULL, FALSE);
+#endif
+}
+
+} // namespace Inspector
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorEventLooph"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/EventLoop.h (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/EventLoop.h         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/EventLoop.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EventLoop_h
+#define EventLoop_h
+
+#include <wtf/Noncopyable.h>
+
+namespace Inspector {
+
+class EventLoop {
+ WTF_MAKE_NONCOPYABLE(EventLoop);
+public:
+ EventLoop()
+ : m_ended(false)
+ {
+ }
+
+ void cycle();
+ bool ended() const { return m_ended; }
+
+private:
+ bool m_ended;
+};
+
+} // namespace Inspector
+
+#endif // EventLoop_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "InspectorBackendDispatcher.h"
</span><span class="cx"> #include "InspectorFrontendChannel.h"
</span><span class="cx"> #include "JSGlobalObject.h"
</span><ins>+#include "JSGlobalObjectDebuggerAgent.h"
</ins><span class="cx"> #include "JSGlobalObjectRuntimeAgent.h"
</span><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -47,7 +48,16 @@
</span><span class="cx"> , m_inspectorFrontendChannel(nullptr)
</span><span class="cx"> {
</span><span class="cx"> m_agents.append(std::make_unique<InspectorAgent>());
</span><del>- m_agents.append(std::make_unique<JSGlobalObjectRuntimeAgent>(m_injectedScriptManager.get(), m_globalObject));
</del><ins>+
+ auto runtimeAgentPtr = std::make_unique<JSGlobalObjectRuntimeAgent>(m_injectedScriptManager.get(), m_globalObject);
+ InspectorRuntimeAgent* runtimeAgent = runtimeAgentPtr.get();
+ m_agents.append(std::move(runtimeAgentPtr));
+
+ auto debuggerAgentPtr = std::make_unique<JSGlobalObjectDebuggerAgent>(m_injectedScriptManager.get(), m_globalObject);
+ InspectorDebuggerAgent* debuggerAgent = debuggerAgentPtr.get();
+ m_agents.append(std::move(debuggerAgentPtr));
+
+ runtimeAgent->setScriptDebugServer(&debuggerAgent->scriptDebugServer());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSGlobalObjectInspectorController::~JSGlobalObjectInspectorController()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSGlobalObjectScriptDebugServer.h"
+
+#if ENABLE(INSPECTOR)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "EventLoop.h"
+
+using namespace JSC;
+
+namespace Inspector {
+
+JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer(JSGlobalObject& globalObject)
+ : ScriptDebugServer(false)
+ , m_globalObject(globalObject)
+{
+}
+
+void JSGlobalObjectScriptDebugServer::addListener(ScriptDebugListener* listener)
+{
+ if (!listener)
+ return;
+
+ bool wasEmpty = m_listeners.isEmpty();
+ m_listeners.add(listener);
+
+ // First listener. Attach the debugger to the JSGlobalObject.
+ if (wasEmpty) {
+ attach(&m_globalObject);
+ recompileAllJSFunctions();
+ }
+}
+
+void JSGlobalObjectScriptDebugServer::removeListener(ScriptDebugListener* listener, bool isBeingDestroyed)
+{
+ if (!listener)
+ return;
+
+ m_listeners.remove(listener);
+
+ // Last listener. Detach the debugger from the JSGlobalObject.
+ if (m_listeners.isEmpty()) {
+ detach(&m_globalObject, isBeingDestroyed ? Debugger::GlobalObjectIsDestructing : Debugger::TerminatingDebuggingSession);
+ if (!isBeingDestroyed)
+ recompileAllJSFunctions();
+ }
+}
+
+void JSGlobalObjectScriptDebugServer::recompileAllJSFunctions()
+{
+ JSC::Debugger::recompileAllJSFunctions(&m_globalObject.vm());
+}
+
+void JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused()
+{
+ EventLoop loop;
+ while (!m_doneProcessingDebuggerEvents && !loop.ended())
+ loop.cycle();
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+#endif // ENABLE(INSPECTOR)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServerh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSGlobalObjectScriptDebugServer_h
+#define JSGlobalObjectScriptDebugServer_h
+
+#if ENABLE(INSPECTOR)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "ScriptDebugServer.h"
+#include <wtf/Forward.h>
+
+namespace Inspector {
+
+class JSGlobalObjectScriptDebugServer final : public ScriptDebugServer {
+ WTF_MAKE_NONCOPYABLE(JSGlobalObjectScriptDebugServer);
+public:
+ JSGlobalObjectScriptDebugServer(JSC::JSGlobalObject&);
+ virtual ~JSGlobalObjectScriptDebugServer() { }
+
+ void addListener(ScriptDebugListener*);
+ void removeListener(ScriptDebugListener*, bool isBeingDestroyed);
+
+ JSC::JSGlobalObject& globalObject() const { return m_globalObject; }
+
+ virtual void recompileAllJSFunctions() override;
+
+private:
+ virtual ListenerSet* getListenersForGlobalObject(JSC::JSGlobalObject*) override { return &m_listeners; }
+ virtual void didPause(JSC::JSGlobalObject*) override { }
+ virtual void didContinue(JSC::JSGlobalObject*) override { }
+ virtual void runEventLoopWhilePaused() override;
+ virtual bool isContentScript(JSC::ExecState*) const override { return false; }
+
+ // FIXME: JavaScript inspection has no Console yet.
+ virtual void reportException(JSC::ExecState*, JSC::JSValue) const override { }
+
+ ListenerSet m_listeners;
+ JSC::JSGlobalObject& m_globalObject;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+#endif // ENABLE(INSPECTOR)
+
+#endif // JSGlobalObjectScriptDebugServer_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcppfromrev162797trunkSourceWebCoreinspectorInspectorDebuggerAgentcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (from rev 162797, trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp) (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,738 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InspectorDebuggerAgent.h"
+
+#if ENABLE(INSPECTOR)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "ContentSearchUtilities.h"
+#include "InjectedScript.h"
+#include "InjectedScriptManager.h"
+#include "InspectorValues.h"
+#include "RegularExpression.h"
+#include "ScriptDebugServer.h"
+#include "ScriptObject.h"
+#include "ScriptValue.h"
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+const char* InspectorDebuggerAgent::backtraceObjectGroup = "backtrace";
+
+static String objectGroupForBreakpointAction(int identifier)
+{
+ DEFINE_STATIC_LOCAL(const AtomicString, objectGroup, ("breakpoint-action-", AtomicString::ConstructFromLiteral));
+ return makeString(objectGroup, String::number(identifier));
+}
+
+InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedScriptManager)
+ : InspectorAgentBase(ASCIILiteral("Debugger"))
+ , m_injectedScriptManager(injectedScriptManager)
+ , m_listener(nullptr)
+ , m_pausedScriptState(nullptr)
+ , m_continueToLocationBreakpointID(JSC::noBreakpointID)
+ , m_enabled(false)
+ , m_javaScriptPauseScheduled(false)
+ , m_nextProbeSampleId(1)
+ , m_nextBreakpointActionIdentifier(1)
+{
+ // FIXME: make breakReason optional so that there was no need to init it with "other".
+ clearBreakDetails();
+}
+
+InspectorDebuggerAgent::~InspectorDebuggerAgent()
+{
+}
+
+void InspectorDebuggerAgent::didCreateFrontendAndBackend(InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
+{
+ m_frontendDispatcher = std::make_unique<InspectorDebuggerFrontendDispatcher>(frontendChannel);
+ m_backendDispatcher = InspectorDebuggerBackendDispatcher::create(backendDispatcher, this);
+}
+
+void InspectorDebuggerAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason reason)
+{
+ m_frontendDispatcher = nullptr;
+ m_backendDispatcher.clear();
+
+ bool skipRecompile = reason == InspectorDisconnectReason::InspectedTargetDestroyed;
+ disable(skipRecompile);
+}
+
+void InspectorDebuggerAgent::enable()
+{
+ if (m_enabled)
+ return;
+
+ scriptDebugServer().setBreakpointsActivated(true);
+ startListeningScriptDebugServer();
+
+ if (m_listener)
+ m_listener->debuggerWasEnabled();
+
+ m_enabled = true;
+}
+
+void InspectorDebuggerAgent::disable(bool isBeingDestroyed)
+{
+ if (!m_enabled)
+ return;
+
+ m_javaScriptBreakpoints.clear();
+
+ stopListeningScriptDebugServer(isBeingDestroyed);
+ clearResolvedBreakpointState();
+
+ if (m_listener)
+ m_listener->debuggerWasDisabled();
+
+ m_enabled = false;
+}
+
+void InspectorDebuggerAgent::enable(ErrorString*)
+{
+ enable();
+}
+
+void InspectorDebuggerAgent::disable(ErrorString*)
+{
+ disable(false);
+}
+
+void InspectorDebuggerAgent::setBreakpointsActive(ErrorString*, bool active)
+{
+ if (active)
+ scriptDebugServer().activateBreakpoints();
+ else
+ scriptDebugServer().deactivateBreakpoints();
+}
+
+bool InspectorDebuggerAgent::isPaused()
+{
+ return scriptDebugServer().isPaused();
+}
+
+void InspectorDebuggerAgent::handleConsoleAssert()
+{
+ if (scriptDebugServer().pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions)
+ breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Assert, nullptr);
+}
+
+static PassRefPtr<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue)
+{
+ RefPtr<InspectorObject> breakpointObject = InspectorObject::create();
+ breakpointObject->setString(ASCIILiteral("url"), url);
+ breakpointObject->setNumber(ASCIILiteral("lineNumber"), lineNumber);
+ breakpointObject->setNumber(ASCIILiteral("columnNumber"), columnNumber);
+ breakpointObject->setString(ASCIILiteral("condition"), condition);
+ breakpointObject->setBoolean(ASCIILiteral("isRegex"), isRegex);
+ breakpointObject->setBoolean(ASCIILiteral("autoContinue"), autoContinue);
+
+ if (actions)
+ breakpointObject->setArray(ASCIILiteral("actions"), actions);
+
+ return breakpointObject;
+}
+
+static bool matches(const String& url, const String& pattern, bool isRegex)
+{
+ if (isRegex) {
+ JSC::Yarr::RegularExpression regex(pattern, TextCaseSensitive);
+ return regex.match(url) != -1;
+ }
+ return url == pattern;
+}
+
+static bool breakpointActionTypeForString(const String& typeString, ScriptBreakpointActionType* output)
+{
+ if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Log)) {
+ *output = ScriptBreakpointActionTypeLog;
+ return true;
+ }
+ if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Evaluate)) {
+ *output = ScriptBreakpointActionTypeEvaluate;
+ return true;
+ }
+ if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Sound)) {
+ *output = ScriptBreakpointActionTypeSound;
+ return true;
+ }
+ if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Probe)) {
+ *output = ScriptBreakpointActionTypeProbe;
+ return true;
+ }
+
+ return false;
+}
+
+bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString* errorString, RefPtr<InspectorArray>& actions, Vector<ScriptBreakpointAction>* result)
+{
+ if (!actions)
+ return true;
+
+ unsigned actionsLength = actions->length();
+ if (!actionsLength)
+ return true;
+
+ result->reserveCapacity(actionsLength);
+ for (unsigned i = 0; i < actionsLength; ++i) {
+ RefPtr<InspectorValue> value = actions->get(i);
+ RefPtr<InspectorObject> object;
+ if (!value->asObject(&object)) {
+ *errorString = ASCIILiteral("BreakpointAction of incorrect type, expected object");
+ return false;
+ }
+
+ String typeString;
+ if (!object->getString(ASCIILiteral("type"), &typeString)) {
+ *errorString = ASCIILiteral("BreakpointAction had type missing");
+ return false;
+ }
+
+ ScriptBreakpointActionType type;
+ if (!breakpointActionTypeForString(typeString, &type)) {
+ *errorString = ASCIILiteral("BreakpointAction had unknown type");
+ return false;
+ }
+
+ String data;
+ object->getString(ASCIILiteral("data"), &data);
+
+ result->append(ScriptBreakpointAction(type, m_nextBreakpointActionIdentifier++, data));
+ }
+
+ return true;
+}
+
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const RefPtr<InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::Location>>& locations, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers)
+{
+ locations = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::Location>::create();
+ if (!optionalURL == !optionalURLRegex) {
+ *errorString = ASCIILiteral("Either url or urlRegex must be specified.");
+ return;
+ }
+
+ String url = optionalURL ? *optionalURL : *optionalURLRegex;
+ int columnNumber = optionalColumnNumber ? *optionalColumnNumber : 0;
+ bool isRegex = optionalURLRegex;
+
+ String breakpointIdentifier = (isRegex ? "/" + url + "/" : url) + ':' + String::number(lineNumber) + ':' + String::number(columnNumber);
+ if (m_javaScriptBreakpoints.contains(breakpointIdentifier)) {
+ *errorString = ASCIILiteral("Breakpoint at specified location already exists.");
+ return;
+ }
+
+ String condition = emptyString();
+ bool autoContinue = false;
+ RefPtr<InspectorArray> actions;
+ if (options) {
+ (*options)->getString(ASCIILiteral("condition"), &condition);
+ (*options)->getBoolean(ASCIILiteral("autoContinue"), &autoContinue);
+ actions = (*options)->getArray(ASCIILiteral("actions"));
+ }
+
+ Vector<ScriptBreakpointAction> breakpointActions;
+ if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
+ return;
+
+ breakpointActionIdentifiers = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>::create();
+ for (ScriptBreakpointAction& action : breakpointActions)
+ breakpointActionIdentifiers->addItem(action.identifier);
+
+ m_javaScriptBreakpoints.set(breakpointIdentifier, buildObjectForBreakpointCookie(url, lineNumber, columnNumber, condition, actions, isRegex, autoContinue));
+
+ ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue);
+ for (ScriptsMap::iterator it = m_scripts.begin(); it != m_scripts.end(); ++it) {
+ String scriptURL = !it->value.sourceURL.isEmpty() ? it->value.sourceURL : it->value.url;
+ if (!matches(scriptURL, url, isRegex))
+ continue;
+
+ RefPtr<Inspector::TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointIdentifier, it->key, breakpoint);
+ if (location)
+ locations->addItem(location);
+ }
+ *outBreakpointIdentifier = breakpointIdentifier;
+}
+
+static bool parseLocation(ErrorString* errorString, InspectorObject* location, JSC::SourceID* sourceID, unsigned* lineNumber, unsigned* columnNumber)
+{
+ String scriptIDStr;
+ if (!location->getString(ASCIILiteral("scriptId"), &scriptIDStr) || !location->getNumber(ASCIILiteral("lineNumber"), lineNumber)) {
+ *sourceID = JSC::noSourceID;
+ *errorString = ASCIILiteral("scriptId and lineNumber are required.");
+ return false;
+ }
+
+ *sourceID = scriptIDStr.toIntPtr();
+ *columnNumber = 0;
+ location->getNumber(ASCIILiteral("columnNumber"), columnNumber);
+ return true;
+}
+
+void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, const RefPtr<InspectorObject>& location, const RefPtr<InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::TypeBuilder::Debugger::Location>& actualLocation, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers)
+{
+ JSC::SourceID sourceID;
+ unsigned lineNumber;
+ unsigned columnNumber;
+ if (!parseLocation(errorString, location.get(), &sourceID, &lineNumber, &columnNumber))
+ return;
+
+ String condition = emptyString();
+ bool autoContinue = false;
+ RefPtr<InspectorArray> actions;
+ if (options) {
+ (*options)->getString(ASCIILiteral("condition"), &condition);
+ (*options)->getBoolean(ASCIILiteral("autoContinue"), &autoContinue);
+ actions = (*options)->getArray(ASCIILiteral("actions"));
+ }
+
+ Vector<ScriptBreakpointAction> breakpointActions;
+ if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
+ return;
+
+ breakpointActionIdentifiers = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>::create();
+ for (ScriptBreakpointAction& action : breakpointActions)
+ breakpointActionIdentifiers->addItem(action.identifier);
+
+ String breakpointIdentifier = String::number(sourceID) + ':' + String::number(lineNumber) + ':' + String::number(columnNumber);
+ if (m_breakpointIdentifierToDebugServerBreakpointIDs.find(breakpointIdentifier) != m_breakpointIdentifierToDebugServerBreakpointIDs.end()) {
+ *errorString = ASCIILiteral("Breakpoint at specified location already exists.");
+ return;
+ }
+
+ ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue);
+ actualLocation = resolveBreakpoint(breakpointIdentifier, sourceID, breakpoint);
+ if (!actualLocation) {
+ *errorString = ASCIILiteral("Could not resolve breakpoint");
+ return;
+ }
+
+ *outBreakpointIdentifier = breakpointIdentifier;
+}
+
+void InspectorDebuggerAgent::removeBreakpoint(ErrorString*, const String& breakpointIdentifier)
+{
+ m_javaScriptBreakpoints.remove(breakpointIdentifier);
+
+ Vector<JSC::BreakpointID> breakpointIDs = m_breakpointIdentifierToDebugServerBreakpointIDs.take(breakpointIdentifier);
+ for (auto breakpointID : breakpointIDs) {
+ const Vector<ScriptBreakpointAction>& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
+ for (auto& action : breakpointActions)
+ m_injectedScriptManager->releaseObjectGroup(objectGroupForBreakpointAction(action.identifier));
+
+ scriptDebugServer().removeBreakpoint(breakpointID);
+ }
+}
+
+void InspectorDebuggerAgent::continueToLocation(ErrorString* errorString, const RefPtr<InspectorObject>& location)
+{
+ if (m_continueToLocationBreakpointID != JSC::noBreakpointID) {
+ scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointID);
+ m_continueToLocationBreakpointID = JSC::noBreakpointID;
+ }
+
+ JSC::SourceID sourceID;
+ unsigned lineNumber;
+ unsigned columnNumber;
+ if (!parseLocation(errorString, location.get(), &sourceID, &lineNumber, &columnNumber))
+ return;
+
+ ScriptBreakpoint breakpoint(lineNumber, columnNumber, "", false);
+ m_continueToLocationBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &lineNumber, &columnNumber);
+ resume(errorString);
+}
+
+PassRefPtr<Inspector::TypeBuilder::Debugger::Location> InspectorDebuggerAgent::resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID sourceID, const ScriptBreakpoint& breakpoint)
+{
+ ScriptsMap::iterator scriptIterator = m_scripts.find(sourceID);
+ if (scriptIterator == m_scripts.end())
+ return nullptr;
+ Script& script = scriptIterator->value;
+ if (breakpoint.lineNumber < script.startLine || script.endLine < breakpoint.lineNumber)
+ return nullptr;
+
+ unsigned actualLineNumber;
+ unsigned actualColumnNumber;
+ JSC::BreakpointID debugServerBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &actualLineNumber, &actualColumnNumber);
+ if (debugServerBreakpointID == JSC::noBreakpointID)
+ return nullptr;
+
+ BreakpointIdentifierToDebugServerBreakpointIDsMap::iterator debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.find(breakpointIdentifier);
+ if (debugServerBreakpointIDsIterator == m_breakpointIdentifierToDebugServerBreakpointIDs.end())
+ debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.set(breakpointIdentifier, Vector<JSC::BreakpointID>()).iterator;
+ debugServerBreakpointIDsIterator->value.append(debugServerBreakpointID);
+
+ RefPtr<Inspector::TypeBuilder::Debugger::Location> location = Inspector::TypeBuilder::Debugger::Location::create()
+ .setScriptId(String::number(sourceID))
+ .setLineNumber(actualLineNumber);
+ location->setColumnNumber(actualColumnNumber);
+ return location;
+}
+
+void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& scriptIDStr, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>>& results)
+{
+ bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
+ bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
+
+ JSC::SourceID sourceID = scriptIDStr.toIntPtr();
+ ScriptsMap::iterator it = m_scripts.find(sourceID);
+ if (it != m_scripts.end())
+ results = ContentSearchUtilities::searchInTextByLines(it->value.source, query, caseSensitive, isRegex);
+ else
+ *error = "No script for id: " + scriptIDStr;
+}
+
+void InspectorDebuggerAgent::getScriptSource(ErrorString* error, const String& scriptIDStr, String* scriptSource)
+{
+ JSC::SourceID sourceID = scriptIDStr.toIntPtr();
+ ScriptsMap::iterator it = m_scripts.find(sourceID);
+ if (it != m_scripts.end())
+ *scriptSource = it->value.source;
+ else
+ *error = "No script for id: " + scriptIDStr;
+}
+
+void InspectorDebuggerAgent::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr<Inspector::TypeBuilder::Debugger::FunctionDetails>& details)
+{
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(functionId);
+ if (injectedScript.hasNoValue()) {
+ *errorString = ASCIILiteral("Function object id is obsolete");
+ return;
+ }
+
+ injectedScript.getFunctionDetails(errorString, functionId, &details);
+}
+
+void InspectorDebuggerAgent::schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<InspectorObject> data)
+{
+ if (m_javaScriptPauseScheduled)
+ return;
+
+ m_breakReason = breakReason;
+ m_breakAuxData = data;
+ scriptDebugServer().setPauseOnNextStatement(true);
+}
+
+void InspectorDebuggerAgent::cancelPauseOnNextStatement()
+{
+ if (m_javaScriptPauseScheduled)
+ return;
+
+ clearBreakDetails();
+ scriptDebugServer().setPauseOnNextStatement(false);
+}
+
+void InspectorDebuggerAgent::pause(ErrorString*)
+{
+ if (m_javaScriptPauseScheduled)
+ return;
+
+ clearBreakDetails();
+ scriptDebugServer().setPauseOnNextStatement(true);
+ m_javaScriptPauseScheduled = true;
+}
+
+void InspectorDebuggerAgent::resume(ErrorString* errorString)
+{
+ if (!assertPaused(errorString))
+ return;
+
+ m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
+ scriptDebugServer().continueProgram();
+}
+
+void InspectorDebuggerAgent::stepOver(ErrorString* errorString)
+{
+ if (!assertPaused(errorString))
+ return;
+
+ m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
+ scriptDebugServer().stepOverStatement();
+}
+
+void InspectorDebuggerAgent::stepInto(ErrorString* errorString)
+{
+ if (!assertPaused(errorString))
+ return;
+
+ m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
+ scriptDebugServer().stepIntoStatement();
+ m_listener->stepInto();
+}
+
+void InspectorDebuggerAgent::stepOut(ErrorString* errorString)
+{
+ if (!assertPaused(errorString))
+ return;
+
+ m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
+ scriptDebugServer().stepOutOfFunction();
+}
+
+void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, const String& stringPauseState)
+{
+ JSC::Debugger::PauseOnExceptionsState pauseState;
+ if (stringPauseState == "none")
+ pauseState = JSC::Debugger::DontPauseOnExceptions;
+ else if (stringPauseState == "all")
+ pauseState = JSC::Debugger::PauseOnAllExceptions;
+ else if (stringPauseState == "uncaught")
+ pauseState = JSC::Debugger::PauseOnUncaughtExceptions;
+ else {
+ *errorString = "Unknown pause on exceptions mode: " + stringPauseState;
+ return;
+ }
+
+ scriptDebugServer().setPauseOnExceptionsState(static_cast<JSC::Debugger::PauseOnExceptionsState>(pauseState));
+ if (scriptDebugServer().pauseOnExceptionsState() != pauseState)
+ *errorString = ASCIILiteral("Internal error. Could not change pause on exceptions state");
+}
+
+void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& callFrameId, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
+{
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(callFrameId);
+ if (injectedScript.hasNoValue()) {
+ *errorString = ASCIILiteral("Inspected frame has gone");
+ return;
+ }
+
+ JSC::Debugger::PauseOnExceptionsState previousPauseOnExceptionsState = scriptDebugServer().pauseOnExceptionsState();
+ if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) {
+ if (previousPauseOnExceptionsState != JSC::Debugger::DontPauseOnExceptions)
+ scriptDebugServer().setPauseOnExceptionsState(JSC::Debugger::DontPauseOnExceptions);
+ muteConsole();
+ }
+
+ injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, returnByValue ? *returnByValue : false, generatePreview ? *generatePreview : false, &result, wasThrown);
+
+ if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) {
+ unmuteConsole();
+ if (scriptDebugServer().pauseOnExceptionsState() != previousPauseOnExceptionsState)
+ scriptDebugServer().setPauseOnExceptionsState(previousPauseOnExceptionsState);
+ }
+}
+
+void InspectorDebuggerAgent::setOverlayMessage(ErrorString*, const String*)
+{
+}
+
+void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directiveText)
+{
+ if (scriptDebugServer().pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions) {
+ RefPtr<InspectorObject> directive = InspectorObject::create();
+ directive->setString(ASCIILiteral("directiveText"), directiveText);
+ breakProgram(InspectorDebuggerFrontendDispatcher::Reason::CSPViolation, directive.release());
+ }
+}
+
+PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::CallFrame>> InspectorDebuggerAgent::currentCallFrames()
+{
+ if (!m_pausedScriptState)
+ return Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::CallFrame>::create();
+
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m_pausedScriptState);
+ if (injectedScript.hasNoValue()) {
+ ASSERT_NOT_REACHED();
+ return Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::CallFrame>::create();
+ }
+
+ return injectedScript.wrapCallFrames(m_currentCallStack);
+}
+
+String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script)
+{
+ return ContentSearchUtilities::findScriptSourceMapURL(script.source);
+}
+
+void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script& inScript)
+{
+ Script script = inScript;
+ // FIXME: Why does -[JSContext evaluateScript] have a -1 startLine?
+ if (script.startLine <= 0 && !script.startColumn)
+ script.sourceURL = ContentSearchUtilities::findScriptSourceURL(script.source);
+ script.sourceMappingURL = sourceMapURLForScript(script);
+
+ bool hasSourceURL = !script.sourceURL.isEmpty();
+ String scriptURL = hasSourceURL ? script.sourceURL : script.url;
+ bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr;
+ String* sourceMapURLParam = script.sourceMappingURL.isNull() ? nullptr : &script.sourceMappingURL;
+ const bool* isContentScript = script.isContentScript ? &script.isContentScript : nullptr;
+ String scriptIDStr = String::number(sourceID);
+ m_frontendDispatcher->scriptParsed(scriptIDStr, scriptURL, script.startLine, script.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLParam, hasSourceURLParam);
+
+ m_scripts.set(sourceID, script);
+
+ if (scriptURL.isEmpty())
+ return;
+
+ for (auto it = m_javaScriptBreakpoints.begin(), end = m_javaScriptBreakpoints.end(); it != end; ++it) {
+ RefPtr<InspectorObject> breakpointObject = it->value->asObject();
+ bool isRegex;
+ breakpointObject->getBoolean(ASCIILiteral("isRegex"), &isRegex);
+ String url;
+ breakpointObject->getString(ASCIILiteral("url"), &url);
+ if (!matches(scriptURL, url, isRegex))
+ continue;
+ ScriptBreakpoint breakpoint;
+ breakpointObject->getNumber(ASCIILiteral("lineNumber"), &breakpoint.lineNumber);
+ breakpointObject->getNumber(ASCIILiteral("columnNumber"), &breakpoint.columnNumber);
+ breakpointObject->getString(ASCIILiteral("condition"), &breakpoint.condition);
+ breakpointObject->getBoolean(ASCIILiteral("autoContinue"), &breakpoint.autoContinue);
+ ErrorString errorString;
+ RefPtr<InspectorArray> actions = breakpointObject->getArray(ASCIILiteral("actions"));
+ if (!breakpointActionsFromProtocol(&errorString, actions, &breakpoint.actions)) {
+ ASSERT_NOT_REACHED();
+ continue;
+ }
+
+ RefPtr<Inspector::TypeBuilder::Debugger::Location> location = resolveBreakpoint(it->key, sourceID, breakpoint);
+ if (location)
+ m_frontendDispatcher->breakpointResolved(it->key, location);
+ }
+}
+
+void InspectorDebuggerAgent::failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage)
+{
+ m_frontendDispatcher->scriptFailedToParse(url, data, firstLine, errorLine, errorMessage);
+}
+
+void InspectorDebuggerAgent::didPause(JSC::ExecState* scriptState, const Deprecated::ScriptValue& callFrames, const Deprecated::ScriptValue& exception)
+{
+ ASSERT(scriptState && !m_pausedScriptState);
+ m_pausedScriptState = scriptState;
+ m_currentCallStack = callFrames;
+
+ if (!exception.hasNoValue()) {
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
+ if (!injectedScript.hasNoValue()) {
+ m_breakReason = InspectorDebuggerFrontendDispatcher::Reason::Exception;
+ m_breakAuxData = injectedScript.wrapObject(exception, InspectorDebuggerAgent::backtraceObjectGroup)->openAccessors();
+ // m_breakAuxData might be null after this.
+ }
+ }
+
+ m_frontendDispatcher->paused(currentCallFrames(), m_breakReason, m_breakAuxData);
+ m_javaScriptPauseScheduled = false;
+
+ if (m_continueToLocationBreakpointID != JSC::noBreakpointID) {
+ scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointID);
+ m_continueToLocationBreakpointID = JSC::noBreakpointID;
+ }
+
+ if (m_listener)
+ m_listener->didPause();
+}
+
+void InspectorDebuggerAgent::didSampleProbe(JSC::ExecState* scriptState, int probeIdentifier, int hitCount, const Deprecated::ScriptValue& sample)
+{
+ int sampleId = m_nextProbeSampleId++;
+
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
+ RefPtr<TypeBuilder::Runtime::RemoteObject> payload = injectedScript.wrapObject(sample, objectGroupForBreakpointAction(probeIdentifier));
+ RefPtr<TypeBuilder::Debugger::ProbeSample> result = TypeBuilder::Debugger::ProbeSample::create()
+ .setProbeId(probeIdentifier)
+ .setSampleId(sampleId)
+ .setBatchId(hitCount)
+ .setTimestamp(monotonicallyIncreasingTime())
+ .setPayload(payload.release());
+
+ m_frontendDispatcher->didSampleProbe(result.release());
+}
+
+void InspectorDebuggerAgent::breakpointActionSound()
+{
+ // FIXME: We should send a message to the frontend to make the frontend beep.
+}
+
+void InspectorDebuggerAgent::didContinue()
+{
+ m_pausedScriptState = nullptr;
+ m_currentCallStack = Deprecated::ScriptValue();
+ clearBreakDetails();
+
+ m_frontendDispatcher->resumed();
+}
+
+void InspectorDebuggerAgent::breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<InspectorObject> data)
+{
+ m_breakReason = breakReason;
+ m_breakAuxData = data;
+ scriptDebugServer().breakProgram();
+}
+
+void InspectorDebuggerAgent::clearResolvedBreakpointState()
+{
+ ErrorString dummyError;
+ Vector<String> breakpointIdentifiers;
+ copyKeysToVector(m_breakpointIdentifierToDebugServerBreakpointIDs, breakpointIdentifiers);
+ for (const String& identifier : breakpointIdentifiers)
+ removeBreakpoint(&dummyError, identifier);
+
+ scriptDebugServer().continueProgram();
+
+ m_pausedScriptState = nullptr;
+ m_currentCallStack = Deprecated::ScriptValue();
+ m_scripts.clear();
+ m_breakpointIdentifierToDebugServerBreakpointIDs.clear();
+ m_continueToLocationBreakpointID = JSC::noBreakpointID;
+ clearBreakDetails();
+ m_javaScriptPauseScheduled = false;
+ setOverlayMessage(&dummyError, nullptr);
+}
+
+bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString)
+{
+ if (!m_pausedScriptState) {
+ *errorString = ASCIILiteral("Can only perform operation while paused.");
+ return false;
+ }
+
+ return true;
+}
+
+void InspectorDebuggerAgent::clearBreakDetails()
+{
+ m_breakReason = InspectorDebuggerFrontendDispatcher::Reason::Other;
+ m_breakAuxData = nullptr;
+}
+
+void InspectorDebuggerAgent::didClearGlobalObject()
+{
+ if (m_frontendDispatcher)
+ m_frontendDispatcher->globalObjectCleared();
+
+ clearResolvedBreakpointState();
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+#endif // ENABLE(INSPECTOR)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgenthfromrev162797trunkSourceWebCoreinspectorInspectorDebuggerAgenth"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h (from rev 162797, trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h) (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,175 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorDebuggerAgent_h
+#define InspectorDebuggerAgent_h
+
+#if ENABLE(INSPECTOR)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "InspectorJSBackendDispatchers.h"
+#include "InspectorJSFrontendDispatchers.h"
+#include "bindings/ScriptValue.h"
+#include "debugger/Debugger.h"
+#include "inspector/InspectorAgentBase.h"
+#include "inspector/ScriptBreakpoint.h"
+#include "inspector/ScriptDebugListener.h"
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
+
+namespace Inspector {
+
+class InjectedScript;
+class InjectedScriptManager;
+class InspectorArray;
+class InspectorObject;
+class InspectorValue;
+class ScriptDebugServer;
+typedef String ErrorString;
+
+class JS_EXPORT_PRIVATE InspectorDebuggerAgent : public InspectorAgentBase, public ScriptDebugListener, public InspectorDebuggerBackendDispatcherHandler {
+ WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent);
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ static const char* backtraceObjectGroup;
+
+ virtual ~InspectorDebuggerAgent();
+
+ virtual void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*) override;
+ virtual void willDestroyFrontendAndBackend(InspectorDisconnectReason) override;
+
+ virtual void enable(ErrorString*) override;
+ virtual void disable(ErrorString*) override;
+ virtual void setBreakpointsActive(ErrorString*, bool active) override;
+ virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String* optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, const RefPtr<Inspector::InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId*, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::Location>>& locations, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers) override;
+ virtual void setBreakpoint(ErrorString*, const RefPtr<Inspector::InspectorObject>& location, const RefPtr<Inspector::InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId*, RefPtr<Inspector::TypeBuilder::Debugger::Location>& actualLocation, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers) override;
+ virtual void removeBreakpoint(ErrorString*, const String& breakpointIdentifier) override;
+ virtual void continueToLocation(ErrorString*, const RefPtr<InspectorObject>& location) override;
+ virtual void searchInContent(ErrorString*, const String& scriptID, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>>&) override;
+ virtual void getScriptSource(ErrorString*, const String& scriptID, String* scriptSource) override;
+ virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<Inspector::TypeBuilder::Debugger::FunctionDetails>&) override;
+ virtual void pause(ErrorString*) override;
+ virtual void resume(ErrorString*) override;
+ virtual void stepOver(ErrorString*) override;
+ virtual void stepInto(ErrorString*) override;
+ virtual void stepOut(ErrorString*) override;
+ virtual void setPauseOnExceptions(ErrorString*, const String& pauseState) override;
+ virtual void evaluateOnCallFrame(ErrorString*, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override;
+ virtual void setOverlayMessage(ErrorString*, const String*) override;
+
+ bool isPaused();
+
+ void handleConsoleAssert();
+
+ void schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<InspectorObject> data);
+ void cancelPauseOnNextStatement();
+ void breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<InspectorObject> data);
+ void scriptExecutionBlockedByCSP(const String& directiveText);
+
+ class Listener {
+ public:
+ virtual ~Listener() { }
+ virtual void debuggerWasEnabled() = 0;
+ virtual void debuggerWasDisabled() = 0;
+ virtual void stepInto() = 0;
+ virtual void didPause() = 0;
+ };
+ void setListener(Listener* listener) { m_listener = listener; }
+
+ virtual ScriptDebugServer& scriptDebugServer() = 0;
+
+protected:
+ InspectorDebuggerAgent(InjectedScriptManager*);
+
+ InjectedScriptManager* injectedScriptManager() const { return m_injectedScriptManager; }
+ virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
+
+ virtual void startListeningScriptDebugServer() = 0;
+ virtual void stopListeningScriptDebugServer(bool skipRecompile) = 0;
+ virtual void muteConsole() = 0;
+ virtual void unmuteConsole() = 0;
+
+ virtual void enable();
+ virtual void disable(bool skipRecompile);
+ virtual void didPause(JSC::ExecState*, const Deprecated::ScriptValue& callFrames, const Deprecated::ScriptValue& exception) override;
+ virtual void didContinue() override;
+
+ virtual String sourceMapURLForScript(const Script&);
+
+ void didClearGlobalObject();
+
+private:
+ PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::CallFrame>> currentCallFrames();
+
+ virtual void didParseSource(JSC::SourceID, const Script&) override final;
+ virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) override final;
+ virtual void didSampleProbe(JSC::ExecState*, int probeIdentifier, int hitCount, const Deprecated::ScriptValue& sample) override final;
+
+ virtual void breakpointActionSound() override;
+
+ PassRefPtr<Inspector::TypeBuilder::Debugger::Location> resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID, const ScriptBreakpoint&);
+ bool assertPaused(ErrorString*);
+ void clearResolvedBreakpointState();
+ void clearBreakDetails();
+
+ bool breakpointActionsFromProtocol(ErrorString*, RefPtr<InspectorArray>& actions, Vector<ScriptBreakpointAction>* result);
+
+ typedef HashMap<JSC::SourceID, Script> ScriptsMap;
+ typedef HashMap<String, Vector<JSC::BreakpointID>> BreakpointIdentifierToDebugServerBreakpointIDsMap;
+ typedef HashMap<String, RefPtr<InspectorObject>> BreakpointIdentifierToBreakpointMap;
+
+ InjectedScriptManager* m_injectedScriptManager;
+ std::unique_ptr<InspectorDebuggerFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<InspectorDebuggerBackendDispatcher> m_backendDispatcher;
+ Listener* m_listener;
+ JSC::ExecState* m_pausedScriptState;
+ Deprecated::ScriptValue m_currentCallStack;
+ ScriptsMap m_scripts;
+ BreakpointIdentifierToDebugServerBreakpointIDsMap m_breakpointIdentifierToDebugServerBreakpointIDs;
+ BreakpointIdentifierToBreakpointMap m_javaScriptBreakpoints;
+ JSC::BreakpointID m_continueToLocationBreakpointID;
+ InspectorDebuggerFrontendDispatcher::Reason::Enum m_breakReason;
+ RefPtr<InspectorObject> m_breakAuxData;
+ bool m_enabled;
+ bool m_javaScriptPauseScheduled;
+ int m_nextProbeSampleId;
+ int m_nextBreakpointActionIdentifier;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorDebuggerAgent_h)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgentcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSGlobalObjectDebuggerAgent.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "InjectedScriptManager.h"
+#include "JSGlobalObject.h"
+
+using namespace JSC;
+
+namespace Inspector {
+
+JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent(InjectedScriptManager* injectedScriptManager, JSC::JSGlobalObject& globalObject)
+ : InspectorDebuggerAgent(injectedScriptManager)
+ , m_scriptDebugServer(globalObject)
+{
+}
+
+void JSGlobalObjectDebuggerAgent::startListeningScriptDebugServer()
+{
+ scriptDebugServer().addListener(this);
+}
+
+void JSGlobalObjectDebuggerAgent::stopListeningScriptDebugServer(bool isBeingDestroyed)
+{
+ scriptDebugServer().removeListener(this, isBeingDestroyed);
+}
+
+InjectedScript JSGlobalObjectDebuggerAgent::injectedScriptForEval(ErrorString* error, const int* executionContextId)
+{
+ if (executionContextId) {
+ *error = ASCIILiteral("Execution context id is not supported for JSContext inspection as there is only one execution context.");
+ return InjectedScript();
+ }
+
+ ExecState* exec = m_scriptDebugServer.globalObject().globalExec();
+ return injectedScriptManager()->injectedScriptFor(exec);
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgenth"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSGlobalObjectDebuggerAgent_h
+#define JSGlobalObjectDebuggerAgent_h
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorDebuggerAgent.h"
+#include "JSGlobalObjectScriptDebugServer.h"
+
+namespace Inspector {
+
+class JSGlobalObjectDebuggerAgent final : public InspectorDebuggerAgent {
+ WTF_MAKE_NONCOPYABLE(JSGlobalObjectDebuggerAgent);
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ JSGlobalObjectDebuggerAgent(InjectedScriptManager*, JSC::JSGlobalObject&);
+ virtual ~JSGlobalObjectDebuggerAgent() { }
+
+ virtual JSGlobalObjectScriptDebugServer& scriptDebugServer() override { return m_scriptDebugServer; }
+
+ virtual void startListeningScriptDebugServer() override;
+ virtual void stopListeningScriptDebugServer(bool isBeingDestroyed) override;
+ virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) override;
+
+ // FIXME: This needs a ConsoleAgent to send a log to.
+ virtual void breakpointActionLog(JSC::ExecState*, const String&) override final { }
+
+ // FIXME: JavaScript inspector does not yet have a console object to mute.
+ virtual void muteConsole() override { }
+ virtual void unmuteConsole() override { }
+
+private:
+ JSGlobalObjectScriptDebugServer m_scriptDebugServer;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(JSGlobalObjectDebuggerAgent_h)
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -1587,7 +1587,6 @@
</span><span class="cx"> inspector/InspectorDOMStorageAgent.cpp
</span><span class="cx"> inspector/InspectorDatabaseAgent.cpp
</span><span class="cx"> inspector/InspectorDatabaseResource.cpp
</span><del>- inspector/InspectorDebuggerAgent.cpp
</del><span class="cx"> inspector/InspectorFrontendClientLocal.cpp
</span><span class="cx"> inspector/InspectorFrontendHost.cpp
</span><span class="cx"> inspector/InspectorHeapProfilerAgent.cpp
</span><span class="lines">@@ -1618,6 +1617,7 @@
</span><span class="cx"> inspector/ScriptCallFrame.cpp
</span><span class="cx"> inspector/ScriptCallStack.cpp
</span><span class="cx"> inspector/TimelineRecordFactory.cpp
</span><ins>+ inspector/WebDebuggerAgent.cpp
</ins><span class="cx"> inspector/WorkerConsoleAgent.cpp
</span><span class="cx"> inspector/WorkerDebuggerAgent.cpp
</span><span class="cx"> inspector/WorkerInspectorController.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/ChangeLog        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2014-01-26 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Move InspectorDebuggerAgent into JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=127629
+
+ Rubber-stamped by Sam Weinig.
+
+ Test: inspector-protocol/debugger/pause-on-assert.html
+
+ * CMakeLists.txt:
+ * ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h: Added.
+ * GNUmakefile.list.am:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/InspectorAllInOne.cpp:
+ - Remove InspectorDebuggerAgent.
+ - Add WebDebuggerAgent (shared between Page and Worker).
+
+ * inspector/WebDebuggerAgent.h: Added.
+ (WebCore::WebDebuggerAgent::~WebDebuggerAgent):
+ * inspector/WebDebuggerAgent.cpp: Added.
+ (WebCore::WebDebuggerAgent::WebDebuggerAgent):
+ (WebCore::WebDebuggerAgent::enable):
+ (WebCore::WebDebuggerAgent::disable):
+ Shared code for Page and Worker debugger agents.
+ Instrumenting agents is a concept in WebCore only,
+ and the Debugger agent is only in the instrumenting
+ agents list when it is enabled and removed when disabled.
+
+ * inspector/InstrumentingAgents.h:
+ (WebCore::InstrumentingAgents::inspectorDebuggerAgent):
+ (WebCore::InstrumentingAgents::setInspectorDebuggerAgent):
+ * inspector/InspectorDOMDebuggerAgent.cpp:
+ * inspector/InspectorDOMDebuggerAgent.h:
+ Update namespace for debugger agent.
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::isConsoleAssertMessage):
+ (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
+ DebuggerAgent in JavaScriptCore does not yet know about console
+ types. So temporarily handle it here. We need to give JavaScriptCore
+ some concept of Console messages and types.
+
+ * inspector/PageDebuggerAgent.cpp:
+ (WebCore::PageDebuggerAgent::PageDebuggerAgent):
+ (WebCore::PageDebuggerAgent::enable):
+ (WebCore::PageDebuggerAgent::disable):
+ (WebCore::PageDebuggerAgent::sourceMapURLForScript):
+ (WebCore::PageDebuggerAgent::injectedScriptForEval):
+ * inspector/PageDebuggerAgent.h:
+ * inspector/WorkerDebuggerAgent.cpp:
+ (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
+ (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
+ * inspector/WorkerDebuggerAgent.h:
+ Modernize the Page and Worker debugger agents.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InspectorController.h:
+ * inspector/WorkerInspectorController.cpp:
+ (WebCore::WorkerInspectorController::WorkerInspectorController):
+ New constructors for the debugger agents.
+
</ins><span class="cx"> 2014-01-25 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove dead code from the JSC profiler.
</span></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersinspectoragentsInspectorDebuggerAgenth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h         (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+#ifndef WebCore_FWD_InspectorDebuggerAgent_h
+#define WebCore_FWD_InspectorDebuggerAgent_h
+#include <JavaScriptCore/InspectorDebuggerAgent.h>
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -3785,8 +3785,6 @@
</span><span class="cx">         Source/WebCore/inspector/InspectorDatabaseInstrumentation.h \
</span><span class="cx">         Source/WebCore/inspector/InspectorDatabaseResource.cpp \
</span><span class="cx">         Source/WebCore/inspector/InspectorDatabaseResource.h \
</span><del>-        Source/WebCore/inspector/InspectorDebuggerAgent.cpp \
-        Source/WebCore/inspector/InspectorDebuggerAgent.h \
</del><span class="cx">         Source/WebCore/inspector/InspectorDOMAgent.cpp \
</span><span class="cx">         Source/WebCore/inspector/InspectorDOMAgent.h \
</span><span class="cx">         Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp \
</span><span class="lines">@@ -3857,6 +3855,8 @@
</span><span class="cx">         Source/WebCore/inspector/ScriptCallStack.h \
</span><span class="cx">         Source/WebCore/inspector/TimelineRecordFactory.cpp \
</span><span class="cx">         Source/WebCore/inspector/TimelineRecordFactory.h \
</span><ins>+        Source/WebCore/inspector/WebDebuggerAgent.cpp \
+        Source/WebCore/inspector/WebDebuggerAgent.h \
</ins><span class="cx">         Source/WebCore/inspector/WorkerConsoleAgent.cpp \
</span><span class="cx">         Source/WebCore/inspector/WorkerConsoleAgent.h \
</span><span class="cx">         Source/WebCore/inspector/WorkerDebuggerAgent.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -17626,14 +17626,6 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\InspectorDebuggerAgent.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\inspector\InspectorDOMAgent.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</span><span class="lines">@@ -17898,6 +17890,14 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\inspector\WebDebuggerAgent.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\inspector\WorkerConsoleAgent.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</span><span class="lines">@@ -20853,7 +20853,6 @@
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorDatabaseAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorDatabaseInstrumentation.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorDatabaseResource.h" />
</span><del>- <ClInclude Include="..\inspector\InspectorDebuggerAgent.h" />
</del><span class="cx"> <ClInclude Include="..\inspector\InspectorDOMAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorDOMDebuggerAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorDOMStorageAgent.h" />
</span><span class="lines">@@ -20891,6 +20890,7 @@
</span><span class="cx"> <ClInclude Include="..\inspector\ScriptCallFrame.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\ScriptCallStack.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\TimelineRecordFactory.h" />
</span><ins>+ <ClInclude Include="..\inspector\WebDebuggerAgent.h" />
</ins><span class="cx"> <ClInclude Include="..\inspector\WorkerConsoleAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\WorkerDebuggerAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\WorkerInspectorController.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -4767,9 +4767,6 @@
</span><span class="cx"> <ClCompile Include="..\inspector\InspectorDatabaseResource.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\InspectorDebuggerAgent.cpp">
- <Filter>inspector</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\inspector\InspectorDOMAgent.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -4866,6 +4863,9 @@
</span><span class="cx"> <ClCompile Include="..\inspector\TimelineRecordFactory.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\inspector\WebDebuggerAgent.cpp">
+ <Filter>inspector</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\inspector\WorkerConsoleAgent.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -12296,9 +12296,6 @@
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorDatabaseResource.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\inspector\InspectorDebuggerAgent.h">
- <Filter>inspector</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\inspector\InspectorDOMAgent.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="lines">@@ -12410,6 +12407,9 @@
</span><span class="cx"> <ClInclude Include="..\inspector\TimelineRecordFactory.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\inspector\WebDebuggerAgent.h">
+ <Filter>inspector</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\inspector\WorkerConsoleAgent.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -3644,6 +3644,8 @@
</span><span class="cx">                 A5C566AB127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C566AA127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */; };
</span><span class="cx">                 A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */; };
</span><ins>+                A5E616731894581F009ADF50 /* WebDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5E616711894581F009ADF50 /* WebDebuggerAgent.cpp */; };
+                A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E616721894581F009ADF50 /* WebDebuggerAgent.h */; };
</ins><span class="cx">                 A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */; };
</span><span class="cx">                 A5F9EF701266750D00FCCF52 /* DiskImageCacheIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */; };
</span><span class="cx">                 A5F9EF711266750D00FCCF52 /* DiskImageCacheIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F9EF6F1266750D00FCCF52 /* DiskImageCacheIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6018,8 +6020,6 @@
</span><span class="cx">                 F3335BF812E07DC300D33011 /* InspectorConsoleAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3335BF612E07DC300D33011 /* InspectorConsoleAgent.cpp */; };
</span><span class="cx">                 F3335BF912E07DC300D33011 /* InspectorConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3335BF712E07DC300D33011 /* InspectorConsoleAgent.h */; };
</span><span class="cx">                 F33F0282120947F200E5743A /* ScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F33F0281120947F200E5743A /* ScriptProfile.cpp */; };
</span><del>-                F33F053D120B0DA500E5743A /* InspectorDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F33F053B120B0DA500E5743A /* InspectorDebuggerAgent.cpp */; };
-                F33F053E120B0DA500E5743A /* InspectorDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F33F053C120B0DA500E5743A /* InspectorDebuggerAgent.h */; };
</del><span class="cx">                 F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */; };
</span><span class="lines">@@ -10608,6 +10608,8 @@
</span><span class="cx">                 A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPlaybackTargetAvailabilityEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 A5DEBDA116FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitPlaybackTargetAvailabilityEvent.idl; sourceTree = "<group>"; };
</span><ins>+                A5E616711894581F009ADF50 /* WebDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDebuggerAgent.cpp; sourceTree = "<group>"; };
+                A5E616721894581F009ADF50 /* WebDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDebuggerAgent.h; sourceTree = "<group>"; };
</ins><span class="cx">                 A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autocapitalize.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskImageCacheIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">                 A5F9EF6F1266750D00FCCF52 /* DiskImageCacheIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskImageCacheIOS.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -13325,8 +13327,6 @@
</span><span class="cx">                 F3335BF612E07DC300D33011 /* InspectorConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorConsoleAgent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 F3335BF712E07DC300D33011 /* InspectorConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleAgent.h; sourceTree = "<group>"; };
</span><span class="cx">                 F33F0281120947F200E5743A /* ScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptProfile.cpp; sourceTree = "<group>"; };
</span><del>-                F33F053B120B0DA500E5743A /* InspectorDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDebuggerAgent.cpp; sourceTree = "<group>"; };
-                F33F053C120B0DA500E5743A /* InspectorDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDebuggerAgent.h; sourceTree = "<group>"; };
</del><span class="cx">                 F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClientLocal.h; sourceTree = "<group>"; };
</span><span class="cx">                 F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontendClientLocal.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -14803,8 +14803,6 @@
</span><span class="cx">                                 F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */,
</span><span class="cx">                                 41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */,
</span><span class="cx">                                 41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */,
</span><del>-                                F33F053B120B0DA500E5743A /* InspectorDebuggerAgent.cpp */,
-                                F33F053C120B0DA500E5743A /* InspectorDebuggerAgent.h */,
</del><span class="cx">                                 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */,
</span><span class="cx">                                 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */,
</span><span class="cx">                                 F3D4C47612E07663003DA150 /* InspectorDOMDebuggerAgent.cpp */,
</span><span class="lines">@@ -14881,6 +14879,8 @@
</span><span class="cx">                                 9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */,
</span><span class="cx">                                 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */,
</span><span class="cx">                                 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */,
</span><ins>+                                A5E616711894581F009ADF50 /* WebDebuggerAgent.cpp */,
+                                A5E616721894581F009ADF50 /* WebDebuggerAgent.h */,
</ins><span class="cx">                                 F382088E147D35F90010BC06 /* WorkerConsoleAgent.cpp */,
</span><span class="cx">                                 F382088F147D35F90010BC06 /* WorkerConsoleAgent.h */,
</span><span class="cx">                                 F34742DE1343631F00531BC2 /* WorkerDebuggerAgent.cpp */,
</span><span class="lines">@@ -23917,7 +23917,6 @@
</span><span class="cx">                                 7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */,
</span><span class="cx">                                 F3F5CF1312ED81B30084C569 /* InspectorDatabaseInstrumentation.h in Headers */,
</span><span class="cx">                                 41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */,
</span><del>-                                F33F053E120B0DA500E5743A /* InspectorDebuggerAgent.h in Headers */,
</del><span class="cx">                                 7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */,
</span><span class="cx">                                 5164ED44183208C700EA8FF1 /* IDBServerConnectionLevelDB.h in Headers */,
</span><span class="cx">                                 F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */,
</span><span class="lines">@@ -24689,6 +24688,7 @@
</span><span class="cx">                                 14115B5209F84B7100CA4FC1 /* Node.h in Headers */,
</span><span class="cx">                                 854FE7310A2297BE0058D7AD /* NodeFilter.h in Headers */,
</span><span class="cx">                                 854FE7330A2297BE0058D7AD /* NodeFilterCondition.h in Headers */,
</span><ins>+                                A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */,
</ins><span class="cx">                                 854FE7350A2297BE0058D7AD /* NodeIterator.h in Headers */,
</span><span class="cx">                                 A818721B0977D3C0005826D9 /* NodeList.h in Headers */,
</span><span class="cx">                                 63189AE30E83A33300012E41 /* NodeRareData.h in Headers */,
</span><span class="lines">@@ -26917,6 +26917,7 @@
</span><span class="cx">                                 078E090B17D14CEE00420AA1 /* RTCPeerConnection.cpp in Sources */,
</span><span class="cx">                                 84730D7C1248F0B300D3A9C9 /* FEDisplacementMap.cpp in Sources */,
</span><span class="cx">                                 4358E8801360A31700E4748C /* FEDropShadow.cpp in Sources */,
</span><ins>+                                A5E616731894581F009ADF50 /* WebDebuggerAgent.cpp in Sources */,
</ins><span class="cx">                                 51D719F9181106E00016DC51 /* PageGroupIndexedDatabase.cpp in Sources */,
</span><span class="cx">                                 84730D7E1248F0B300D3A9C9 /* FEFlood.cpp in Sources */,
</span><span class="cx">                                 84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */,
</span><span class="lines">@@ -27245,7 +27246,6 @@
</span><span class="cx">                                 4A9CC82016BF9BB400EC645A /* InspectorCSSOMWrappers.cpp in Sources */,
</span><span class="cx">                                 7AB0B1C01211A62200A76940 /* InspectorDatabaseAgent.cpp in Sources */,
</span><span class="cx">                                 41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */,
</span><del>-                                F33F053D120B0DA500E5743A /* InspectorDebuggerAgent.cpp in Sources */,
</del><span class="cx">                                 7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */,
</span><span class="cx">                                 0FC4E40F187F82E10045882C /* ScrollingTreeIOS.cpp in Sources */,
</span><span class="cx">                                 F3D4C47812E07663003DA150 /* InspectorDOMDebuggerAgent.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorAllInOne.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorAllInOne.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorAllInOne.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -44,7 +44,6 @@
</span><span class="cx"> #include "InspectorDOMStorageAgent.cpp"
</span><span class="cx"> #include "InspectorDatabaseAgent.cpp"
</span><span class="cx"> #include "InspectorDatabaseResource.cpp"
</span><del>-#include "InspectorDebuggerAgent.cpp"
</del><span class="cx"> #include "InspectorFrontendClientLocal.cpp"
</span><span class="cx"> #include "InspectorFrontendHost.cpp"
</span><span class="cx"> #include "InspectorHeapProfilerAgent.cpp"
</span><span class="lines">@@ -75,6 +74,7 @@
</span><span class="cx"> #include "ScriptCallFrame.cpp"
</span><span class="cx"> #include "ScriptCallStack.cpp"
</span><span class="cx"> #include "TimelineRecordFactory.cpp"
</span><ins>+#include "WebDebuggerAgent.cpp"
</ins><span class="cx"> #include "WorkerConsoleAgent.cpp"
</span><span class="cx"> #include "WorkerDebuggerAgent.cpp"
</span><span class="cx"> #include "WorkerInspectorController.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include "InspectorDOMDebuggerAgent.h"
</span><span class="cx"> #include "InspectorDOMStorageAgent.h"
</span><span class="cx"> #include "InspectorDatabaseAgent.h"
</span><del>-#include "InspectorDebuggerAgent.h"
</del><span class="cx"> #include "InspectorFrontendClient.h"
</span><span class="cx"> #include "InspectorHeapProfilerAgent.h"
</span><span class="cx"> #include "InspectorIndexedDBAgent.h"
</span><span class="lines">@@ -147,7 +146,7 @@
</span><span class="cx"> m_agents.append(std::move(consoleAgentPtr));
</span><span class="cx">
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>- auto debuggerAgentPtr = std::make_unique<PageDebuggerAgent>(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get());
</del><ins>+ auto debuggerAgentPtr = std::make_unique<PageDebuggerAgent>(m_injectedScriptManager.get(), m_instrumentingAgents.get(), pageAgent, m_overlay.get());
</ins><span class="cx"> m_debuggerAgent = debuggerAgentPtr.get();
</span><span class="cx"> m_agents.append(std::move(debuggerAgentPtr));
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.h (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.h        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorController.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -44,9 +44,10 @@
</span><span class="cx">
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> class InspectorAgent;
</span><ins>+class InspectorBackendDispatcher;
+class InspectorDebuggerAgent;
+class InspectorFrontendChannel;
</ins><span class="cx"> class InspectorObject;
</span><del>-class InspectorFrontendChannel;
-class InspectorBackendDispatcher;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -58,7 +59,6 @@
</span><span class="cx"> class InspectorClient;
</span><span class="cx"> class InspectorDOMAgent;
</span><span class="cx"> class InspectorDOMDebuggerAgent;
</span><del>-class InspectorDebuggerAgent;
</del><span class="cx"> class InspectorFrontendClient;
</span><span class="cx"> class InspectorMemoryAgent;
</span><span class="cx"> class InspectorOverlay;
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx"> InspectorPageAgent* m_pageAgent;
</span><span class="cx"> InspectorMemoryAgent* m_memoryAgent;
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>- InspectorDebuggerAgent* m_debuggerAgent;
</del><ins>+ Inspector::InspectorDebuggerAgent* m_debuggerAgent;
</ins><span class="cx"> InspectorDOMDebuggerAgent* m_domDebuggerAgent;
</span><span class="cx"> InspectorProfilerAgent* m_profilerAgent;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -29,14 +29,12 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><ins>+#include "InspectorDOMDebuggerAgent.h"
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER)
</span><span class="cx">
</span><del>-#include "InspectorDOMDebuggerAgent.h"
-
</del><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "InspectorDOMAgent.h"
</span><del>-#include "InspectorDebuggerAgent.h"
</del><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "InspectorWebFrontendDispatchers.h"
</span><span class="cx"> #include "InstrumentingAgents.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -33,9 +33,9 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
</span><span class="cx">
</span><del>-#include "InspectorDebuggerAgent.h"
</del><span class="cx"> #include "InspectorWebAgentBase.h"
</span><span class="cx"> #include "InspectorWebBackendDispatchers.h"
</span><ins>+#include <inspector/agents/InspectorDebuggerAgent.h>
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/PassOwnPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="lines">@@ -49,16 +49,15 @@
</span><span class="cx">
</span><span class="cx"> class Element;
</span><span class="cx"> class InspectorDOMAgent;
</span><del>-class InspectorDebuggerAgent;
</del><span class="cx"> class InstrumentingAgents;
</span><span class="cx"> class Node;
</span><span class="cx">
</span><span class="cx"> typedef String ErrorString;
</span><span class="cx">
</span><del>-class InspectorDOMDebuggerAgent : public InspectorAgentBase, public InspectorDebuggerAgent::Listener, public Inspector::InspectorDOMDebuggerBackendDispatcherHandler {
</del><ins>+class InspectorDOMDebuggerAgent : public InspectorAgentBase, public Inspector::InspectorDebuggerAgent::Listener, public Inspector::InspectorDOMDebuggerBackendDispatcherHandler {
</ins><span class="cx"> WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
</span><span class="cx"> public:
</span><del>- InspectorDOMDebuggerAgent(InstrumentingAgents*, InspectorDOMAgent*, InspectorDebuggerAgent*);
</del><ins>+ InspectorDOMDebuggerAgent(InstrumentingAgents*, InspectorDOMAgent*, Inspector::InspectorDebuggerAgent*);
</ins><span class="cx"> virtual ~InspectorDOMDebuggerAgent();
</span><span class="cx">
</span><span class="cx"> // DOMDebugger API
</span><span class="lines">@@ -86,7 +85,7 @@
</span><span class="cx"> virtual void discardAgent() override;
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- // InspectorDebuggerAgent::Listener implementation.
</del><ins>+ // Inspector::InspectorDebuggerAgent::Listener implementation.
</ins><span class="cx"> virtual void debuggerWasEnabled() override;
</span><span class="cx"> virtual void debuggerWasDisabled() override;
</span><span class="cx"> virtual void stepInto() override;
</span><span class="lines">@@ -103,7 +102,7 @@
</span><span class="cx"> void clear();
</span><span class="cx">
</span><span class="cx"> InspectorDOMAgent* m_domAgent;
</span><del>- InspectorDebuggerAgent* m_debuggerAgent;
</del><ins>+ Inspector::InspectorDebuggerAgent* m_debuggerAgent;
</ins><span class="cx"> RefPtr<Inspector::InspectorDOMDebuggerBackendDispatcher> m_backendDispatcher;
</span><span class="cx"> HashMap<Node*, uint32_t> m_domBreakpoints;
</span><span class="cx"> HashSet<String> m_eventListenerBreakpoints;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDebuggerAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -1,761 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2010-2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorDebuggerAgent.h"
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-
-#include "CachedResource.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "ScriptArguments.h"
-#include "Sound.h"
-#include <bindings/ScriptObject.h>
-#include <bindings/ScriptValue.h>
-#include <inspector/ContentSearchUtilities.h>
-#include <inspector/InjectedScript.h>
-#include <inspector/InjectedScriptManager.h>
-#include <inspector/InspectorValues.h>
-#include <inspector/ScriptDebugServer.h>
-#include <wtf/text/WTFString.h>
-#include <yarr/RegularExpression.h>
-
-using Inspector::TypeBuilder::Array;
-using Inspector::TypeBuilder::Debugger::FunctionDetails;
-using Inspector::TypeBuilder::Debugger::ScriptId;
-using Inspector::TypeBuilder::Runtime::RemoteObject;
-
-using namespace Inspector;
-
-namespace WebCore {
-
-const char* InspectorDebuggerAgent::backtraceObjectGroup = "backtrace";
-
-static String objectGroupForBreakpointAction(int identifier)
-{
- DEFINE_STATIC_LOCAL(const AtomicString, objectGroup, ("breakpoint-action-", AtomicString::ConstructFromLiteral));
- return makeString(objectGroup, String::number(identifier));
-}
-
-InspectorDebuggerAgent::InspectorDebuggerAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager)
- : InspectorAgentBase(ASCIILiteral("Debugger"), instrumentingAgents)
- , m_injectedScriptManager(injectedScriptManager)
- , m_pausedScriptState(nullptr)
- , m_continueToLocationBreakpointID(JSC::noBreakpointID)
- , m_enabled(false)
- , m_javaScriptPauseScheduled(false)
- , m_listener(nullptr)
- , m_nextProbeSampleId(1)
- , m_nextBreakpointActionIdentifier(1)
-{
- // FIXME: make breakReason optional so that there was no need to init it with "other".
- clearBreakDetails();
-}
-
-InspectorDebuggerAgent::~InspectorDebuggerAgent()
-{
- ASSERT(!m_instrumentingAgents->inspectorDebuggerAgent());
-}
-
-void InspectorDebuggerAgent::enable()
-{
- m_instrumentingAgents->setInspectorDebuggerAgent(this);
-
- scriptDebugServer().setBreakpointsActivated(true);
- startListeningScriptDebugServer();
-
- if (m_listener)
- m_listener->debuggerWasEnabled();
-
- m_enabled = true;
-}
-
-void InspectorDebuggerAgent::disable(bool isBeingDestroyed)
-{
- m_javaScriptBreakpoints.clear();
- m_instrumentingAgents->setInspectorDebuggerAgent(nullptr);
-
- stopListeningScriptDebugServer(isBeingDestroyed);
- clearResolvedBreakpointState();
-
- if (m_listener)
- m_listener->debuggerWasDisabled();
-
- m_enabled = false;
-}
-
-void InspectorDebuggerAgent::enable(ErrorString*)
-{
- if (m_enabled)
- return;
-
- enable();
-
- ASSERT(m_frontendDispatcher);
-}
-
-void InspectorDebuggerAgent::disable(ErrorString*)
-{
- if (!m_enabled)
- return;
-
- bool skipRecompile = false;
- disable(skipRecompile);
-}
-
-void InspectorDebuggerAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
-{
- m_frontendDispatcher = std::make_unique<InspectorDebuggerFrontendDispatcher>(frontendChannel);
- m_backendDispatcher = InspectorDebuggerBackendDispatcher::create(backendDispatcher, this);
-}
-
-void InspectorDebuggerAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason reason)
-{
- m_frontendDispatcher = nullptr;
- m_backendDispatcher.clear();
-
- bool skipRecompile = reason == InspectorDisconnectReason::InspectedTargetDestroyed;
- disable(skipRecompile);
-}
-
-void InspectorDebuggerAgent::setBreakpointsActive(ErrorString*, bool active)
-{
- if (active)
- scriptDebugServer().activateBreakpoints();
- else
- scriptDebugServer().deactivateBreakpoints();
-}
-
-bool InspectorDebuggerAgent::isPaused()
-{
- return scriptDebugServer().isPaused();
-}
-
-void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageType type)
-{
- if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptions && source == ConsoleAPIMessageSource && type == AssertMessageType)
- breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Assert, nullptr);
-}
-
-static PassRefPtr<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue)
-{
- RefPtr<InspectorObject> breakpointObject = InspectorObject::create();
- breakpointObject->setString("url", url);
- breakpointObject->setNumber("lineNumber", lineNumber);
- breakpointObject->setNumber("columnNumber", columnNumber);
- breakpointObject->setString("condition", condition);
- breakpointObject->setBoolean("isRegex", isRegex);
- breakpointObject->setBoolean("autoContinue", autoContinue);
- if (actions)
- breakpointObject->setArray("actions", actions);
-
- return breakpointObject;
-}
-
-static bool matches(const String& url, const String& pattern, bool isRegex)
-{
- if (isRegex) {
- JSC::Yarr::RegularExpression regex(pattern, TextCaseSensitive);
- return regex.match(url) != -1;
- }
- return url == pattern;
-}
-
-static bool breakpointActionTypeForString(const String& typeString, ScriptBreakpointActionType* output)
-{
- if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Log)) {
- *output = ScriptBreakpointActionTypeLog;
- return true;
- }
- if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Evaluate)) {
- *output = ScriptBreakpointActionTypeEvaluate;
- return true;
- }
- if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Sound)) {
- *output = ScriptBreakpointActionTypeSound;
- return true;
- }
- if (typeString == Inspector::TypeBuilder::getJSEnumConstantValue(Inspector::TypeBuilder::Debugger::BreakpointAction::Type::Probe)) {
- *output = ScriptBreakpointActionTypeProbe;
- return true;
- }
-
- return false;
-}
-
-bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString* errorString, RefPtr<InspectorArray>& actions, Vector<ScriptBreakpointAction>* result)
-{
- if (!actions)
- return true;
-
- unsigned actionsLength = actions->length();
- if (!actionsLength)
- return true;
-
- result->reserveCapacity(actionsLength);
- for (unsigned i = 0; i < actionsLength; ++i) {
- RefPtr<InspectorValue> value = actions->get(i);
- RefPtr<InspectorObject> object;
- if (!value->asObject(&object)) {
- *errorString = "BreakpointAction of incorrect type, expected object";
- return false;
- }
-
- String typeString;
- if (!object->getString("type", &typeString)) {
- *errorString = "BreakpointAction had type missing";
- return false;
- }
-
- ScriptBreakpointActionType type;
- if (!breakpointActionTypeForString(typeString, &type)) {
- *errorString = "BreakpointAction had unknown type";
- return false;
- }
-
- String data;
- object->getString("data", &data);
-
- result->append(ScriptBreakpointAction(type, m_nextBreakpointActionIdentifier++, data));
- }
-
- return true;
-}
-
-void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const RefPtr<InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::Location>>& locations, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers)
-{
- locations = Array<Inspector::TypeBuilder::Debugger::Location>::create();
- if (!optionalURL == !optionalURLRegex) {
- *errorString = "Either url or urlRegex must be specified.";
- return;
- }
-
- String url = optionalURL ? *optionalURL : *optionalURLRegex;
- int columnNumber = optionalColumnNumber ? *optionalColumnNumber : 0;
- bool isRegex = optionalURLRegex;
-
- String breakpointIdentifier = (isRegex ? "/" + url + "/" : url) + ':' + String::number(lineNumber) + ':' + String::number(columnNumber);
- if (m_javaScriptBreakpoints.contains(breakpointIdentifier)) {
- *errorString = "Breakpoint at specified location already exists.";
- return;
- }
-
- String condition = emptyString();
- bool autoContinue = false;
- RefPtr<InspectorArray> actions;
- if (options) {
- (*options)->getString("condition", &condition);
- (*options)->getBoolean("autoContinue", &autoContinue);
- actions = (*options)->getArray("actions");
- }
-
- Vector<ScriptBreakpointAction> breakpointActions;
- if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
- return;
-
- breakpointActionIdentifiers = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>::create();
- for (ScriptBreakpointAction& action : breakpointActions)
- breakpointActionIdentifiers->addItem(action.identifier);
-
- m_javaScriptBreakpoints.set(breakpointIdentifier, buildObjectForBreakpointCookie(url, lineNumber, columnNumber, condition, actions, isRegex, autoContinue));
-
- ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue);
- for (ScriptsMap::iterator it = m_scripts.begin(); it != m_scripts.end(); ++it) {
- String scriptURL = !it->value.sourceURL.isEmpty() ? it->value.sourceURL : it->value.url;
- if (!matches(scriptURL, url, isRegex))
- continue;
-
- RefPtr<Inspector::TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointIdentifier, it->key, breakpoint);
- if (location)
- locations->addItem(location);
- }
- *outBreakpointIdentifier = breakpointIdentifier;
-}
-
-static bool parseLocation(ErrorString* errorString, InspectorObject* location, JSC::SourceID* sourceID, unsigned* lineNumber, unsigned* columnNumber)
-{
- String scriptIDStr;
- if (!location->getString("scriptId", &scriptIDStr) || !location->getNumber("lineNumber", lineNumber)) {
- // FIXME: replace with input validation.
- *sourceID = JSC::noSourceID;
- *errorString = "scriptId and lineNumber are required.";
- return false;
- }
- *sourceID = scriptIDStr.toIntPtr();
- *columnNumber = 0;
- location->getNumber("columnNumber", columnNumber);
- return true;
-}
-
-void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, const RefPtr<InspectorObject>& location, const RefPtr<InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::TypeBuilder::Debugger::Location>& actualLocation, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers)
-{
- JSC::SourceID sourceID;
- unsigned lineNumber;
- unsigned columnNumber;
-
- if (!parseLocation(errorString, location.get(), &sourceID, &lineNumber, &columnNumber))
- return;
-
- String condition = emptyString();
- bool autoContinue = false;
- RefPtr<InspectorArray> actions;
- if (options) {
- (*options)->getString("condition", &condition);
- (*options)->getBoolean("autoContinue", &autoContinue);
- actions = (*options)->getArray("actions");
- }
-
- Vector<ScriptBreakpointAction> breakpointActions;
- if (!breakpointActionsFromProtocol(errorString, actions, &breakpointActions))
- return;
-
- breakpointActionIdentifiers = Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>::create();
- for (ScriptBreakpointAction& action : breakpointActions)
- breakpointActionIdentifiers->addItem(action.identifier);
-
- String breakpointIdentifier = String::number(sourceID) + ':' + String::number(lineNumber) + ':' + String::number(columnNumber);
- if (m_breakpointIdentifierToDebugServerBreakpointIDs.find(breakpointIdentifier) != m_breakpointIdentifierToDebugServerBreakpointIDs.end()) {
- *errorString = "Breakpoint at specified location already exists.";
- return;
- }
-
- ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition, breakpointActions, autoContinue);
- actualLocation = resolveBreakpoint(breakpointIdentifier, sourceID, breakpoint);
- if (actualLocation)
- *outBreakpointIdentifier = breakpointIdentifier;
- else
- *errorString = "Could not resolve breakpoint";
-}
-
-void InspectorDebuggerAgent::removeBreakpoint(ErrorString*, const String& breakpointIdentifier)
-{
- m_javaScriptBreakpoints.remove(breakpointIdentifier);
-
- Vector<JSC::BreakpointID> breakpointIDs = m_breakpointIdentifierToDebugServerBreakpointIDs.take(breakpointIdentifier);
- for (auto breakpointID : breakpointIDs) {
- const Vector<ScriptBreakpointAction>& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
- for (auto& action : breakpointActions)
- m_injectedScriptManager->releaseObjectGroup(objectGroupForBreakpointAction(action.identifier));
-
- scriptDebugServer().removeBreakpoint(breakpointID);
- }
-}
-
-void InspectorDebuggerAgent::continueToLocation(ErrorString* errorString, const RefPtr<InspectorObject>& location)
-{
- if (m_continueToLocationBreakpointID != JSC::noBreakpointID) {
- scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointID);
- m_continueToLocationBreakpointID = JSC::noBreakpointID;
- }
-
- JSC::SourceID sourceID;
- unsigned lineNumber;
- unsigned columnNumber;
-
- if (!parseLocation(errorString, location.get(), &sourceID, &lineNumber, &columnNumber))
- return;
-
- ScriptBreakpoint breakpoint(lineNumber, columnNumber, "", false);
- m_continueToLocationBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &lineNumber, &columnNumber);
- resume(errorString);
-}
-
-PassRefPtr<Inspector::TypeBuilder::Debugger::Location> InspectorDebuggerAgent::resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID sourceID, const ScriptBreakpoint& breakpoint)
-{
- ScriptsMap::iterator scriptIterator = m_scripts.find(sourceID);
- if (scriptIterator == m_scripts.end())
- return nullptr;
- Script& script = scriptIterator->value;
- if (breakpoint.lineNumber < script.startLine || script.endLine < breakpoint.lineNumber)
- return nullptr;
-
- unsigned actualLineNumber;
- unsigned actualColumnNumber;
- JSC::BreakpointID debugServerBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &actualLineNumber, &actualColumnNumber);
- if (debugServerBreakpointID == JSC::noBreakpointID)
- return nullptr;
-
- BreakpointIdentifierToDebugServerBreakpointIDsMap::iterator debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.find(breakpointIdentifier);
- if (debugServerBreakpointIDsIterator == m_breakpointIdentifierToDebugServerBreakpointIDs.end())
- debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.set(breakpointIdentifier, Vector<JSC::BreakpointID>()).iterator;
- debugServerBreakpointIDsIterator->value.append(debugServerBreakpointID);
-
- RefPtr<Inspector::TypeBuilder::Debugger::Location> location = Inspector::TypeBuilder::Debugger::Location::create()
- .setScriptId(String::number(sourceID))
- .setLineNumber(actualLineNumber);
- location->setColumnNumber(actualColumnNumber);
- return location;
-}
-
-void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& scriptIDStr, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>>& results)
-{
- bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
- bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
-
- JSC::SourceID sourceID = scriptIDStr.toIntPtr();
- ScriptsMap::iterator it = m_scripts.find(sourceID);
- if (it != m_scripts.end())
- results = ContentSearchUtilities::searchInTextByLines(it->value.source, query, caseSensitive, isRegex);
- else
- *error = "No script for id: " + scriptIDStr;
-}
-
-void InspectorDebuggerAgent::getScriptSource(ErrorString* error, const String& scriptIDStr, String* scriptSource)
-{
- JSC::SourceID sourceID = scriptIDStr.toIntPtr();
- ScriptsMap::iterator it = m_scripts.find(sourceID);
- if (it != m_scripts.end())
- *scriptSource = it->value.source;
- else
- *error = "No script for id: " + scriptIDStr;
-}
-
-void InspectorDebuggerAgent::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr<Inspector::TypeBuilder::Debugger::FunctionDetails>& details)
-{
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(functionId);
- if (injectedScript.hasNoValue()) {
- *errorString = "Function object id is obsolete";
- return;
- }
- injectedScript.getFunctionDetails(errorString, functionId, &details);
-}
-
-void InspectorDebuggerAgent::schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<InspectorObject> data)
-{
- if (m_javaScriptPauseScheduled)
- return;
- m_breakReason = breakReason;
- m_breakAuxData = data;
- scriptDebugServer().setPauseOnNextStatement(true);
-}
-
-void InspectorDebuggerAgent::cancelPauseOnNextStatement()
-{
- if (m_javaScriptPauseScheduled)
- return;
- clearBreakDetails();
- scriptDebugServer().setPauseOnNextStatement(false);
-}
-
-void InspectorDebuggerAgent::pause(ErrorString*)
-{
- if (m_javaScriptPauseScheduled)
- return;
- clearBreakDetails();
- scriptDebugServer().setPauseOnNextStatement(true);
- m_javaScriptPauseScheduled = true;
-}
-
-void InspectorDebuggerAgent::resume(ErrorString* errorString)
-{
- if (!assertPaused(errorString))
- return;
- m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
- scriptDebugServer().continueProgram();
-}
-
-void InspectorDebuggerAgent::stepOver(ErrorString* errorString)
-{
- if (!assertPaused(errorString))
- return;
- m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
- scriptDebugServer().stepOverStatement();
-}
-
-void InspectorDebuggerAgent::stepInto(ErrorString* errorString)
-{
- if (!assertPaused(errorString))
- return;
- m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
- scriptDebugServer().stepIntoStatement();
- m_listener->stepInto();
-}
-
-void InspectorDebuggerAgent::stepOut(ErrorString* errorString)
-{
- if (!assertPaused(errorString))
- return;
- m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
- scriptDebugServer().stepOutOfFunction();
-}
-
-void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, const String& stringPauseState)
-{
- ScriptDebugServer::PauseOnExceptionsState pauseState;
- if (stringPauseState == "none")
- pauseState = ScriptDebugServer::DontPauseOnExceptions;
- else if (stringPauseState == "all")
- pauseState = ScriptDebugServer::PauseOnAllExceptions;
- else if (stringPauseState == "uncaught")
- pauseState = ScriptDebugServer::PauseOnUncaughtExceptions;
- else {
- *errorString = "Unknown pause on exceptions mode: " + stringPauseState;
- return;
- }
-
- scriptDebugServer().setPauseOnExceptionsState(static_cast<ScriptDebugServer::PauseOnExceptionsState>(pauseState));
- if (scriptDebugServer().pauseOnExceptionsState() != pauseState)
- *errorString = "Internal error. Could not change pause on exceptions state";
-}
-
-void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& callFrameId, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
-{
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(callFrameId);
- if (injectedScript.hasNoValue()) {
- *errorString = "Inspected frame has gone";
- return;
- }
-
- ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = scriptDebugServer().pauseOnExceptionsState();
- if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) {
- if (previousPauseOnExceptionsState != ScriptDebugServer::DontPauseOnExceptions)
- scriptDebugServer().setPauseOnExceptionsState(ScriptDebugServer::DontPauseOnExceptions);
- muteConsole();
- }
-
- injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, returnByValue ? *returnByValue : false, generatePreview ? *generatePreview : false, &result, wasThrown);
-
- if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) {
- unmuteConsole();
- if (scriptDebugServer().pauseOnExceptionsState() != previousPauseOnExceptionsState)
- scriptDebugServer().setPauseOnExceptionsState(previousPauseOnExceptionsState);
- }
-}
-
-void InspectorDebuggerAgent::setOverlayMessage(ErrorString*, const String*)
-{
-}
-
-void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directiveText)
-{
- if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptions) {
- RefPtr<InspectorObject> directive = InspectorObject::create();
- directive->setString("directiveText", directiveText);
- breakProgram(InspectorDebuggerFrontendDispatcher::Reason::CSPViolation, directive.release());
- }
-}
-
-PassRefPtr<Array<Inspector::TypeBuilder::Debugger::CallFrame>> InspectorDebuggerAgent::currentCallFrames()
-{
- if (!m_pausedScriptState)
- return Array<Inspector::TypeBuilder::Debugger::CallFrame>::create();
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m_pausedScriptState);
- if (injectedScript.hasNoValue()) {
- ASSERT_NOT_REACHED();
- return Array<Inspector::TypeBuilder::Debugger::CallFrame>::create();
- }
- return injectedScript.wrapCallFrames(m_currentCallStack);
-}
-
-String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script)
-{
- DEFINE_STATIC_LOCAL(String, sourceMapHTTPHeader, (ASCIILiteral("SourceMap")));
- DEFINE_STATIC_LOCAL(String, sourceMapHTTPHeaderDeprecated, (ASCIILiteral("X-SourceMap")));
-
- if (!script.url.isEmpty()) {
- if (InspectorPageAgent* pageAgent = m_instrumentingAgents->inspectorPageAgent()) {
- CachedResource* resource = pageAgent->cachedResource(pageAgent->mainFrame(), URL(ParsedURLString, script.url));
- if (resource) {
- String sourceMapHeader = resource->response().httpHeaderField(sourceMapHTTPHeader);
- if (!sourceMapHeader.isEmpty())
- return sourceMapHeader;
-
- sourceMapHeader = resource->response().httpHeaderField(sourceMapHTTPHeaderDeprecated);
- if (!sourceMapHeader.isEmpty())
- return sourceMapHeader;
- }
- }
- }
-
- return ContentSearchUtilities::findScriptSourceMapURL(script.source);
-}
-
-// JavaScriptDebugListener functions
-
-void InspectorDebuggerAgent::didParseSource(JSC::SourceID sourceID, const Script& inScript)
-{
- Script script = inScript;
- if (!script.startLine && !script.startColumn)
- script.sourceURL = ContentSearchUtilities::findScriptSourceURL(script.source);
- script.sourceMappingURL = sourceMapURLForScript(script);
-
- bool hasSourceURL = !script.sourceURL.isEmpty();
- String scriptURL = hasSourceURL ? script.sourceURL : script.url;
- bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr;
- String* sourceMapURLParam = script.sourceMappingURL.isNull() ? nullptr : &script.sourceMappingURL;
- const bool* isContentScript = script.isContentScript ? &script.isContentScript : nullptr;
- String scriptIDStr = String::number(sourceID);
- m_frontendDispatcher->scriptParsed(scriptIDStr, scriptURL, script.startLine, script.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLParam, hasSourceURLParam);
-
- m_scripts.set(sourceID, script);
-
- if (scriptURL.isEmpty())
- return;
-
- for (auto it = m_javaScriptBreakpoints.begin(), end = m_javaScriptBreakpoints.end(); it != end; ++it) {
- RefPtr<InspectorObject> breakpointObject = it->value->asObject();
- bool isRegex;
- breakpointObject->getBoolean("isRegex", &isRegex);
- String url;
- breakpointObject->getString("url", &url);
- if (!matches(scriptURL, url, isRegex))
- continue;
- ScriptBreakpoint breakpoint;
- breakpointObject->getNumber("lineNumber", &breakpoint.lineNumber);
- breakpointObject->getNumber("columnNumber", &breakpoint.columnNumber);
- breakpointObject->getString("condition", &breakpoint.condition);
- breakpointObject->getBoolean("autoContinue", &breakpoint.autoContinue);
- ErrorString errorString;
- RefPtr<InspectorArray> actions = breakpointObject->getArray("actions");
- if (!breakpointActionsFromProtocol(&errorString, actions, &breakpoint.actions)) {
- ASSERT_NOT_REACHED();
- continue;
- }
-
- RefPtr<Inspector::TypeBuilder::Debugger::Location> location = resolveBreakpoint(it->key, sourceID, breakpoint);
- if (location)
- m_frontendDispatcher->breakpointResolved(it->key, location);
- }
-}
-
-void InspectorDebuggerAgent::failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage)
-{
- m_frontendDispatcher->scriptFailedToParse(url, data, firstLine, errorLine, errorMessage);
-}
-
-void InspectorDebuggerAgent::didPause(JSC::ExecState* scriptState, const Deprecated::ScriptValue& callFrames, const Deprecated::ScriptValue& exception)
-{
- ASSERT(scriptState && !m_pausedScriptState);
- m_pausedScriptState = scriptState;
- m_currentCallStack = callFrames;
-
- if (!exception.hasNoValue()) {
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
- if (!injectedScript.hasNoValue()) {
- m_breakReason = InspectorDebuggerFrontendDispatcher::Reason::Exception;
- m_breakAuxData = injectedScript.wrapObject(exception, "backtrace")->openAccessors();
- // m_breakAuxData might be null after this.
- }
- }
-
- m_frontendDispatcher->paused(currentCallFrames(), m_breakReason, m_breakAuxData);
- m_javaScriptPauseScheduled = false;
-
- if (m_continueToLocationBreakpointID != JSC::noBreakpointID) {
- scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointID);
- m_continueToLocationBreakpointID = JSC::noBreakpointID;
- }
- if (m_listener)
- m_listener->didPause();
-}
-
-void InspectorDebuggerAgent::didSampleProbe(JSC::ExecState* scriptState, int probeIdentifier, int hitCount, const Deprecated::ScriptValue& sample)
-{
- int sampleId = m_nextProbeSampleId++;
-
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
- RefPtr<TypeBuilder::Runtime::RemoteObject> payload = injectedScript.wrapObject(sample, objectGroupForBreakpointAction(probeIdentifier));
- RefPtr<TypeBuilder::Debugger::ProbeSample> result = TypeBuilder::Debugger::ProbeSample::create()
- .setProbeId(probeIdentifier)
- .setSampleId(sampleId)
- .setBatchId(hitCount)
- .setTimestamp(monotonicallyIncreasingTime())
- .setPayload(payload.release());
-
- m_frontendDispatcher->didSampleProbe(result.release());
-}
-
-void InspectorDebuggerAgent::breakpointActionSound()
-{
- // FIXME: We should send a message to the frontend to make the frontend beep.
- systemBeep();
-}
-
-void InspectorDebuggerAgent::didContinue()
-{
- m_pausedScriptState = nullptr;
- m_currentCallStack = Deprecated::ScriptValue();
- clearBreakDetails();
- m_frontendDispatcher->resumed();
-}
-
-void InspectorDebuggerAgent::breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<InspectorObject> data)
-{
- m_breakReason = breakReason;
- m_breakAuxData = data;
- scriptDebugServer().breakProgram();
-}
-
-void InspectorDebuggerAgent::clearResolvedBreakpointState()
-{
- ErrorString dummyError;
- Vector<String> breakpointIdentifiers;
- copyKeysToVector(m_breakpointIdentifierToDebugServerBreakpointIDs, breakpointIdentifiers);
- for (const String& identifier : breakpointIdentifiers)
- removeBreakpoint(&dummyError, identifier);
-
- scriptDebugServer().continueProgram();
-
- m_pausedScriptState = nullptr;
- m_currentCallStack = Deprecated::ScriptValue();
- m_scripts.clear();
- m_breakpointIdentifierToDebugServerBreakpointIDs.clear();
- m_continueToLocationBreakpointID = JSC::noBreakpointID;
- clearBreakDetails();
- m_javaScriptPauseScheduled = false;
- setOverlayMessage(&dummyError, nullptr);
-}
-
-bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString)
-{
- if (!m_pausedScriptState) {
- *errorString = "Can only perform operation while paused.";
- return false;
- }
- return true;
-}
-
-void InspectorDebuggerAgent::clearBreakDetails()
-{
- m_breakReason = InspectorDebuggerFrontendDispatcher::Reason::Other;
- m_breakAuxData = nullptr;
-}
-
-void InspectorDebuggerAgent::didClearGlobalObject()
-{
- if (m_frontendDispatcher)
- m_frontendDispatcher->globalObjectCleared();
-
- clearResolvedBreakpointState();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDebuggerAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -1,186 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2010-2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InspectorDebuggerAgent_h
-#define InspectorDebuggerAgent_h
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-
-#include "ConsoleAPITypes.h"
-#include "ConsoleTypes.h"
-#include "InspectorWebAgentBase.h"
-#include <bindings/ScriptValue.h>
-#include <debugger/Debugger.h>
-#include <inspector/InspectorJSBackendDispatchers.h>
-#include <inspector/InspectorJSFrontendDispatchers.h>
-#include <inspector/ScriptBreakpoint.h>
-#include <inspector/ScriptDebugListener.h>
-#include <wtf/Forward.h>
-#include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/StringHash.h>
-
-namespace Inspector {
-class InjectedScript;
-class InjectedScriptManager;
-class InspectorArray;
-class InspectorObject;
-class InspectorValue;
-class ScriptDebugServer;
-}
-
-namespace WebCore {
-
-class InstrumentingAgents;
-
-typedef String ErrorString;
-
-class InspectorDebuggerAgent : public InspectorAgentBase, public Inspector::ScriptDebugListener, public Inspector::InspectorDebuggerBackendDispatcherHandler {
- WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED;
-public:
- static const char* backtraceObjectGroup;
-
- virtual ~InspectorDebuggerAgent();
-
- virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
- virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;
-
- bool isPaused();
- void addMessageToConsole(MessageSource, MessageType);
-
- // Part of the protocol.
- virtual void enable(ErrorString*) override;
- virtual void disable(ErrorString*) override;
- virtual void setBreakpointsActive(ErrorString*, bool active) override;
-
- virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String* optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, const RefPtr<Inspector::InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId*, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::Location>>& locations, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers) override;
- virtual void setBreakpoint(ErrorString*, const RefPtr<Inspector::InspectorObject>& location, const RefPtr<Inspector::InspectorObject>* options, Inspector::TypeBuilder::Debugger::BreakpointId*, RefPtr<Inspector::TypeBuilder::Debugger::Location>& actualLocation, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::BreakpointActionIdentifier>>& breakpointActionIdentifiers) override;
- virtual void removeBreakpoint(ErrorString*, const String& breakpointIdentifier) override;
- virtual void continueToLocation(ErrorString*, const RefPtr<Inspector::InspectorObject>& location) override;
-
- virtual void searchInContent(ErrorString*, const String& scriptID, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>>&) override;
- virtual void getScriptSource(ErrorString*, const String& scriptID, String* scriptSource) override;
- virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<Inspector::TypeBuilder::Debugger::FunctionDetails>&) override;
- virtual void pause(ErrorString*) override;
- virtual void resume(ErrorString*) override;
- virtual void stepOver(ErrorString*) override;
- virtual void stepInto(ErrorString*) override;
- virtual void stepOut(ErrorString*) override;
- virtual void setPauseOnExceptions(ErrorString*, const String& pauseState) override;
- virtual void evaluateOnCallFrame(ErrorString*,
- const String& callFrameId,
- const String& expression,
- const String* objectGroup,
- const bool* includeCommandLineAPI,
- const bool* doNotPauseOnExceptionsAndMuteConsole,
- const bool* returnByValue,
- const bool* generatePreview,
- RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result,
- Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override;
- virtual void setOverlayMessage(ErrorString*, const String*) override;
-
- void schedulePauseOnNextStatement(Inspector::InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<Inspector::InspectorObject> data);
- void cancelPauseOnNextStatement();
- void breakProgram(Inspector::InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<Inspector::InspectorObject> data);
- void scriptExecutionBlockedByCSP(const String& directiveText);
-
- class Listener {
- public:
- virtual ~Listener() { }
- virtual void debuggerWasEnabled() = 0;
- virtual void debuggerWasDisabled() = 0;
- virtual void stepInto() = 0;
- virtual void didPause() = 0;
- };
- void setListener(Listener* listener) { m_listener = listener; }
-
- virtual Inspector::ScriptDebugServer& scriptDebugServer() = 0;
-
-protected:
- InspectorDebuggerAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*);
-
- virtual void startListeningScriptDebugServer() = 0;
- virtual void stopListeningScriptDebugServer(bool isBeingDestroyed) = 0;
- virtual void muteConsole() = 0;
- virtual void unmuteConsole() = 0;
- Inspector::InjectedScriptManager* injectedScriptManager() const { return m_injectedScriptManager; }
- virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
-
- virtual void enable();
- virtual void disable(bool isBeingDestroyed);
- virtual void didPause(JSC::ExecState*, const Deprecated::ScriptValue& callFrames, const Deprecated::ScriptValue& exception) override;
- virtual void didContinue() override;
- void didClearGlobalObject();
-
-private:
- PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::CallFrame>> currentCallFrames();
-
- virtual void didParseSource(JSC::SourceID, const Script&) override final;
- virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) override final;
- virtual void didSampleProbe(JSC::ExecState*, int probeIdentifier, int hitCount, const Deprecated::ScriptValue& sample) override final;
- virtual void breakpointActionSound() override final;
-
- PassRefPtr<Inspector::TypeBuilder::Debugger::Location> resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID, const Inspector::ScriptBreakpoint&);
- bool assertPaused(ErrorString*);
- void clearResolvedBreakpointState();
- void clearBreakDetails();
-
- bool breakpointActionsFromProtocol(ErrorString*, RefPtr<Inspector::InspectorArray>& actions, Vector<Inspector::ScriptBreakpointAction>* result);
-
- String sourceMapURLForScript(const Script&);
-
- typedef HashMap<JSC::SourceID, Script> ScriptsMap;
- typedef HashMap<String, Vector<JSC::BreakpointID>> BreakpointIdentifierToDebugServerBreakpointIDsMap;
- typedef HashMap<String, RefPtr<Inspector::InspectorObject>> BreakpointIdentifierToBreakpointMap;
-
- Inspector::InjectedScriptManager* m_injectedScriptManager;
- std::unique_ptr<Inspector::InspectorDebuggerFrontendDispatcher> m_frontendDispatcher;
- RefPtr<Inspector::InspectorDebuggerBackendDispatcher> m_backendDispatcher;
- JSC::ExecState* m_pausedScriptState;
- Deprecated::ScriptValue m_currentCallStack;
- ScriptsMap m_scripts;
- BreakpointIdentifierToDebugServerBreakpointIDsMap m_breakpointIdentifierToDebugServerBreakpointIDs;
- BreakpointIdentifierToBreakpointMap m_javaScriptBreakpoints;
- JSC::BreakpointID m_continueToLocationBreakpointID;
- Inspector::InspectorDebuggerFrontendDispatcher::Reason::Enum m_breakReason;
- RefPtr<Inspector::InspectorObject> m_breakAuxData;
- bool m_enabled;
- bool m_javaScriptPauseScheduled;
- Listener* m_listener;
- int m_nextProbeSampleId;
- int m_nextBreakpointActionIdentifier;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-
-#endif // !defined(InspectorDebuggerAgent_h)
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -29,11 +29,10 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><ins>+#include "InspectorInstrumentation.h"
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">
</span><del>-#include "InspectorInstrumentation.h"
-
</del><span class="cx"> #include "CSSRule.h"
</span><span class="cx"> #include "CSSStyleRule.h"
</span><span class="cx"> #include "ConsoleAPITypes.h"
</span><span class="lines">@@ -52,7 +51,6 @@
</span><span class="cx"> #include "InspectorDOMDebuggerAgent.h"
</span><span class="cx"> #include "InspectorDOMStorageAgent.h"
</span><span class="cx"> #include "InspectorDatabaseAgent.h"
</span><del>-#include "InspectorDebuggerAgent.h"
</del><span class="cx"> #include "InspectorHeapProfilerAgent.h"
</span><span class="cx"> #include "InspectorLayerTreeAgent.h"
</span><span class="cx"> #include "InspectorPageAgent.h"
</span><span class="lines">@@ -76,6 +74,7 @@
</span><span class="cx"> #include "WorkerRuntimeAgent.h"
</span><span class="cx"> #include "WorkerThread.h"
</span><span class="cx"> #include "XMLHttpRequest.h"
</span><ins>+#include <inspector/agents/InspectorDebuggerAgent.h>
</ins><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="lines">@@ -884,14 +883,23 @@
</span><span class="cx"> timelineAgent->didWriteHTML(endLine);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes.
+static bool isConsoleAssertMessage(MessageSource source, MessageType type)
+{
+ return source == ConsoleAPIMessageSource && type == AssertMessageType;
+}
+
</ins><span class="cx"> // FIXME: Drop this once we no longer generate stacks outside of Inspector.
</span><span class="cx"> void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents* instrumentingAgents, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
</span><span class="cx"> {
</span><span class="cx"> if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent())
</span><span class="cx"> consoleAgent->addMessageToConsole(source, type, level, message, callStack, requestIdentifier);
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>- if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent())
- debuggerAgent->addMessageToConsole(source, type);
</del><ins>+ // FIXME: This should just pass the message on to the debugger agent. JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes.
+ if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent()) {
+ if (isConsoleAssertMessage(source, type))
+ debuggerAgent->handleConsoleAssert();
+ }
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -900,8 +908,11 @@
</span><span class="cx"> if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent())
</span><span class="cx"> consoleAgent->addMessageToConsole(source, type, level, message, state, arguments, requestIdentifier);
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>- if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent())
- debuggerAgent->addMessageToConsole(source, type);
</del><ins>+ // FIXME: This should just pass the message on to the debugger agent. JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes.
+ if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent()) {
+ if (isConsoleAssertMessage(source, type))
+ debuggerAgent->handleConsoleAssert();
+ }
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInstrumentingAgentsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InstrumentingAgents.h (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InstrumentingAgents.h        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/InstrumentingAgents.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> class InspectorAgent;
</span><ins>+class InspectorDebuggerAgent;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -51,7 +52,6 @@
</span><span class="cx"> class InspectorDOMDebuggerAgent;
</span><span class="cx"> class InspectorDOMStorageAgent;
</span><span class="cx"> class InspectorDatabaseAgent;
</span><del>-class InspectorDebuggerAgent;
</del><span class="cx"> class InspectorHeapProfilerAgent;
</span><span class="cx"> class InspectorLayerTreeAgent;
</span><span class="cx"> class InspectorPageAgent;
</span><span class="lines">@@ -117,8 +117,8 @@
</span><span class="cx"> void setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent* agent) { m_inspectorApplicationCacheAgent = agent; }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>- InspectorDebuggerAgent* inspectorDebuggerAgent() const { return m_inspectorDebuggerAgent; }
- void setInspectorDebuggerAgent(InspectorDebuggerAgent* agent) { m_inspectorDebuggerAgent = agent; }
</del><ins>+ Inspector::InspectorDebuggerAgent* inspectorDebuggerAgent() const { return m_inspectorDebuggerAgent; }
+ void setInspectorDebuggerAgent(Inspector::InspectorDebuggerAgent* agent) { m_inspectorDebuggerAgent = agent; }
</ins><span class="cx">
</span><span class="cx"> PageDebuggerAgent* pageDebuggerAgent() const { return m_pageDebuggerAgent; }
</span><span class="cx"> void setPageDebuggerAgent(PageDebuggerAgent* agent) { m_pageDebuggerAgent = agent; }
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent;
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>- InspectorDebuggerAgent* m_inspectorDebuggerAgent;
</del><ins>+ Inspector::InspectorDebuggerAgent* m_inspectorDebuggerAgent;
</ins><span class="cx"> PageDebuggerAgent* m_pageDebuggerAgent;
</span><span class="cx"> InspectorDOMDebuggerAgent* m_inspectorDOMDebuggerAgent;
</span><span class="cx"> InspectorProfilerAgent* m_inspectorProfilerAgent;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -29,11 +29,11 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><ins>+#include "PageDebuggerAgent.h"
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
</span><span class="cx">
</span><del>-#include "PageDebuggerAgent.h"
-
</del><ins>+#include "CachedResource.h"
</ins><span class="cx"> #include "InspectorOverlay.h"
</span><span class="cx"> #include "InspectorPageAgent.h"
</span><span class="cx"> #include "InstrumentingAgents.h"
</span><span class="lines">@@ -48,29 +48,46 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-PageDebuggerAgent::PageDebuggerAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
- : InspectorDebuggerAgent(instrumentingAgents, injectedScriptManager)
</del><ins>+PageDebuggerAgent::PageDebuggerAgent(InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorOverlay* overlay)
+ : WebDebuggerAgent(injectedScriptManager, instrumentingAgents)
</ins><span class="cx"> , m_pageAgent(pageAgent)
</span><span class="cx"> , m_overlay(overlay)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PageDebuggerAgent::~PageDebuggerAgent()
-{
-}
-
</del><span class="cx"> void PageDebuggerAgent::enable()
</span><span class="cx"> {
</span><del>- InspectorDebuggerAgent::enable();
</del><ins>+ WebDebuggerAgent::enable();
</ins><span class="cx"> m_instrumentingAgents->setPageDebuggerAgent(this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageDebuggerAgent::disable(bool isBeingDestroyed)
</span><span class="cx"> {
</span><del>- InspectorDebuggerAgent::disable(isBeingDestroyed);
</del><ins>+ WebDebuggerAgent::disable(isBeingDestroyed);
</ins><span class="cx"> m_instrumentingAgents->setPageDebuggerAgent(nullptr);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String PageDebuggerAgent::sourceMapURLForScript(const Script& script)
+{
+ DEFINE_STATIC_LOCAL(String, sourceMapHTTPHeader, (ASCIILiteral("SourceMap")));
+ DEFINE_STATIC_LOCAL(String, sourceMapHTTPHeaderDeprecated, (ASCIILiteral("X-SourceMap")));
+
+ if (!script.url.isEmpty()) {
+ CachedResource* resource = m_pageAgent->cachedResource(m_pageAgent->mainFrame(), URL(ParsedURLString, script.url));
+ if (resource) {
+ String sourceMapHeader = resource->response().httpHeaderField(sourceMapHTTPHeader);
+ if (!sourceMapHeader.isEmpty())
+ return sourceMapHeader;
+
+ sourceMapHeader = resource->response().httpHeaderField(sourceMapHTTPHeaderDeprecated);
+ if (!sourceMapHeader.isEmpty())
+ return sourceMapHeader;
+ }
+ }
+
+ return InspectorDebuggerAgent::sourceMapURLForScript(script);
+}
+
</ins><span class="cx"> void PageDebuggerAgent::startListeningScriptDebugServer()
</span><span class="cx"> {
</span><span class="cx"> scriptDebugServer().addListener(this, m_pageAgent->page());
</span><span class="lines">@@ -107,9 +124,11 @@
</span><span class="cx"> JSC::ExecState* scriptState = mainWorldExecState(m_pageAgent->mainFrame());
</span><span class="cx"> return injectedScriptManager()->injectedScriptFor(scriptState);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId(*executionContextId);
</span><span class="cx"> if (injectedScript.hasNoValue())
</span><del>- *errorString = "Execution context with given id not found.";
</del><ins>+ *errorString = ASCIILiteral("Execution context with given id not found.");
+
</ins><span class="cx"> return injectedScript;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.h (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageDebuggerAgent.h        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -33,22 +33,23 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
</span><span class="cx">
</span><del>-#include "InspectorDebuggerAgent.h"
</del><span class="cx"> #include "PageScriptDebugServer.h"
</span><ins>+#include "WebDebuggerAgent.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class InspectorOverlay;
</span><span class="cx"> class InspectorPageAgent;
</span><ins>+class InstrumentingAgents;
</ins><span class="cx"> class Page;
</span><span class="cx"> class PageScriptDebugServer;
</span><span class="cx">
</span><del>-class PageDebuggerAgent final : public InspectorDebuggerAgent {
</del><ins>+class PageDebuggerAgent final : public WebDebuggerAgent {
</ins><span class="cx"> WTF_MAKE_NONCOPYABLE(PageDebuggerAgent);
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- PageDebuggerAgent(InstrumentingAgents*, InspectorPageAgent*, Inspector::InjectedScriptManager*, InspectorOverlay*);
- virtual ~PageDebuggerAgent();
</del><ins>+ PageDebuggerAgent(Inspector::InjectedScriptManager*, InstrumentingAgents*, InspectorPageAgent*, InspectorOverlay*);
+ virtual ~PageDebuggerAgent() { }
</ins><span class="cx">
</span><span class="cx"> void didClearMainFrameWindowObject();
</span><span class="cx">
</span><span class="lines">@@ -56,6 +57,8 @@
</span><span class="cx"> virtual void enable() override;
</span><span class="cx"> virtual void disable(bool isBeingDestroyed) override;
</span><span class="cx">
</span><ins>+ virtual String sourceMapURLForScript(const Script&) override;
+
</ins><span class="cx"> private:
</span><span class="cx"> virtual void startListeningScriptDebugServer() override;
</span><span class="cx"> virtual void stopListeningScriptDebugServer(bool isBeingDestroyed) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWebDebuggerAgentcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/inspector/WebDebuggerAgent.cpp (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WebDebuggerAgent.cpp         (rev 0)
+++ trunk/Source/WebCore/inspector/WebDebuggerAgent.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebDebuggerAgent.h"
+
+#if ENABLE(INSPECTOR)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include "InstrumentingAgents.h"
+
+using namespace Inspector;
+
+namespace WebCore {
+
+WebDebuggerAgent::WebDebuggerAgent(InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents)
+ : InspectorDebuggerAgent(injectedScriptManager)
+ , m_instrumentingAgents(instrumentingAgents)
+{
+}
+
+void WebDebuggerAgent::enable()
+{
+ InspectorDebuggerAgent::enable();
+ m_instrumentingAgents->setInspectorDebuggerAgent(this);
+}
+
+void WebDebuggerAgent::disable(bool isBeingDestroyed)
+{
+ InspectorDebuggerAgent::disable(isBeingDestroyed);
+ m_instrumentingAgents->setInspectorDebuggerAgent(nullptr);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+#endif // ENABLE(INSPECTOR)
</ins></span></pre></div>
<a id="trunkSourceWebCoreinspectorWebDebuggerAgenth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/inspector/WebDebuggerAgent.h (0 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WebDebuggerAgent.h         (rev 0)
+++ trunk/Source/WebCore/inspector/WebDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebDebuggerAgent_h
+#define WebDebuggerAgent_h
+
+#if ENABLE(INSPECTOR)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+#include <inspector/agents/InspectorDebuggerAgent.h>
+
+namespace WebCore {
+
+class InstrumentingAgents;
+typedef String ErrorString;
+
+class WebDebuggerAgent : public Inspector::InspectorDebuggerAgent {
+ WTF_MAKE_NONCOPYABLE(WebDebuggerAgent);
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ WebDebuggerAgent(Inspector::InjectedScriptManager*, InstrumentingAgents*);
+ virtual ~WebDebuggerAgent() { }
+
+protected:
+ virtual void enable() override;
+ virtual void disable(bool isBeingDestroyed) override;
+
+ InstrumentingAgents* m_instrumentingAgents;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(JAVASCRIPT_DEBUGGER)
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(WebDebuggerAgent_h)
</ins></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -92,8 +92,8 @@
</span><span class="cx">
</span><span class="cx"> const char* WorkerDebuggerAgent::debuggerTaskMode = "debugger";
</span><span class="cx">
</span><del>-WorkerDebuggerAgent::WorkerDebuggerAgent(InstrumentingAgents* instrumentingAgents, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager)
- : InspectorDebuggerAgent(instrumentingAgents, injectedScriptManager)
</del><ins>+WorkerDebuggerAgent::WorkerDebuggerAgent(InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, WorkerGlobalScope* inspectedWorkerGlobalScope)
+ : WebDebuggerAgent(injectedScriptManager, instrumentingAgents)
</ins><span class="cx"> , m_scriptDebugServer(inspectedWorkerGlobalScope, WorkerDebuggerAgent::debuggerTaskMode)
</span><span class="cx"> , m_inspectedWorkerGlobalScope(inspectedWorkerGlobalScope)
</span><span class="cx"> {
</span><span class="lines">@@ -140,9 +140,10 @@
</span><span class="cx"> InjectedScript WorkerDebuggerAgent::injectedScriptForEval(ErrorString* error, const int* executionContextId)
</span><span class="cx"> {
</span><span class="cx"> if (executionContextId) {
</span><del>- *error = "Execution context id is not supported for workers as there is only one execution context.";
</del><ins>+ *error = ASCIILiteral("Execution context id is not supported for workers as there is only one execution context.");
</ins><span class="cx"> return InjectedScript();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> JSC::ExecState* scriptState = execStateFromWorkerGlobalScope(m_inspectedWorkerGlobalScope);
</span><span class="cx"> return injectedScriptManager()->injectedScriptFor(scriptState);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -32,7 +32,8 @@
</span><span class="cx"> #define WorkerDebuggerAgent_h
</span><span class="cx">
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
</span><del>-#include "InspectorDebuggerAgent.h"
</del><ins>+
+#include "WebDebuggerAgent.h"
</ins><span class="cx"> #include "WorkerScriptDebugServer.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -40,11 +41,11 @@
</span><span class="cx"> class WorkerGlobalScope;
</span><span class="cx"> class WorkerThread;
</span><span class="cx">
</span><del>-class WorkerDebuggerAgent final : public InspectorDebuggerAgent {
</del><ins>+class WorkerDebuggerAgent final : public WebDebuggerAgent {
</ins><span class="cx"> WTF_MAKE_NONCOPYABLE(WorkerDebuggerAgent);
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- WorkerDebuggerAgent(InstrumentingAgents*, WorkerGlobalScope*, Inspector::InjectedScriptManager*);
</del><ins>+ WorkerDebuggerAgent(Inspector::InjectedScriptManager*, InstrumentingAgents*, WorkerGlobalScope*);
</ins><span class="cx"> virtual ~WorkerDebuggerAgent();
</span><span class="cx">
</span><span class="cx"> static const char* debuggerTaskMode;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (162798 => 162799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp        2014-01-26 07:19:08 UTC (rev 162798)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp        2014-01-26 08:39:12 UTC (rev 162799)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">
</span><span class="cx"> auto consoleAgent = std::make_unique<WorkerConsoleAgent>(m_instrumentingAgents.get(), m_injectedScriptManager.get());
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>- auto debuggerAgent = std::make_unique<WorkerDebuggerAgent>(m_instrumentingAgents.get(), &workerGlobalScope, m_injectedScriptManager.get());
</del><ins>+ auto debuggerAgent = std::make_unique<WorkerDebuggerAgent>(m_injectedScriptManager.get(), m_instrumentingAgents.get(), &workerGlobalScope);
</ins><span class="cx"> m_runtimeAgent->setScriptDebugServer(&debuggerAgent->scriptDebugServer());
</span><span class="cx"> m_agents.append(std::move(debuggerAgent));
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>