<!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>[192061] trunk/Source</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/192061">192061</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-11-05 11:22:42 -0800 (Thu, 05 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Put ScriptDebugServer into InspectorEnvironment and cleanup duplicate references
https://bugs.webkit.org/show_bug.cgi?id=150869

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2015-11-05
Reviewed by Brian Burg.

Source/JavaScriptCore:

ScriptDebugServer (JSC::Debugger) is being used by more and more agents
for instrumentation into JavaScriptCore. Currently the ScriptDebugServer
is owned by DebuggerAgent subclasses that make their own ScriptDebugServer
subclass. As more agents want to use it there was added boilerplate.
Instead, put the ScriptDebugServer in the InspectorEnvironment (Controllers).
Then each agent can access it during construction through the environment.

Do the same clean up for RuntimeAgent::globalVM, which is now just a
duplication of InspectorEnvironment::vm.

* inspector/InspectorEnvironment.h:
Add scriptDebugServer().

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::scriptDebugServer):
Own the JSGlobalObjectScriptDebugServer.

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::InspectorDebuggerAgent):
(Inspector::InspectorDebuggerAgent::enable):
(Inspector::InspectorDebuggerAgent::disable):
(Inspector::InspectorDebuggerAgent::setBreakpointsActive):
(Inspector::InspectorDebuggerAgent::isPaused):
(Inspector::InspectorDebuggerAgent::setSuppressAllPauses):
(Inspector::InspectorDebuggerAgent::handleConsoleAssert):
(Inspector::InspectorDebuggerAgent::removeBreakpoint):
(Inspector::InspectorDebuggerAgent::continueToLocation):
(Inspector::InspectorDebuggerAgent::resolveBreakpoint):
(Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
(Inspector::InspectorDebuggerAgent::cancelPauseOnNextStatement):
(Inspector::InspectorDebuggerAgent::resume):
(Inspector::InspectorDebuggerAgent::stepOver):
(Inspector::InspectorDebuggerAgent::stepInto):
(Inspector::InspectorDebuggerAgent::stepOut):
(Inspector::InspectorDebuggerAgent::setPauseOnExceptions):
(Inspector::InspectorDebuggerAgent::evaluateOnCallFrame):
(Inspector::InspectorDebuggerAgent::scriptExecutionBlockedByCSP):
(Inspector::InspectorDebuggerAgent::didPause):
(Inspector::InspectorDebuggerAgent::breakProgram):
(Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState):
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::InspectorRuntimeAgent):
(Inspector::setPauseOnExceptionsState):
(Inspector::InspectorRuntimeAgent::parse):
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
(Inspector::InspectorRuntimeAgent::setTypeProfilerEnabledState):
(Inspector::InspectorRuntimeAgent::getBasicBlocks):
Use VM and ScriptDebugServer passed during construction.

* inspector/agents/JSGlobalObjectDebuggerAgent.h:
* inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
(Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):
(Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent): Deleted.
One special case needed by this subclass as a convenience to access the global object.

* inspector/agents/JSGlobalObjectRuntimeAgent.h:
* inspector/agents/JSGlobalObjectRuntimeAgent.cpp:
(Inspector::JSGlobalObjectRuntimeAgent::globalVM): Deleted.
This virtual method is no longer needed, the base class has everything now.

Source/WebCore:

Refactoring covered by existing tests.

* WebCore.xcodeproj/project.pbxproj:
Privately export PageScriptDebuggerAgent.h due to InspectorController.h needing it.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::scriptDebugServer):
Own the PageScriptDebugServer.

* inspector/WorkerInspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::scriptDebugServer):
Own the WorkerScriptDebugServer.

(WebCore::WorkerInspectorController::vm):
Use the VM accessed through the worker global object.

* inspector/InspectorWebAgentBase.h:
(WebCore::InspectorAgentBase::InspectorAgentBase):
Given Web agents a m_environment convenience to access the InspectorEnvironment.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::timestamp):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::timestamp):
(WebCore::InspectorPageAgent::enable):
(WebCore::InspectorPageAgent::frameStartedLoading):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorTimelineAgent::internalStart):
(WebCore::InspectorTimelineAgent::internalStop):
(WebCore::InspectorTimelineAgent::timestamp):
(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::willCallFunction):
(WebCore::InspectorTimelineAgent::willEvaluateScript):
(WebCore::InspectorTimelineAgent::setPageScriptDebugServer): Deleted.
* inspector/InspectorTimelineAgent.h:
Use the InspectorEnvironment for VM / ScriptDebugServer.

* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent): Deleted.
(WebCore::PageDebuggerAgent::scriptDebugServer): Deleted.
* inspector/PageDebuggerAgent.h:
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::globalVM): Deleted.
* inspector/PageRuntimeAgent.h:
* inspector/WorkerDebuggerAgent.h:
* inspector/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::globalVM): Deleted.
* inspector/WorkerRuntimeAgent.h:
* inspector/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent): Deleted.
(WebCore::WorkerDebuggerAgent::scriptDebugServer): Deleted.
Remove now unnecessary subclass code.

(WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
One more special case for accessing Worker properties from the ScriptDebugServer.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInspectorEnvironmenth">trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllerh">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.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="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.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="#trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectRuntimeAgenth">trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCoreinspectorInspectorNetworkAgentcpp">trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgenth">trunk/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorWebAgentBaseh">trunk/Source/WebCore/inspector/InspectorWebAgentBase.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="#trunkSourceWebCoreinspectorPageRuntimeAgentcpp">trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageRuntimeAgenth">trunk/Source/WebCore/inspector/PageRuntimeAgent.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>
<li><a href="#trunkSourceWebCoreinspectorWorkerInspectorControllerh">trunk/Source/WebCore/inspector/WorkerInspectorController.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerRuntimeAgentcpp">trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerRuntimeAgenth">trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -1,3 +1,74 @@
</span><ins>+2015-11-05  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Put ScriptDebugServer into InspectorEnvironment and cleanup duplicate references
+        https://bugs.webkit.org/show_bug.cgi?id=150869
+
+        Reviewed by Brian Burg.
+
+        ScriptDebugServer (JSC::Debugger) is being used by more and more agents
+        for instrumentation into JavaScriptCore. Currently the ScriptDebugServer
+        is owned by DebuggerAgent subclasses that make their own ScriptDebugServer
+        subclass. As more agents want to use it there was added boilerplate.
+        Instead, put the ScriptDebugServer in the InspectorEnvironment (Controllers).
+        Then each agent can access it during construction through the environment.
+
+        Do the same clean up for RuntimeAgent::globalVM, which is now just a
+        duplication of InspectorEnvironment::vm.
+
+        * inspector/InspectorEnvironment.h:
+        Add scriptDebugServer().
+
+        * inspector/JSGlobalObjectInspectorController.h:
+        * inspector/JSGlobalObjectInspectorController.cpp:
+        (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
+        (Inspector::JSGlobalObjectInspectorController::scriptDebugServer):
+        Own the JSGlobalObjectScriptDebugServer.
+
+        * inspector/agents/InspectorDebuggerAgent.h:
+        * inspector/agents/InspectorDebuggerAgent.cpp:
+        (Inspector::InspectorDebuggerAgent::InspectorDebuggerAgent):
+        (Inspector::InspectorDebuggerAgent::enable):
+        (Inspector::InspectorDebuggerAgent::disable):
+        (Inspector::InspectorDebuggerAgent::setBreakpointsActive):
+        (Inspector::InspectorDebuggerAgent::isPaused):
+        (Inspector::InspectorDebuggerAgent::setSuppressAllPauses):
+        (Inspector::InspectorDebuggerAgent::handleConsoleAssert):
+        (Inspector::InspectorDebuggerAgent::removeBreakpoint):
+        (Inspector::InspectorDebuggerAgent::continueToLocation):
+        (Inspector::InspectorDebuggerAgent::resolveBreakpoint):
+        (Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
+        (Inspector::InspectorDebuggerAgent::cancelPauseOnNextStatement):
+        (Inspector::InspectorDebuggerAgent::resume):
+        (Inspector::InspectorDebuggerAgent::stepOver):
+        (Inspector::InspectorDebuggerAgent::stepInto):
+        (Inspector::InspectorDebuggerAgent::stepOut):
+        (Inspector::InspectorDebuggerAgent::setPauseOnExceptions):
+        (Inspector::InspectorDebuggerAgent::evaluateOnCallFrame):
+        (Inspector::InspectorDebuggerAgent::scriptExecutionBlockedByCSP):
+        (Inspector::InspectorDebuggerAgent::didPause):
+        (Inspector::InspectorDebuggerAgent::breakProgram):
+        (Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState):
+        * inspector/agents/InspectorRuntimeAgent.h:
+        * inspector/agents/InspectorRuntimeAgent.cpp:
+        (Inspector::InspectorRuntimeAgent::InspectorRuntimeAgent):
+        (Inspector::setPauseOnExceptionsState):
+        (Inspector::InspectorRuntimeAgent::parse):
+        (Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
+        (Inspector::InspectorRuntimeAgent::setTypeProfilerEnabledState):
+        (Inspector::InspectorRuntimeAgent::getBasicBlocks):
+        Use VM and ScriptDebugServer passed during construction.
+
+        * inspector/agents/JSGlobalObjectDebuggerAgent.h:
+        * inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
+        (Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):
+        (Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent): Deleted.
+        One special case needed by this subclass as a convenience to access the global object.
+
+        * inspector/agents/JSGlobalObjectRuntimeAgent.h:
+        * inspector/agents/JSGlobalObjectRuntimeAgent.cpp:
+        (Inspector::JSGlobalObjectRuntimeAgent::globalVM): Deleted.
+        This virtual method is no longer needed, the base class has everything now.
+
</ins><span class="cx"> 2015-11-05  Xabier Rodriguez Calvar  &lt;calvaris@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Shield implementation from user mangling Promise.reject and resolve methods
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInspectorEnvironmenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><ins>+class ScriptDebugServer;
</ins><span class="cx"> typedef JSC::JSValue (*InspectorFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, NakedPtr&lt;JSC::Exception&gt;&amp; returnedException);
</span><span class="cx"> typedef JSC::JSValue (*InspectorEvaluateHandler)(JSC::ExecState*, const JSC::SourceCode&amp;, JSC::JSValue thisValue, NakedPtr&lt;JSC::Exception&gt;&amp; returnedException);
</span><span class="cx"> 
</span><span class="lines">@@ -54,6 +55,7 @@
</span><span class="cx">     virtual void didCallInjectedScriptFunction(JSC::ExecState*) = 0;
</span><span class="cx">     virtual void frontendInitialized() = 0;
</span><span class="cx">     virtual Ref&lt;WTF::Stopwatch&gt; executionStopwatch() = 0;
</span><ins>+    virtual ScriptDebugServer&amp; scriptDebugServer() = 0;
</ins><span class="cx">     virtual JSC::VM&amp; vm() = 0;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx">     : m_globalObject(globalObject)
</span><span class="cx">     , m_injectedScriptManager(std::make_unique&lt;InjectedScriptManager&gt;(*this, InjectedScriptHost::create()))
</span><span class="cx">     , m_executionStopwatch(Stopwatch::create())
</span><ins>+    , m_scriptDebugServer(globalObject)
</ins><span class="cx">     , m_frontendRouter(FrontendRouter::create())
</span><span class="cx">     , m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))
</span><span class="cx"> {
</span><span class="lines">@@ -85,21 +86,17 @@
</span><span class="cx">     auto runtimeAgent = std::make_unique&lt;JSGlobalObjectRuntimeAgent&gt;(context);
</span><span class="cx">     auto consoleAgent = std::make_unique&lt;JSGlobalObjectConsoleAgent&gt;(context);
</span><span class="cx">     auto debuggerAgent = std::make_unique&lt;JSGlobalObjectDebuggerAgent&gt;(context, consoleAgent.get());
</span><del>-    auto heapAgent = std::make_unique&lt;InspectorHeapAgent&gt;(context);
</del><span class="cx"> 
</span><span class="cx">     m_inspectorAgent = inspectorAgent.get();
</span><span class="cx">     m_debuggerAgent = debuggerAgent.get();
</span><del>-    m_heapAgent = heapAgent.get();
</del><span class="cx">     m_consoleAgent = consoleAgent.get();
</span><span class="cx">     m_consoleClient = std::make_unique&lt;JSGlobalObjectConsoleClient&gt;(m_consoleAgent);
</span><span class="cx"> 
</span><del>-    runtimeAgent-&gt;setScriptDebugServer(&amp;debuggerAgent-&gt;scriptDebugServer());
-
</del><span class="cx">     m_agents.append(WTF::move(inspectorAgent));
</span><span class="cx">     m_agents.append(WTF::move(runtimeAgent));
</span><span class="cx">     m_agents.append(WTF::move(consoleAgent));
</span><span class="cx">     m_agents.append(WTF::move(debuggerAgent));
</span><del>-    m_agents.append(WTF::move(heapAgent));
</del><ins>+    m_agents.append(std::make_unique&lt;InspectorHeapAgent&gt;(context));
</ins><span class="cx"> 
</span><span class="cx">     m_executionStopwatch-&gt;start();
</span><span class="cx"> }
</span><span class="lines">@@ -285,6 +282,11 @@
</span><span class="cx">     return m_executionStopwatch.copyRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSGlobalObjectScriptDebugServer&amp; JSGlobalObjectInspectorController::scriptDebugServer()
+{
+    return m_scriptDebugServer;
+}
+
</ins><span class="cx"> VM&amp; JSGlobalObjectInspectorController::vm()
</span><span class="cx"> {
</span><span class="cx">     return m_globalObject.vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;InspectorAgentRegistry.h&quot;
</span><span class="cx"> #include &quot;InspectorEnvironment.h&quot;
</span><span class="cx"> #include &quot;InspectorFrontendRouter.h&quot;
</span><ins>+#include &quot;JSGlobalObjectScriptDebugServer.h&quot;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -37,10 +38,6 @@
</span><span class="cx"> #include &quot;AugmentableInspectorController.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-namespace WTF {
-class Stopwatch;
-}
-
</del><span class="cx"> namespace JSC {
</span><span class="cx"> class ConsoleClient;
</span><span class="cx"> class Exception;
</span><span class="lines">@@ -97,6 +94,7 @@
</span><span class="cx">     virtual void didCallInjectedScriptFunction(JSC::ExecState*) override { }
</span><span class="cx">     virtual void frontendInitialized() override;
</span><span class="cx">     virtual Ref&lt;WTF::Stopwatch&gt; executionStopwatch() override;
</span><ins>+    virtual JSGlobalObjectScriptDebugServer&amp; scriptDebugServer() override;
</ins><span class="cx">     virtual JSC::VM&amp; vm() override;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
</span><span class="lines">@@ -115,12 +113,12 @@
</span><span class="cx">     std::unique_ptr&lt;InjectedScriptManager&gt; m_injectedScriptManager;
</span><span class="cx">     std::unique_ptr&lt;JSGlobalObjectConsoleClient&gt; m_consoleClient;
</span><span class="cx">     Ref&lt;WTF::Stopwatch&gt; m_executionStopwatch;
</span><ins>+    JSGlobalObjectScriptDebugServer m_scriptDebugServer;
</ins><span class="cx"> 
</span><span class="cx">     AgentRegistry m_agents;
</span><span class="cx">     InspectorAgent* m_inspectorAgent { nullptr };
</span><span class="cx">     InspectorConsoleAgent* m_consoleAgent { nullptr };
</span><span class="cx">     InspectorDebuggerAgent* m_debuggerAgent { nullptr };
</span><del>-    InspectorHeapAgent* m_heapAgent { nullptr };
</del><span class="cx"> 
</span><span class="cx">     Ref&lt;FrontendRouter&gt; m_frontendRouter;
</span><span class="cx">     Ref&lt;BackendDispatcher&gt; m_backendDispatcher;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx">     , m_injectedScriptManager(context.injectedScriptManager)
</span><span class="cx">     , m_frontendDispatcher(std::make_unique&lt;DebuggerFrontendDispatcher&gt;(context.frontendRouter))
</span><span class="cx">     , m_backendDispatcher(DebuggerBackendDispatcher::create(context.backendDispatcher, this))
</span><ins>+    , m_scriptDebugServer(context.environment.scriptDebugServer())
</ins><span class="cx">     , m_continueToLocationBreakpointID(JSC::noBreakpointID)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: make breakReason optional so that there was no need to init it with &quot;other&quot;.
</span><span class="lines">@@ -86,8 +87,8 @@
</span><span class="cx">     if (m_enabled)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    scriptDebugServer().setBreakpointsActivated(true);
-    scriptDebugServer().addListener(this);
</del><ins>+    m_scriptDebugServer.setBreakpointsActivated(true);
+    m_scriptDebugServer.addListener(this);
</ins><span class="cx"> 
</span><span class="cx">     if (m_listener)
</span><span class="cx">         m_listener-&gt;debuggerWasEnabled();
</span><span class="lines">@@ -100,7 +101,7 @@
</span><span class="cx">     if (!m_enabled)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    scriptDebugServer().removeListener(this, isBeingDestroyed);
</del><ins>+    m_scriptDebugServer.removeListener(this, isBeingDestroyed);
</ins><span class="cx">     clearInspectorBreakpointState();
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_javaScriptBreakpoints.isEmpty());
</span><span class="lines">@@ -124,19 +125,19 @@
</span><span class="cx"> void InspectorDebuggerAgent::setBreakpointsActive(ErrorString&amp;, bool active)
</span><span class="cx"> {
</span><span class="cx">     if (active)
</span><del>-        scriptDebugServer().activateBreakpoints();
</del><ins>+        m_scriptDebugServer.activateBreakpoints();
</ins><span class="cx">     else
</span><del>-        scriptDebugServer().deactivateBreakpoints();
</del><ins>+        m_scriptDebugServer.deactivateBreakpoints();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InspectorDebuggerAgent::isPaused()
</span><span class="cx"> {
</span><del>-    return scriptDebugServer().isPaused();
</del><ins>+    return m_scriptDebugServer.isPaused();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::setSuppressAllPauses(bool suppress)
</span><span class="cx"> {
</span><del>-    scriptDebugServer().setSuppressAllPauses(suppress);
</del><ins>+    m_scriptDebugServer.setSuppressAllPauses(suppress);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;InspectorObject&gt; buildAssertPauseReason(const String&amp; message)
</span><span class="lines">@@ -183,7 +184,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::handleConsoleAssert(const String&amp; message)
</span><span class="cx"> {
</span><del>-    if (scriptDebugServer().pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions)
</del><ins>+    if (m_scriptDebugServer.pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions)
</ins><span class="cx">         breakProgram(DebuggerFrontendDispatcher::Reason::Assert, buildAssertPauseReason(message));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -388,18 +389,18 @@
</span><span class="cx">     for (JSC::BreakpointID breakpointID : m_breakpointIdentifierToDebugServerBreakpointIDs.take(breakpointIdentifier)) {
</span><span class="cx">         m_debuggerBreakpointIdentifierToInspectorBreakpointIdentifier.remove(breakpointID);
</span><span class="cx"> 
</span><del>-        const BreakpointActions&amp; breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
</del><ins>+        const BreakpointActions&amp; breakpointActions = m_scriptDebugServer.getActionsForBreakpoint(breakpointID);
</ins><span class="cx">         for (auto&amp; action : breakpointActions)
</span><span class="cx">             m_injectedScriptManager.releaseObjectGroup(objectGroupForBreakpointAction(action));
</span><span class="cx"> 
</span><del>-        scriptDebugServer().removeBreakpoint(breakpointID);
</del><ins>+        m_scriptDebugServer.removeBreakpoint(breakpointID);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::continueToLocation(ErrorString&amp; errorString, const InspectorObject&amp; location)
</span><span class="cx"> {
</span><span class="cx">     if (m_continueToLocationBreakpointID != JSC::noBreakpointID) {
</span><del>-        scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointID);
</del><ins>+        m_scriptDebugServer.removeBreakpoint(m_continueToLocationBreakpointID);
</ins><span class="cx">         m_continueToLocationBreakpointID = JSC::noBreakpointID;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -410,7 +411,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ScriptBreakpoint breakpoint(lineNumber, columnNumber, &quot;&quot;, false, 0);
</span><del>-    m_continueToLocationBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &amp;lineNumber, &amp;columnNumber);
</del><ins>+    m_continueToLocationBreakpointID = m_scriptDebugServer.setBreakpoint(sourceID, breakpoint, &amp;lineNumber, &amp;columnNumber);
</ins><span class="cx">     resume(errorString);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -425,7 +426,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned actualLineNumber;
</span><span class="cx">     unsigned actualColumnNumber;
</span><del>-    JSC::BreakpointID debugServerBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &amp;actualLineNumber, &amp;actualColumnNumber);
</del><ins>+    JSC::BreakpointID debugServerBreakpointID = m_scriptDebugServer.setBreakpoint(sourceID, breakpoint, &amp;actualLineNumber, &amp;actualColumnNumber);
</ins><span class="cx">     if (debugServerBreakpointID == JSC::noBreakpointID)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -486,7 +487,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_breakReason = breakReason;
</span><span class="cx">     m_breakAuxData = WTF::move(data);
</span><del>-    scriptDebugServer().setPauseOnNextStatement(true);
</del><ins>+    m_scriptDebugServer.setPauseOnNextStatement(true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::cancelPauseOnNextStatement()
</span><span class="lines">@@ -495,7 +496,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     clearBreakDetails();
</span><del>-    scriptDebugServer().setPauseOnNextStatement(false);
</del><ins>+    m_scriptDebugServer.setPauseOnNextStatement(false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::pause(ErrorString&amp;)
</span><span class="lines">@@ -510,7 +511,7 @@
</span><span class="cx">     if (!assertPaused(errorString))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    scriptDebugServer().continueProgram();
</del><ins>+    m_scriptDebugServer.continueProgram();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::stepOver(ErrorString&amp; errorString)
</span><span class="lines">@@ -518,7 +519,7 @@
</span><span class="cx">     if (!assertPaused(errorString))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    scriptDebugServer().stepOverStatement();
</del><ins>+    m_scriptDebugServer.stepOverStatement();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::stepInto(ErrorString&amp; errorString)
</span><span class="lines">@@ -526,7 +527,7 @@
</span><span class="cx">     if (!assertPaused(errorString))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    scriptDebugServer().stepIntoStatement();
</del><ins>+    m_scriptDebugServer.stepIntoStatement();
</ins><span class="cx"> 
</span><span class="cx">     if (m_listener)
</span><span class="cx">         m_listener-&gt;stepInto();
</span><span class="lines">@@ -537,7 +538,7 @@
</span><span class="cx">     if (!assertPaused(errorString))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    scriptDebugServer().stepOutOfFunction();
</del><ins>+    m_scriptDebugServer.stepOutOfFunction();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString&amp; errorString, const String&amp; stringPauseState)
</span><span class="lines">@@ -554,8 +555,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    scriptDebugServer().setPauseOnExceptionsState(static_cast&lt;JSC::Debugger::PauseOnExceptionsState&gt;(pauseState));
-    if (scriptDebugServer().pauseOnExceptionsState() != pauseState)
</del><ins>+    m_scriptDebugServer.setPauseOnExceptionsState(static_cast&lt;JSC::Debugger::PauseOnExceptionsState&gt;(pauseState));
+    if (m_scriptDebugServer.pauseOnExceptionsState() != pauseState)
</ins><span class="cx">         errorString = ASCIILiteral(&quot;Internal error. Could not change pause on exceptions state&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -567,10 +568,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSC::Debugger::PauseOnExceptionsState previousPauseOnExceptionsState = scriptDebugServer().pauseOnExceptionsState();
</del><ins>+    JSC::Debugger::PauseOnExceptionsState previousPauseOnExceptionsState = m_scriptDebugServer.pauseOnExceptionsState();
</ins><span class="cx">     if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) {
</span><span class="cx">         if (previousPauseOnExceptionsState != JSC::Debugger::DontPauseOnExceptions)
</span><del>-            scriptDebugServer().setPauseOnExceptionsState(JSC::Debugger::DontPauseOnExceptions);
</del><ins>+            m_scriptDebugServer.setPauseOnExceptionsState(JSC::Debugger::DontPauseOnExceptions);
</ins><span class="cx">         muteConsole();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -578,8 +579,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) {
</span><span class="cx">         unmuteConsole();
</span><del>-        if (scriptDebugServer().pauseOnExceptionsState() != previousPauseOnExceptionsState)
-            scriptDebugServer().setPauseOnExceptionsState(previousPauseOnExceptionsState);
</del><ins>+        if (m_scriptDebugServer.pauseOnExceptionsState() != previousPauseOnExceptionsState)
+            m_scriptDebugServer.setPauseOnExceptionsState(previousPauseOnExceptionsState);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -589,7 +590,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String&amp; directiveText)
</span><span class="cx"> {
</span><del>-    if (scriptDebugServer().pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions)
</del><ins>+    if (m_scriptDebugServer.pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions)
</ins><span class="cx">         breakProgram(DebuggerFrontendDispatcher::Reason::CSPViolation, buildCSPViolationPauseReason(directiveText));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -670,9 +671,9 @@
</span><span class="cx"> 
</span><span class="cx">     // If a high level pause pause reason is not already set, try to infer a reason from the debugger.
</span><span class="cx">     if (m_breakReason == DebuggerFrontendDispatcher::Reason::Other) {
</span><del>-        switch (scriptDebugServer().reasonForPause()) {
</del><ins>+        switch (m_scriptDebugServer.reasonForPause()) {
</ins><span class="cx">         case JSC::Debugger::PausedForBreakpoint: {
</span><del>-            JSC::BreakpointID debuggerBreakpointId = scriptDebugServer().pausingBreakpointID();
</del><ins>+            JSC::BreakpointID debuggerBreakpointId = m_scriptDebugServer.pausingBreakpointID();
</ins><span class="cx">             if (debuggerBreakpointId != m_continueToLocationBreakpointID) {
</span><span class="cx">                 m_breakReason = DebuggerFrontendDispatcher::Reason::Breakpoint;
</span><span class="cx">                 m_breakAuxData = buildBreakpointPauseReason(debuggerBreakpointId);
</span><span class="lines">@@ -710,7 +711,7 @@
</span><span class="cx">     m_javaScriptPauseScheduled = false;
</span><span class="cx"> 
</span><span class="cx">     if (m_continueToLocationBreakpointID != JSC::noBreakpointID) {
</span><del>-        scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointID);
</del><ins>+        m_scriptDebugServer.removeBreakpoint(m_continueToLocationBreakpointID);
</ins><span class="cx">         m_continueToLocationBreakpointID = JSC::noBreakpointID;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -764,7 +765,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_breakReason = breakReason;
</span><span class="cx">     m_breakAuxData = WTF::move(data);
</span><del>-    scriptDebugServer().breakProgram();
</del><ins>+    m_scriptDebugServer.breakProgram();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::clearInspectorBreakpointState()
</span><span class="lines">@@ -782,7 +783,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::clearDebuggerBreakpointState()
</span><span class="cx"> {
</span><del>-    scriptDebugServer().clearBreakpoints();
</del><ins>+    m_scriptDebugServer.clearBreakpoints();
</ins><span class="cx"> 
</span><span class="cx">     m_pausedScriptState = nullptr;
</span><span class="cx">     m_currentCallStack = Deprecated::ScriptValue();
</span><span class="lines">@@ -794,7 +795,7 @@
</span><span class="cx">     m_javaScriptPauseScheduled = false;
</span><span class="cx">     m_hasExceptionValue = false;
</span><span class="cx"> 
</span><del>-    scriptDebugServer().continueProgram();
</del><ins>+    m_scriptDebugServer.continueProgram();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::didClearGlobalObject()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -43,10 +43,6 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><del>-namespace WTF {
-class Stopwatch;
-}
-
</del><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><span class="cx"> class InjectedScript;
</span><span class="lines">@@ -108,14 +104,14 @@
</span><span class="cx">     };
</span><span class="cx">     void setListener(Listener* listener) { m_listener = listener; }
</span><span class="cx"> 
</span><del>-    virtual ScriptDebugServer&amp; scriptDebugServer() = 0;
-
</del><span class="cx"> protected:
</span><span class="cx">     InspectorDebuggerAgent(AgentContext&amp;);
</span><span class="cx"> 
</span><span class="cx">     InjectedScriptManager&amp; injectedScriptManager() const { return m_injectedScriptManager; }
</span><span class="cx">     virtual InjectedScript injectedScriptForEval(ErrorString&amp;, const int* executionContextId) = 0;
</span><span class="cx"> 
</span><ins>+    ScriptDebugServer&amp; scriptDebugServer() { return m_scriptDebugServer; }
+
</ins><span class="cx">     virtual void muteConsole() = 0;
</span><span class="cx">     virtual void unmuteConsole() = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -157,6 +153,7 @@
</span><span class="cx">     InjectedScriptManager&amp; m_injectedScriptManager;
</span><span class="cx">     std::unique_ptr&lt;DebuggerFrontendDispatcher&gt; m_frontendDispatcher;
</span><span class="cx">     RefPtr&lt;DebuggerBackendDispatcher&gt; m_backendDispatcher;
</span><ins>+    ScriptDebugServer&amp; m_scriptDebugServer;
</ins><span class="cx">     Listener* m_listener { nullptr };
</span><span class="cx">     JSC::ExecState* m_pausedScriptState { nullptr };
</span><span class="cx">     Deprecated::ScriptValue m_currentCallStack;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -60,6 +60,8 @@
</span><span class="cx"> InspectorRuntimeAgent::InspectorRuntimeAgent(AgentContext&amp; context)
</span><span class="cx">     : InspectorAgentBase(ASCIILiteral(&quot;Runtime&quot;))
</span><span class="cx">     , m_injectedScriptManager(context.injectedScriptManager)
</span><ins>+    , m_scriptDebugServer(context.environment.scriptDebugServer())
+    , m_vm(context.environment.vm())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -67,12 +69,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(ScriptDebugServer* scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newState)
</del><ins>+static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(ScriptDebugServer&amp; scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newState)
</ins><span class="cx"> {
</span><del>-    ASSERT(scriptDebugServer);
-    ScriptDebugServer::PauseOnExceptionsState presentState = scriptDebugServer-&gt;pauseOnExceptionsState();
</del><ins>+    ScriptDebugServer::PauseOnExceptionsState presentState = scriptDebugServer.pauseOnExceptionsState();
</ins><span class="cx">     if (presentState != newState)
</span><del>-        scriptDebugServer-&gt;setPauseOnExceptionsState(newState);
</del><ins>+        scriptDebugServer.setPauseOnExceptionsState(newState);
</ins><span class="cx">     return presentState;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -86,11 +87,10 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorRuntimeAgent::parse(ErrorString&amp;, const String&amp; expression, Inspector::Protocol::Runtime::SyntaxErrorType* result, Inspector::Protocol::OptOutput&lt;String&gt;* message, RefPtr&lt;Inspector::Protocol::Runtime::ErrorRange&gt;&amp; range)
</span><span class="cx"> {
</span><del>-    VM&amp; vm = globalVM();
-    JSLockHolder lock(vm);
</del><ins>+    JSLockHolder lock(m_vm);
</ins><span class="cx"> 
</span><span class="cx">     ParserError error;
</span><del>-    checkSyntax(vm, JSC::makeSource(expression), error);
</del><ins>+    checkSyntax(m_vm, JSC::makeSource(expression), error);
</ins><span class="cx"> 
</span><span class="cx">     switch (error.syntaxErrorType()) {
</span><span class="cx">     case ParserError::SyntaxErrorNone:
</span><span class="lines">@@ -249,15 +249,15 @@
</span><span class="cx"> void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString&amp; errorString, const Inspector::InspectorArray&amp; locations, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::TypeDescription&gt;&gt;&amp; typeDescriptions)
</span><span class="cx"> {
</span><span class="cx">     static const bool verbose = false;
</span><del>-    VM&amp; vm = globalVM();
</del><ins>+
</ins><span class="cx">     typeDescriptions = Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::TypeDescription&gt;::create();
</span><del>-    if (!vm.typeProfiler()) {
</del><ins>+    if (!m_vm.typeProfiler()) {
</ins><span class="cx">         errorString = ASCIILiteral(&quot;The VM does not currently have Type Information.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     double start = currentTimeMS();
</span><del>-    vm.typeProfilerLog()-&gt;processLogEntries(ASCIILiteral(&quot;User Query&quot;));
</del><ins>+    m_vm.typeProfilerLog()-&gt;processLogEntries(ASCIILiteral(&quot;User Query&quot;));
</ins><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; locations.length(); i++) {
</span><span class="cx">         RefPtr&lt;Inspector::InspectorValue&gt; value = locations.get(i);
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx">         location-&gt;getInteger(ASCIILiteral(&quot;divot&quot;), divot);
</span><span class="cx"> 
</span><span class="cx">         bool okay;
</span><del>-        TypeLocation* typeLocation = vm.typeProfiler()-&gt;findLocation(divot, sourceIDAsString.toIntPtrStrict(&amp;okay), static_cast&lt;TypeProfilerSearchDescriptor&gt;(descriptor), vm);
</del><ins>+        TypeLocation* typeLocation = m_vm.typeProfiler()-&gt;findLocation(divot, sourceIDAsString.toIntPtrStrict(&amp;okay), static_cast&lt;TypeProfilerSearchDescriptor&gt;(descriptor), m_vm);
</ins><span class="cx">         ASSERT(okay);
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;TypeSet&gt; typeSet;
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx">         return;
</span><span class="cx">     m_isTypeProfilingEnabled = isTypeProfilingEnabled;
</span><span class="cx"> 
</span><del>-    VM&amp; vm = globalVM();
</del><ins>+    VM&amp; vm = m_vm;
</ins><span class="cx">     vm.whenIdle([&amp;vm, isTypeProfilingEnabled] () {
</span><span class="cx">         bool shouldRecompileFromTypeProfiler = (isTypeProfilingEnabled ? vm.enableTypeProfiler() : vm.disableTypeProfiler());
</span><span class="cx">         bool shouldRecompileFromControlFlowProfiler = (isTypeProfilingEnabled ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
</span><span class="lines">@@ -341,8 +341,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorRuntimeAgent::getBasicBlocks(ErrorString&amp; errorString, const String&amp; sourceIDAsString, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::BasicBlock&gt;&gt;&amp; basicBlocks)
</span><span class="cx"> {
</span><del>-    VM&amp; vm = globalVM();
-    if (!vm.controlFlowProfiler()) {
</del><ins>+    if (!m_vm.controlFlowProfiler()) {
</ins><span class="cx">         errorString = ASCIILiteral(&quot;The VM does not currently have a Control Flow Profiler.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -350,7 +349,7 @@
</span><span class="cx">     bool okay;
</span><span class="cx">     intptr_t sourceID = sourceIDAsString.toIntPtrStrict(&amp;okay);
</span><span class="cx">     ASSERT(okay);
</span><del>-    const Vector&lt;BasicBlockRange&gt;&amp; basicBlockRanges = vm.controlFlowProfiler()-&gt;getBasicBlocksForSourceID(sourceID, vm);
</del><ins>+    const Vector&lt;BasicBlockRange&gt;&amp; basicBlockRanges = m_vm.controlFlowProfiler()-&gt;getBasicBlocksForSourceID(sourceID, m_vm);
</ins><span class="cx">     basicBlocks = Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::BasicBlock&gt;::create();
</span><span class="cx">     for (const BasicBlockRange&amp; block : basicBlockRanges) {
</span><span class="cx">         Ref&lt;Inspector::Protocol::Runtime::BasicBlock&gt; location = Inspector::Protocol::Runtime::BasicBlock::create()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -73,8 +73,6 @@
</span><span class="cx">     virtual void enableTypeProfiler(ErrorString&amp;) override;
</span><span class="cx">     virtual void disableTypeProfiler(ErrorString&amp;) override;
</span><span class="cx">     virtual void getBasicBlocks(ErrorString&amp;, const String&amp; in_sourceID, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::BasicBlock&gt;&gt;&amp; out_basicBlocks) override;
</span><del>-    
-    void setScriptDebugServer(ScriptDebugServer* scriptDebugServer) { m_scriptDebugServer = scriptDebugServer; }
</del><span class="cx"> 
</span><span class="cx">     bool enabled() const { return m_enabled; }
</span><span class="cx"> 
</span><span class="lines">@@ -83,7 +81,6 @@
</span><span class="cx"> 
</span><span class="cx">     InjectedScriptManager&amp; injectedScriptManager() { return m_injectedScriptManager; }
</span><span class="cx"> 
</span><del>-    virtual JSC::VM&amp; globalVM() = 0;
</del><span class="cx">     virtual InjectedScript injectedScriptForEval(ErrorString&amp;, const int* executionContextId) = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual void muteConsole() = 0;
</span><span class="lines">@@ -93,9 +90,10 @@
</span><span class="cx">     void setTypeProfilerEnabledState(bool);
</span><span class="cx"> 
</span><span class="cx">     InjectedScriptManager&amp; m_injectedScriptManager;
</span><del>-    ScriptDebugServer* m_scriptDebugServer { nullptr };
-    bool m_enabled { false };
-    bool m_isTypeProfilingEnabled { false };
</del><ins>+    ScriptDebugServer&amp; m_scriptDebugServer;
+    JSC::VM&amp; m_vm;
+    bool m_enabled {false};
+    bool m_isTypeProfilingEnabled {false};
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace Inspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> 
</span><span class="cx"> JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent(JSAgentContext&amp; context, InspectorConsoleAgent* consoleAgent)
</span><span class="cx">     : InspectorDebuggerAgent(context)
</span><del>-    , m_scriptDebugServer(context.inspectedGlobalObject)
</del><span class="cx">     , m_consoleAgent(consoleAgent)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -52,7 +51,7 @@
</span><span class="cx">         return InjectedScript();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ExecState* exec = m_scriptDebugServer.globalObject().globalExec();
</del><ins>+    ExecState* exec = static_cast&lt;JSGlobalObjectScriptDebugServer&amp;&gt;(scriptDebugServer()).globalObject().globalExec();
</ins><span class="cx">     return injectedScriptManager().injectedScriptFor(exec);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -40,8 +40,6 @@
</span><span class="cx">     JSGlobalObjectDebuggerAgent(JSAgentContext&amp;, InspectorConsoleAgent*);
</span><span class="cx">     virtual ~JSGlobalObjectDebuggerAgent() { }
</span><span class="cx"> 
</span><del>-    virtual JSGlobalObjectScriptDebugServer&amp; scriptDebugServer() override { return m_scriptDebugServer; }
-
</del><span class="cx">     virtual InjectedScript injectedScriptForEval(ErrorString&amp;, const int* executionContextId) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void breakpointActionLog(JSC::ExecState*, const String&amp;) override;
</span><span class="lines">@@ -52,7 +50,6 @@
</span><span class="cx">     virtual void unmuteConsole() override { }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    JSGlobalObjectScriptDebugServer m_scriptDebugServer;
</del><span class="cx">     InspectorConsoleAgent* m_consoleAgent { nullptr };
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -46,11 +46,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-VM&amp; JSGlobalObjectRuntimeAgent::globalVM()
-{
-    return m_globalObject.vm();
-}
-
</del><span class="cx"> InjectedScript JSGlobalObjectRuntimeAgent::injectedScriptForEval(ErrorString&amp; errorString, const int* executionContextId)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(executionContextId, !executionContextId);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
</span><span class="cx"> 
</span><del>-    virtual JSC::VM&amp; globalVM() override;
</del><span class="cx">     virtual InjectedScript injectedScriptForEval(ErrorString&amp;, const int* executionContextId) override;
</span><span class="cx"> 
</span><span class="cx">     // NOTE: JavaScript inspector does not yet need to mute a console because no messages
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/ChangeLog        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -1,3 +1,72 @@
</span><ins>+2015-11-05  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Put ScriptDebugServer into InspectorEnvironment and cleanup duplicate references
+        https://bugs.webkit.org/show_bug.cgi?id=150869
+
+        Reviewed by Brian Burg.
+
+        Refactoring covered by existing tests.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Privately export PageScriptDebuggerAgent.h due to InspectorController.h needing it.
+
+        * inspector/InspectorController.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::scriptDebugServer):
+        Own the PageScriptDebugServer.
+
+        * inspector/WorkerInspectorController.h:
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::WorkerInspectorController::WorkerInspectorController):
+        (WebCore::WorkerInspectorController::scriptDebugServer):
+        Own the WorkerScriptDebugServer.
+
+        (WebCore::WorkerInspectorController::vm):
+        Use the VM accessed through the worker global object.
+
+        * inspector/InspectorWebAgentBase.h:
+        (WebCore::InspectorAgentBase::InspectorAgentBase):
+        Given Web agents a m_environment convenience to access the InspectorEnvironment.
+
+        * inspector/InspectorNetworkAgent.cpp:
+        (WebCore::InspectorNetworkAgent::timestamp):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::timestamp):
+        (WebCore::InspectorPageAgent::enable):
+        (WebCore::InspectorPageAgent::frameStartedLoading):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
+        (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
+        (WebCore::InspectorTimelineAgent::internalStart):
+        (WebCore::InspectorTimelineAgent::internalStop):
+        (WebCore::InspectorTimelineAgent::timestamp):
+        (WebCore::InspectorTimelineAgent::startFromConsole):
+        (WebCore::InspectorTimelineAgent::willCallFunction):
+        (WebCore::InspectorTimelineAgent::willEvaluateScript):
+        (WebCore::InspectorTimelineAgent::setPageScriptDebugServer): Deleted.
+        * inspector/InspectorTimelineAgent.h:
+        Use the InspectorEnvironment for VM / ScriptDebugServer.
+
+        * inspector/PageDebuggerAgent.cpp:
+        (WebCore::PageDebuggerAgent::PageDebuggerAgent): Deleted.
+        (WebCore::PageDebuggerAgent::scriptDebugServer): Deleted.
+        * inspector/PageDebuggerAgent.h:
+        * inspector/PageRuntimeAgent.cpp:
+        (WebCore::PageRuntimeAgent::globalVM): Deleted.
+        * inspector/PageRuntimeAgent.h:
+        * inspector/WorkerDebuggerAgent.h:
+        * inspector/WorkerRuntimeAgent.cpp:
+        (WebCore::WorkerRuntimeAgent::globalVM): Deleted.
+        * inspector/WorkerRuntimeAgent.h:
+        * inspector/WorkerDebuggerAgent.cpp:
+        (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent): Deleted.
+        (WebCore::WorkerDebuggerAgent::scriptDebugServer): Deleted.
+        Remove now unnecessary subclass code.
+
+        (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
+        One more special case for accessing Worker properties from the ScriptDebugServer.
+
</ins><span class="cx"> 2015-11-05  Xabier Rodriguez Calvar  &lt;calvaris@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Shield implementation from user mangling Promise.reject and resolve methods
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -4124,7 +4124,7 @@
</span><span class="cx">                 A5E616731894581F009ADF50 /* WebDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5E616711894581F009ADF50 /* WebDebuggerAgent.cpp */; };
</span><span class="cx">                 A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E616721894581F009ADF50 /* WebDebuggerAgent.h */; };
</span><span class="cx">                 A5F36D3A18F758720054C024 /* PageScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F36D3818F758720054C024 /* PageScriptDebugServer.cpp */; };
</span><del>-                A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F36D3918F758720054C024 /* PageScriptDebugServer.h */; };
</del><ins>+                A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F36D3918F758720054C024 /* PageScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */; };
</span><span class="cx">                 A6148A6212E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A6112E41D3A0044A784 /* DOMHTMLKeygenElementInternal.h */; };
</span><span class="cx">                 A6148A6712E41D940044A784 /* DOMHTMLKeygenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A6512E41D940044A784 /* DOMHTMLKeygenElement.h */; };
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">     , m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))
</span><span class="cx">     , m_overlay(std::make_unique&lt;InspectorOverlay&gt;(page, inspectorClient))
</span><span class="cx">     , m_executionStopwatch(Stopwatch::create())
</span><ins>+    , m_scriptDebugServer(page)
</ins><span class="cx">     , m_page(page)
</span><span class="cx">     , m_inspectorClient(inspectorClient)
</span><span class="cx"> {
</span><span class="lines">@@ -180,9 +181,6 @@
</span><span class="cx">             , databaseAgent
</span><span class="cx">         );
</span><span class="cx">     }
</span><del>-
-    runtimeAgent-&gt;setScriptDebugServer(&amp;debuggerAgent-&gt;scriptDebugServer());
-    m_timelineAgent-&gt;setPageScriptDebugServer(&amp;debuggerAgent-&gt;scriptDebugServer());
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorController::~InspectorController()
</span><span class="lines">@@ -471,6 +469,11 @@
</span><span class="cx">     return m_executionStopwatch.copyRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PageScriptDebugServer&amp; InspectorController::scriptDebugServer()
+{
+    return m_scriptDebugServer;
+}
+
</ins><span class="cx"> JSC::VM&amp; InspectorController::vm()
</span><span class="cx"> {
</span><span class="cx">     return JSDOMWindowBase::commonVM();
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/InspectorController.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #define InspectorController_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InspectorOverlay.h&quot;
</span><ins>+#include &quot;PageScriptDebugServer.h&quot;
</ins><span class="cx"> #include &lt;inspector/InspectorAgentRegistry.h&gt;
</span><span class="cx"> #include &lt;inspector/InspectorEnvironment.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -124,6 +125,7 @@
</span><span class="cx">     virtual void didCallInjectedScriptFunction(JSC::ExecState*) override;
</span><span class="cx">     virtual void frontendInitialized() override;
</span><span class="cx">     virtual Ref&lt;WTF::Stopwatch&gt; executionStopwatch() override;
</span><ins>+    virtual PageScriptDebugServer&amp; scriptDebugServer() override;
</ins><span class="cx">     virtual JSC::VM&amp; vm() override;
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void didComposite(Frame&amp;);
</span><span class="lines">@@ -137,6 +139,7 @@
</span><span class="cx">     Ref&lt;Inspector::BackendDispatcher&gt; m_backendDispatcher;
</span><span class="cx">     std::unique_ptr&lt;InspectorOverlay&gt; m_overlay;
</span><span class="cx">     Ref&lt;WTF::Stopwatch&gt; m_executionStopwatch;
</span><ins>+    PageScriptDebugServer m_scriptDebugServer;
</ins><span class="cx">     Inspector::AgentRegistry m_agents;
</span><span class="cx"> 
</span><span class="cx">     Page&amp; m_page;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorNetworkAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -266,7 +266,7 @@
</span><span class="cx"> 
</span><span class="cx"> double InspectorNetworkAgent::timestamp()
</span><span class="cx"> {
</span><del>-    return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()-&gt;elapsedTime();
</del><ins>+    return m_environment.executionStopwatch()-&gt;elapsedTime();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLoader&amp; loader, ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -351,7 +351,7 @@
</span><span class="cx"> 
</span><span class="cx"> double InspectorPageAgent::timestamp()
</span><span class="cx"> {
</span><del>-    return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()-&gt;elapsedTime();
</del><ins>+    return m_environment.executionStopwatch()-&gt;elapsedTime();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorPageAgent::enable(ErrorString&amp;)
</span><span class="lines">@@ -359,7 +359,7 @@
</span><span class="cx">     m_enabled = true;
</span><span class="cx">     m_instrumentingAgents.setInspectorPageAgent(this);
</span><span class="cx"> 
</span><del>-    auto stopwatch = m_instrumentingAgents.inspectorEnvironment().executionStopwatch();
</del><ins>+    auto stopwatch = m_environment.executionStopwatch();
</ins><span class="cx">     stopwatch-&gt;reset();
</span><span class="cx">     stopwatch-&gt;start();
</span><span class="cx"> 
</span><span class="lines">@@ -804,7 +804,7 @@
</span><span class="cx"> void InspectorPageAgent::frameStartedLoading(Frame&amp; frame)
</span><span class="cx"> {
</span><span class="cx">     if (frame.isMainFrame()) {
</span><del>-        auto stopwatch = m_instrumentingAgents.inspectorEnvironment().executionStopwatch();
</del><ins>+        auto stopwatch = m_environment.executionStopwatch();
</ins><span class="cx">         stopwatch-&gt;reset();
</span><span class="cx">         stopwatch-&gt;start();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -85,18 +85,17 @@
</span><span class="cx"> {
</span><span class="cx">     m_instrumentingAgents.setPersistentInspectorTimelineAgent(this);
</span><span class="cx"> 
</span><del>-    if (m_scriptDebugServer)
-        m_scriptDebugServer-&gt;recompileAllJSFunctions();
</del><ins>+    // Recompile to include profiling information.
+    // FIXME: This doesn't seem like the most appropriate place.
+    m_environment.scriptDebugServer().recompileAllJSFunctions();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorTimelineAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason reason)
</span><span class="cx"> {
</span><span class="cx">     m_instrumentingAgents.setPersistentInspectorTimelineAgent(nullptr);
</span><span class="cx"> 
</span><del>-    if (reason != Inspector::DisconnectReason::InspectedTargetDestroyed) {
-        if (m_scriptDebugServer)
-            m_scriptDebugServer-&gt;recompileAllJSFunctions();
-    }
</del><ins>+    if (reason != Inspector::DisconnectReason::InspectedTargetDestroyed)
+        m_environment.scriptDebugServer().recompileAllJSFunctions();
</ins><span class="cx"> 
</span><span class="cx">     ErrorString unused;
</span><span class="cx">     stop(unused);
</span><span class="lines">@@ -128,8 +127,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_instrumentingAgents.setInspectorTimelineAgent(this);
</span><span class="cx"> 
</span><del>-    if (m_scriptDebugServer)
-        m_scriptDebugServer-&gt;addListener(this);
</del><ins>+    m_environment.scriptDebugServer().addListener(this);
</ins><span class="cx"> 
</span><span class="cx">     m_enabled = true;
</span><span class="cx"> 
</span><span class="lines">@@ -137,7 +135,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     m_frameStartObserver = RunLoopObserver::create(0, [this]() {
</span><del>-        if (!m_enabled || m_scriptDebugServer-&gt;isPaused())
</del><ins>+        if (!m_enabled || m_environment.scriptDebugServer().isPaused())
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         if (!m_runLoopNestingLevel)
</span><span class="lines">@@ -146,7 +144,7 @@
</span><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     m_frameStopObserver = RunLoopObserver::create(frameStopRunLoopOrder, [this]() {
</span><del>-        if (!m_enabled || m_scriptDebugServer-&gt;isPaused())
</del><ins>+        if (!m_enabled || m_environment.scriptDebugServer().isPaused())
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         ASSERT(m_runLoopNestingLevel &gt; 0);
</span><span class="lines">@@ -180,8 +178,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_instrumentingAgents.setInspectorTimelineAgent(nullptr);
</span><span class="cx"> 
</span><del>-    if (m_scriptDebugServer)
-        m_scriptDebugServer-&gt;removeListener(this, true);
</del><ins>+    m_environment.scriptDebugServer().removeListener(this, true);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     m_frameStartObserver = nullptr;
</span><span class="lines">@@ -203,17 +200,9 @@
</span><span class="cx"> 
</span><span class="cx"> double InspectorTimelineAgent::timestamp()
</span><span class="cx"> {
</span><del>-    return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()-&gt;elapsedTime();
</del><ins>+    return m_environment.executionStopwatch()-&gt;elapsedTime();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorTimelineAgent::setPageScriptDebugServer(PageScriptDebugServer* scriptDebugServer)
-{
-    ASSERT(!m_enabled);
-    ASSERT(!m_scriptDebugServer);
-
-    m_scriptDebugServer = scriptDebugServer;
-}
-
</del><span class="cx"> static inline void startProfiling(JSC::ExecState* exec, const String&amp; title, RefPtr&lt;Stopwatch&gt;&amp;&amp; stopwatch)
</span><span class="cx"> {
</span><span class="cx">     JSC::LegacyProfiler::profiler()-&gt;startProfiling(exec, title, WTF::move(stopwatch));
</span><span class="lines">@@ -250,7 +239,7 @@
</span><span class="cx">     if (!m_enabled &amp;&amp; m_pendingConsoleProfileRecords.isEmpty())
</span><span class="cx">         internalStart();
</span><span class="cx"> 
</span><del>-    startProfiling(exec, title, m_instrumentingAgents.inspectorEnvironment().executionStopwatch());
</del><ins>+    startProfiling(exec, title, m_environment.executionStopwatch());
</ins><span class="cx"> 
</span><span class="cx">     m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
</span><span class="cx"> }
</span><span class="lines">@@ -289,7 +278,7 @@
</span><span class="cx">     pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame);
</span><span class="cx"> 
</span><span class="cx">     if (frame &amp;&amp; !m_callStackDepth)
</span><del>-        startProfiling(frame, ASCIILiteral(&quot;Timeline FunctionCall&quot;), m_instrumentingAgents.inspectorEnvironment().executionStopwatch());
</del><ins>+        startProfiling(frame, ASCIILiteral(&quot;Timeline FunctionCall&quot;), m_environment.executionStopwatch());
</ins><span class="cx"> 
</span><span class="cx">     ++m_callStackDepth;
</span><span class="cx"> }
</span><span class="lines">@@ -421,7 +410,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_callStackDepth) {
</span><span class="cx">         ++m_callStackDepth;
</span><del>-        startProfiling(&amp;frame, ASCIILiteral(&quot;Timeline EvaluateScript&quot;), m_instrumentingAgents.inspectorEnvironment().executionStopwatch());
</del><ins>+        startProfiling(&amp;frame, ASCIILiteral(&quot;Timeline EvaluateScript&quot;), m_environment.executionStopwatch());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx"> class FloatQuad;
</span><span class="cx"> class Frame;
</span><span class="cx"> class InspectorPageAgent;
</span><del>-class PageScriptDebugServer;
</del><span class="cx"> class RenderObject;
</span><span class="cx"> class RunLoopObserver;
</span><span class="cx"> 
</span><span class="lines">@@ -106,8 +105,6 @@
</span><span class="cx"> 
</span><span class="cx">     int id() const { return m_id; }
</span><span class="cx"> 
</span><del>-    void setPageScriptDebugServer(PageScriptDebugServer*);
-
</del><span class="cx">     void didCommitLoad();
</span><span class="cx"> 
</span><span class="cx">     // Methods called from WebCore.
</span><span class="lines">@@ -199,8 +196,6 @@
</span><span class="cx">     RefPtr&lt;Inspector::TimelineBackendDispatcher&gt; m_backendDispatcher;
</span><span class="cx">     InspectorPageAgent* m_pageAgent;
</span><span class="cx"> 
</span><del>-    PageScriptDebugServer* m_scriptDebugServer { nullptr };
-
</del><span class="cx">     Vector&lt;TimelineRecordEntry&gt; m_recordStack;
</span><span class="cx">     int m_id { 1 };
</span><span class="cx">     int m_callStackDepth { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorWebAgentBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorWebAgentBase.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorWebAgentBase.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/InspectorWebAgentBase.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -72,10 +72,12 @@
</span><span class="cx">     InspectorAgentBase(const String&amp; name, WebAgentContext&amp; context)
</span><span class="cx">         : Inspector::InspectorAgentBase(name)
</span><span class="cx">         , m_instrumentingAgents(context.instrumentingAgents)
</span><ins>+        , m_environment(context.environment)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     InstrumentingAgents&amp; m_instrumentingAgents;
</span><ins>+    Inspector::InspectorEnvironment&amp; m_environment;
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx">     , m_page(context.inspectedPage)
</span><span class="cx">     , m_pageAgent(pageAgent)
</span><span class="cx">     , m_overlay(overlay)
</span><del>-    , m_scriptDebugServer(m_page)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -93,11 +92,6 @@
</span><span class="cx">     return InspectorDebuggerAgent::sourceMapURLForScript(script);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PageScriptDebugServer&amp; PageDebuggerAgent::scriptDebugServer()
-{
-    return m_scriptDebugServer;
-}
-
</del><span class="cx"> void PageDebuggerAgent::muteConsole()
</span><span class="cx"> {
</span><span class="cx">     PageConsoleClient::mute();
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageDebuggerAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #ifndef PageDebuggerAgent_h
</span><span class="cx"> #define PageDebuggerAgent_h
</span><span class="cx"> 
</span><del>-#include &quot;PageScriptDebugServer.h&quot;
</del><span class="cx"> #include &quot;WebDebuggerAgent.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -40,7 +39,6 @@
</span><span class="cx"> class InspectorOverlay;
</span><span class="cx"> class InspectorPageAgent;
</span><span class="cx"> class Page;
</span><del>-class PageScriptDebugServer;
</del><span class="cx"> 
</span><span class="cx"> class PageDebuggerAgent final : public WebDebuggerAgent {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(PageDebuggerAgent);
</span><span class="lines">@@ -55,8 +53,6 @@
</span><span class="cx">     void mainFrameStoppedLoading();
</span><span class="cx">     void mainFrameNavigated();
</span><span class="cx"> 
</span><del>-    virtual PageScriptDebugServer&amp; scriptDebugServer() override;
-
</del><span class="cx"> protected:
</span><span class="cx">     virtual void enable() override;
</span><span class="cx">     virtual void disable(bool isBeingDestroyed) override;
</span><span class="lines">@@ -76,7 +72,6 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorPageAgent* m_pageAgent;
</span><span class="cx">     InspectorOverlay* m_overlay { nullptr };
</span><del>-    PageScriptDebugServer m_scriptDebugServer;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -108,11 +108,6 @@
</span><span class="cx">     notifyContextCreated(frameId, scriptState, nullptr, true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::VM&amp; PageRuntimeAgent::globalVM()
-{
-    return JSDOMWindowBase::commonVM();
-}
-
</del><span class="cx"> InjectedScript PageRuntimeAgent::injectedScriptForEval(ErrorString&amp; errorString, const int* executionContextId)
</span><span class="cx"> {
</span><span class="cx">     if (!executionContextId) {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageRuntimeAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageRuntimeAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/PageRuntimeAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -67,7 +67,6 @@
</span><span class="cx">     void didCreateMainWorldContext(Frame&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    virtual JSC::VM&amp; globalVM() override;
</del><span class="cx">     virtual Inspector::InjectedScript injectedScriptForEval(ErrorString&amp;, const int* executionContextId) override;
</span><span class="cx">     virtual void muteConsole() override;
</span><span class="cx">     virtual void unmuteConsole() override;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;WorkerDebuggerAgent.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WorkerGlobalScope.h&quot;
</span><ins>+#include &quot;WorkerScriptDebugServer.h&quot;
</ins><span class="cx"> #include &quot;WorkerThread.h&quot;
</span><span class="cx"> #include &lt;inspector/InjectedScript.h&gt;
</span><span class="cx"> #include &lt;inspector/InjectedScriptManager.h&gt;
</span><span class="lines">@@ -83,7 +84,6 @@
</span><span class="cx"> 
</span><span class="cx"> WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerAgentContext&amp; context)
</span><span class="cx">     : WebDebuggerAgent(context)
</span><del>-    , m_scriptDebugServer(context.workerGlobalScope, WorkerDebuggerAgent::debuggerTaskMode)
</del><span class="cx">     , m_inspectedWorkerGlobalScope(context.workerGlobalScope)
</span><span class="cx"> {
</span><span class="cx">     std::lock_guard&lt;StaticLock&gt; lock(workerDebuggerAgentsMutex);
</span><span class="lines">@@ -102,8 +102,10 @@
</span><span class="cx"> {
</span><span class="cx">     std::lock_guard&lt;StaticLock&gt; lock(workerDebuggerAgentsMutex);
</span><span class="cx"> 
</span><del>-    if (WorkerDebuggerAgent* agent = workerDebuggerAgents().get(thread))
-        agent-&gt;m_scriptDebugServer.interruptAndRunTask(std::make_unique&lt;RunInspectorCommandsTask&gt;(thread, &amp;agent-&gt;m_inspectedWorkerGlobalScope));
</del><ins>+    if (WorkerDebuggerAgent* agent = workerDebuggerAgents().get(thread)) {
+        WorkerScriptDebugServer&amp; workerScriptDebugServer = static_cast&lt;WorkerScriptDebugServer&amp;&gt;(agent-&gt;scriptDebugServer());
+        workerScriptDebugServer.interruptAndRunTask(std::make_unique&lt;RunInspectorCommandsTask&gt;(thread, &amp;agent-&gt;m_inspectedWorkerGlobalScope));
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WorkerDebuggerAgent::breakpointActionLog(JSC::ExecState*, const String&amp; message)
</span><span class="lines">@@ -111,11 +113,6 @@
</span><span class="cx">     m_inspectedWorkerGlobalScope.addConsoleMessage(MessageSource::JS, MessageLevel::Log, message);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WorkerScriptDebugServer&amp; WorkerDebuggerAgent::scriptDebugServer()
-{
-    return m_scriptDebugServer;
-}
-
</del><span class="cx"> InjectedScript WorkerDebuggerAgent::injectedScriptForEval(ErrorString&amp; error, const int* executionContextId)
</span><span class="cx"> {
</span><span class="cx">     if (executionContextId) {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #define WorkerDebuggerAgent_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebDebuggerAgent.h&quot;
</span><del>-#include &quot;WorkerScriptDebugServer.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -50,7 +49,6 @@
</span><span class="cx">     static const char* debuggerTaskMode;
</span><span class="cx">     static void interruptAndDispatchInspectorCommands(WorkerThread*);
</span><span class="cx"> 
</span><del>-    virtual WorkerScriptDebugServer&amp; scriptDebugServer() override;
</del><span class="cx">     virtual Inspector::InjectedScript injectedScriptForEval(ErrorString&amp;, const int* executionContextId) override;
</span><span class="cx">     virtual void muteConsole() override;
</span><span class="cx">     virtual void unmuteConsole() override;
</span><span class="lines">@@ -58,7 +56,6 @@
</span><span class="cx">     virtual void breakpointActionLog(JSC::ExecState*, const String&amp;) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    WorkerScriptDebugServer m_scriptDebugServer;
</del><span class="cx">     WorkerGlobalScope&amp; m_inspectedWorkerGlobalScope;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">     , m_instrumentingAgents(InstrumentingAgents::create(*this))
</span><span class="cx">     , m_injectedScriptManager(std::make_unique&lt;WebInjectedScriptManager&gt;(*this, WebInjectedScriptHost::create()))
</span><span class="cx">     , m_executionStopwatch(Stopwatch::create())
</span><ins>+    , m_scriptDebugServer(workerGlobalScope, WorkerDebuggerAgent::debuggerTaskMode)
</ins><span class="cx">     , m_frontendRouter(FrontendRouter::create())
</span><span class="cx">     , m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))
</span><span class="cx"> {
</span><span class="lines">@@ -112,7 +113,6 @@
</span><span class="cx">     m_instrumentingAgents-&gt;setWebConsoleAgent(consoleAgent.get());
</span><span class="cx"> 
</span><span class="cx">     auto debuggerAgent = std::make_unique&lt;WorkerDebuggerAgent&gt;(workerContext);
</span><del>-    m_runtimeAgent-&gt;setScriptDebugServer(&amp;debuggerAgent-&gt;scriptDebugServer());
</del><span class="cx">     m_agents.append(WTF::move(debuggerAgent));
</span><span class="cx"> 
</span><span class="cx">     m_agents.append(std::make_unique&lt;InspectorTimelineAgent&gt;(workerContext, nullptr, InspectorTimelineAgent::WorkerInspector));
</span><span class="lines">@@ -197,9 +197,14 @@
</span><span class="cx">     return m_executionStopwatch.copyRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WorkerScriptDebugServer&amp; WorkerInspectorController::scriptDebugServer()
+{
+    return m_scriptDebugServer;
+}
+
</ins><span class="cx"> VM&amp; WorkerInspectorController::vm()
</span><span class="cx"> {
</span><del>-    return JSDOMWindowBase::commonVM();
</del><ins>+    return m_workerGlobalScope.vm();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerInspectorController.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -34,12 +34,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InspectorInstrumentationCookie.h&quot;
</span><span class="cx"> #include &quot;InspectorWebAgentBase.h&quot;
</span><ins>+#include &quot;WorkerScriptDebugServer.h&quot;
</ins><span class="cx"> #include &lt;inspector/InspectorAgentRegistry.h&gt;
</span><span class="cx"> #include &lt;inspector/InspectorEnvironment.h&gt;
</span><del>-#include &lt;wtf/FastMalloc.h&gt;
</del><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><del>-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="lines">@@ -75,6 +74,7 @@
</span><span class="cx">     virtual void didCallInjectedScriptFunction(JSC::ExecState*) override;
</span><span class="cx">     virtual void frontendInitialized() override { }
</span><span class="cx">     virtual Ref&lt;WTF::Stopwatch&gt; executionStopwatch() override;
</span><ins>+    virtual WorkerScriptDebugServer&amp; scriptDebugServer() override;
</ins><span class="cx">     virtual JSC::VM&amp; vm() override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -87,6 +87,7 @@
</span><span class="cx">     Inspector::AgentRegistry m_agents;
</span><span class="cx">     std::unique_ptr&lt;Inspector::FrontendChannel&gt; m_forwardingChannel;
</span><span class="cx">     Ref&lt;WTF::Stopwatch&gt; m_executionStopwatch;
</span><ins>+    WorkerScriptDebugServer m_scriptDebugServer;
</ins><span class="cx">     Ref&lt;Inspector::FrontendRouter&gt; m_frontendRouter;
</span><span class="cx">     Ref&lt;Inspector::BackendDispatcher&gt; m_backendDispatcher;
</span><span class="cx">     Vector&lt;InspectorInstrumentationCookie, 2&gt; m_injectedScriptInstrumentationCookies;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -89,11 +89,6 @@
</span><span class="cx">     m_paused = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::VM&amp; WorkerRuntimeAgent::globalVM()
-{
-    return JSDOMWindowBase::commonVM();
-}
-
</del><span class="cx"> void WorkerRuntimeAgent::pauseWorkerGlobalScope(WorkerGlobalScope* context)
</span><span class="cx"> {
</span><span class="cx">     m_paused = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h (192060 => 192061)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h        2015-11-05 18:30:51 UTC (rev 192060)
+++ trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h        2015-11-05 19:22:42 UTC (rev 192061)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx">     void pauseWorkerGlobalScope(WorkerGlobalScope*);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    virtual JSC::VM&amp; globalVM() override;
</del><span class="cx">     virtual Inspector::InjectedScript injectedScriptForEval(ErrorString&amp;, const int* executionContextId) override;
</span><span class="cx">     virtual void muteConsole() override;
</span><span class="cx">     virtual void unmuteConsole() override;
</span></span></pre>
</div>
</div>

</body>
</html>