<!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>[162767] 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/162767">162767</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-25 09:48:16 -0800 (Sat, 25 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Move InspectorRuntimeAgent into JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=127605
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files to the build.
* inspector/agents/InspectorRuntimeAgent.h: Renamed from Source/WebCore/inspector/InspectorRuntimeAgent.h.
* inspector/agents/InspectorRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/InspectorRuntimeAgent.cpp.
(Inspector::InspectorRuntimeAgent::InspectorRuntimeAgent):
(Inspector::InspectorRuntimeAgent::parse):
(Inspector::InspectorRuntimeAgent::evaluate):
(Inspector::InspectorRuntimeAgent::callFunctionOn):
(Inspector::InspectorRuntimeAgent::getProperties):
- Move the agent into JavaScriptCore.
- Modernize and cleanup.
- Make globalVM a pure virtual function for subclasses to implement.
* inspector/agents/JSGlobalObjectRuntimeAgent.h: Added.
* inspector/agents/JSGlobalObjectRuntimeAgent.cpp: Added.
(Inspector::JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent):
(Inspector::JSGlobalObjectRuntimeAgent::didCreateFrontendAndBackend):
(Inspector::JSGlobalObjectRuntimeAgent::willDestroyFrontendAndBackend):
(Inspector::JSGlobalObjectRuntimeAgent::globalVM):
(Inspector::JSGlobalObjectRuntimeAgent::injectedScriptForEval):
Straightforward JSGlobalObject implementation.
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
Add a runtime agent when inspecting a JSContext!
Source/WebCore:
Covered by existing tests. No change in functionality.
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
Remove WebCore InspectorRuntimeAgent.
* ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h: Added.
Add JavaScriptCore InspectorRuntimeAgent.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/WorkerInspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
New constructors for the runtime agent.
* inspector/PageRuntimeAgent.h:
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::PageRuntimeAgent):
(WebCore::PageRuntimeAgent::enable):
(WebCore::PageRuntimeAgent::disable):
(WebCore::PageRuntimeAgent::didCreateMainWorldContext):
(WebCore::PageRuntimeAgent::didCreateIsolatedContext):
(WebCore::PageRuntimeAgent::globalVM):
Modernize and implement globalVM.
* inspector/WorkerRuntimeAgent.h:
* inspector/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
(WebCore::WorkerRuntimeAgent::injectedScriptForEval):
(WebCore::WorkerRuntimeAgent::globalVM):
Modernize and implement globalVM.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreGNUmakefilelistam">trunk/Source/JavaScriptCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorAllInOnecpp">trunk/Source/WebCore/inspector/InspectorAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllercpp">trunk/Source/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageRuntimeAgentcpp">trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageRuntimeAgenth">trunk/Source/WebCore/inspector/PageRuntimeAgent.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>
<h3>Added Paths</h3>
<ul>
<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="#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="#trunkSourceWebCoreForwardingHeadersinspectoragentsInspectorRuntimeAgenth">trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreinspectorInspectorRuntimeAgentcpp">trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorRuntimeAgenth">trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -242,6 +242,8 @@
</span><span class="cx"> inspector/JavaScriptCallFrame.cpp
</span><span class="cx"> inspector/ScriptDebugServer.cpp
</span><span class="cx"> inspector/agents/InspectorAgent.cpp
</span><ins>+ inspector/agents/InspectorRuntimeAgent.cpp
+ inspector/agents/JSGlobalObjectRuntimeAgent.cpp
</ins><span class="cx">
</span><span class="cx"> interpreter/AbstractPC.cpp
</span><span class="cx"> interpreter/CallFrame.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-01-24 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Move InspectorRuntimeAgent into JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=127605
+
+ Reviewed by Timothy Hatcher.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ Add new files to the build.
+
+ * inspector/agents/InspectorRuntimeAgent.h: Renamed from Source/WebCore/inspector/InspectorRuntimeAgent.h.
+ * inspector/agents/InspectorRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/InspectorRuntimeAgent.cpp.
+ (Inspector::InspectorRuntimeAgent::InspectorRuntimeAgent):
+ (Inspector::InspectorRuntimeAgent::parse):
+ (Inspector::InspectorRuntimeAgent::evaluate):
+ (Inspector::InspectorRuntimeAgent::callFunctionOn):
+ (Inspector::InspectorRuntimeAgent::getProperties):
+ - Move the agent into JavaScriptCore.
+ - Modernize and cleanup.
+ - Make globalVM a pure virtual function for subclasses to implement.
+
+ * inspector/agents/JSGlobalObjectRuntimeAgent.h: Added.
+ * inspector/agents/JSGlobalObjectRuntimeAgent.cpp: Added.
+ (Inspector::JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent):
+ (Inspector::JSGlobalObjectRuntimeAgent::didCreateFrontendAndBackend):
+ (Inspector::JSGlobalObjectRuntimeAgent::willDestroyFrontendAndBackend):
+ (Inspector::JSGlobalObjectRuntimeAgent::globalVM):
+ (Inspector::JSGlobalObjectRuntimeAgent::injectedScriptForEval):
+ Straightforward JSGlobalObject implementation.
+
+ * inspector/JSGlobalObjectInspectorController.cpp:
+ (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
+ Add a runtime agent when inspecting a JSContext!
+
</ins><span class="cx"> 2014-01-23 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Move JavaScriptCallFrame and ScriptDebugServer into JavaScriptCore for inspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/GNUmakefile.list.am (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -665,6 +665,10 @@
</span><span class="cx">         Source/JavaScriptCore/inspector/ScriptDebugServer.h \
</span><span class="cx">         Source/JavaScriptCore/inspector/agents/InspectorAgent.h \
</span><span class="cx">         Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp \
</span><ins>+        Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h \
+        Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp \
+        Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h \
+        Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp \
</ins><span class="cx">         Source/JavaScriptCore/interpreter/AbstractPC.cpp \
</span><span class="cx">         Source/JavaScriptCore/interpreter/AbstractPC.h \
</span><span class="cx">         Source/JavaScriptCore/interpreter/CachedCall.h \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -491,6 +491,8 @@
</span><span class="cx"> <ClCompile Include="..\inspector\JavaScriptCallFrame.cpp" />
</span><span class="cx"> <ClCompile Include="..\inspector\ScriptDebugServer.cpp" />
</span><span class="cx"> <ClCompile Include="..\inspector\agents\InspectorAgent.cpp" />
</span><ins>+ <ClCompile Include="..\inspector\agents\InspectorRuntimeAgent.cpp" />
+ <ClCompile Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.cpp" />
</ins><span class="cx"> <ClCompile Include="..\interpreter\AbstractPC.cpp" />
</span><span class="cx"> <ClCompile Include="..\interpreter\CallFrame.cpp" />
</span><span class="cx"> <ClCompile Include="..\interpreter\Interpreter.cpp" />
</span><span class="lines">@@ -1068,6 +1070,8 @@
</span><span class="cx"> <ClInclude Include="..\inspector\ScriptDebugListener.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\ScriptDebugServer.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\agents\InspectorAgent.h" />
</span><ins>+ <ClInclude Include="..\inspector\agents\InspectorRuntimeAgent.h" />
+ <ClInclude Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.h" />
</ins><span class="cx"> <ClInclude Include="..\interpreter\AbstractPC.h" />
</span><span class="cx"> <ClInclude Include="..\interpreter\CachedCall.h" />
</span><span class="cx"> <ClInclude Include="..\interpreter\CallFrame.h" />
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -300,6 +300,12 @@
</span><span class="cx"> <ClCompile Include="..\inspector\agents\InspectorAgent.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\inspector\agents\InspectorRuntimeAgent.cpp">
+ <Filter>inspector</Filter>
+ </ClCompile>
+ <ClCompile Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.cpp">
+ <Filter>inspector</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\interpreter\AbstractPC.cpp">
</span><span class="cx"> <Filter>interpreter</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -1796,6 +1802,12 @@
</span><span class="cx"> <ClInclude Include="..\inspector\agents\InspectorAgent.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\inspector\agents\InspectorRuntimeAgent.h">
+ <Filter>inspector</Filter>
+ </ClInclude>
+ <ClInclude Include="..\inspector\agents\JSGlobalObjectRuntimeAgent.h">
+ <Filter>inspector</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\interpreter\AbstractPC.h">
</span><span class="cx"> <Filter>interpreter</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -910,6 +910,10 @@
</span><span class="cx">                 A503FA22188EFF6800110F14 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA20188EFF6800110F14 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A503FA25188EFFFD00110F14 /* ScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA23188EFFFD00110F14 /* ScriptDebugServer.cpp */; };
</span><span class="cx">                 A503FA26188EFFFD00110F14 /* ScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA24188EFFFD00110F14 /* ScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A50E4B6118809DD50068A46D /* InspectorRuntimeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A50E4B5D18809DD50068A46D /* InspectorRuntimeAgent.cpp */; };
+                A50E4B6218809DD50068A46D /* InspectorRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A50E4B5E18809DD50068A46D /* InspectorRuntimeAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                A50E4B6318809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A50E4B5F18809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp */; };
+                A50E4B6418809DD50068A46D /* JSGlobalObjectRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A50E4B6018809DD50068A46D /* JSGlobalObjectRuntimeAgent.h */; };
</ins><span class="cx">                 A51007C0187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */; };
</span><span class="cx">                 A51007C1187CC3C600B38879 /* JSGlobalObjectInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */; };
</span><span class="cx">                 A513E5B7185B8BD3007E95AD /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */; };
</span><span class="lines">@@ -2308,6 +2312,10 @@
</span><span class="cx">                 A503FA20188EFF6800110F14 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
</span><span class="cx">                 A503FA23188EFFFD00110F14 /* ScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptDebugServer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A503FA24188EFFFD00110F14 /* ScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugServer.h; sourceTree = "<group>"; };
</span><ins>+                A50E4B5D18809DD50068A46D /* InspectorRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorRuntimeAgent.cpp; sourceTree = "<group>"; };
+                A50E4B5E18809DD50068A46D /* InspectorRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorRuntimeAgent.h; sourceTree = "<group>"; };
+                A50E4B5F18809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectRuntimeAgent.cpp; sourceTree = "<group>"; };
+                A50E4B6018809DD50068A46D /* JSGlobalObjectRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectRuntimeAgent.h; sourceTree = "<group>"; };
</ins><span class="cx">                 A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectInspectorController.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectInspectorController.h; sourceTree = "<group>"; };
</span><span class="cx">                 A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScript.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -4358,6 +4366,10 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */,
</span><span class="cx">                                 A5CEEE13187F3BAD00E55C99 /* InspectorAgent.h */,
</span><ins>+                                A50E4B5D18809DD50068A46D /* InspectorRuntimeAgent.cpp */,
+                                A50E4B5E18809DD50068A46D /* InspectorRuntimeAgent.h */,
+                                A50E4B5F18809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp */,
+                                A50E4B6018809DD50068A46D /* JSGlobalObjectRuntimeAgent.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = agents;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -4506,6 +4518,7 @@
</span><span class="cx">                                 A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */,
</span><span class="cx">                                 A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */,
</span><span class="cx">                                 0F24E54F17EE274900ABB217 /* TempRegisterSet.h in Headers */,
</span><ins>+                                A50E4B6418809DD50068A46D /* JSGlobalObjectRuntimeAgent.h in Headers */,
</ins><span class="cx">                                 A7BFF3C0179868940002F462 /* DFGFiltrationResult.h in Headers */,
</span><span class="cx">                                 A5840E27187C981E00843B10 /* cssmin.py in Headers */,
</span><span class="cx">                                 C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */,
</span><span class="lines">@@ -5176,6 +5189,7 @@
</span><span class="cx">                                 0F2B670817B6B5AB00A7AE3F /* TypedArrayController.h in Headers */,
</span><span class="cx">                                 0F4B94DC17B9F07500DD03A4 /* TypedArrayInlines.h in Headers */,
</span><span class="cx">                                 0F2B670917B6B5AB00A7AE3F /* TypedArrays.h in Headers */,
</span><ins>+                                A50E4B6218809DD50068A46D /* InspectorRuntimeAgent.h in Headers */,
</ins><span class="cx">                                 0F2B670B17B6B5AB00A7AE3F /* TypedArrayType.h in Headers */,
</span><span class="cx">                                 0FF4274B158EBE91004CB9FF /* udis86.h in Headers */,
</span><span class="cx">                                 0FF42741158EBE8D004CB9FF /* udis86_decode.h in Headers */,
</span><span class="lines">@@ -5799,6 +5813,7 @@
</span><span class="cx">                                 0F2BDC4A1522809A00CD8910 /* DFGVariableEventStream.cpp in Sources */,
</span><span class="cx">                                 0FFFC95F14EF90BB00C72532 /* DFGVirtualRegisterAllocationPhase.cpp in Sources */,
</span><span class="cx">                                 0FC97F4118202119002C9B26 /* DFGWatchpointCollectionPhase.cpp in Sources */,
</span><ins>+                                A50E4B6318809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp in Sources */,
</ins><span class="cx">                                 0FDB2CE7174830A2007B3C1B /* DFGWorklist.cpp in Sources */,
</span><span class="cx">                                 0F9D3370165DBB90005AD387 /* Disassembler.cpp in Sources */,
</span><span class="cx">                                 A70447ED17A0BD7000F5898E /* DumpContext.cpp in Sources */,
</span><span class="lines">@@ -6000,6 +6015,7 @@
</span><span class="cx">                                 14469DDF107EC7E700650446 /* MathObject.cpp in Sources */,
</span><span class="cx">                                 90213E3D123A40C200D422F3 /* MemoryStatistics.cpp in Sources */,
</span><span class="cx">                                 0FB5467D14F5CFD6002C2989 /* MethodOfGettingAValueProfile.cpp in Sources */,
</span><ins>+                                A50E4B6118809DD50068A46D /* InspectorRuntimeAgent.cpp in Sources */,
</ins><span class="cx">                                 86EBF2FF1560F06A008E9222 /* NameConstructor.cpp in Sources */,
</span><span class="cx">                                 86EBF3011560F06A008E9222 /* NameInstance.cpp in Sources */,
</span><span class="cx">                                 86EBF3031560F06A008E9222 /* NamePrototype.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "InspectorBackendDispatcher.h"
</span><span class="cx"> #include "InspectorFrontendChannel.h"
</span><span class="cx"> #include "JSGlobalObject.h"
</span><ins>+#include "JSGlobalObjectRuntimeAgent.h"
</ins><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="lines">@@ -46,10 +47,7 @@
</span><span class="cx"> , m_inspectorFrontendChannel(nullptr)
</span><span class="cx"> {
</span><span class="cx"> m_agents.append(std::make_unique<InspectorAgent>());
</span><del>-
- // FIXME: Create RuntimeAgent.
- // FIXME: Create DebuggerAgent.
- (void)m_globalObject; // Will be used by RuntimeAgent.
</del><ins>+ m_agents.append(std::make_unique<JSGlobalObjectRuntimeAgent>(m_injectedScriptManager.get(), m_globalObject));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSGlobalObjectInspectorController::~JSGlobalObjectInspectorController()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcppfromrev162766trunkSourceWebCoreinspectorInspectorRuntimeAgentcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (from rev 162766, trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp) (0 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -0,0 +1,215 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InspectorRuntimeAgent.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "Completion.h"
+#include "InjectedScript.h"
+#include "InjectedScriptManager.h"
+#include "InspectorValues.h"
+#include "JSLock.h"
+#include "ParserError.h"
+#include "SourceCode.h"
+#include <wtf/PassRefPtr.h>
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "ScriptDebugServer.h"
+#endif
+
+using namespace JSC;
+
+namespace Inspector {
+
+static bool asBool(const bool* const b)
+{
+ return b ? *b : false;
+}
+
+InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager* injectedScriptManager)
+ : InspectorAgentBase(ASCIILiteral("Runtime"))
+ , m_injectedScriptManager(injectedScriptManager)
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ , m_scriptDebugServer(nullptr)
+#endif
+ , m_enabled(false)
+{
+}
+
+InspectorRuntimeAgent::~InspectorRuntimeAgent()
+{
+}
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(ScriptDebugServer* scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newState)
+{
+ ASSERT(scriptDebugServer);
+ ScriptDebugServer::PauseOnExceptionsState presentState = scriptDebugServer->pauseOnExceptionsState();
+ if (presentState != newState)
+ scriptDebugServer->setPauseOnExceptionsState(newState);
+ return presentState;
+}
+#endif
+
+static PassRefPtr<Inspector::TypeBuilder::Runtime::ErrorRange> buildErrorRangeObject(const JSTokenLocation& tokenLocation)
+{
+ RefPtr<Inspector::TypeBuilder::Runtime::ErrorRange> result = Inspector::TypeBuilder::Runtime::ErrorRange::create()
+ .setStartOffset(tokenLocation.startOffset)
+ .setEndOffset(tokenLocation.endOffset);
+ return result.release();
+}
+
+void InspectorRuntimeAgent::parse(ErrorString*, const String& expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType::Enum* result, Inspector::TypeBuilder::OptOutput<String>* message, RefPtr<Inspector::TypeBuilder::Runtime::ErrorRange>& range)
+{
+ VM* vm = globalVM();
+ JSLockHolder lock(vm);
+
+ ParserError error;
+ checkSyntax(*vm, JSC::makeSource(expression), error);
+
+ switch (error.m_syntaxErrorType) {
+ case ParserError::SyntaxErrorNone:
+ *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::None;
+ break;
+ case ParserError::SyntaxErrorIrrecoverable:
+ *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::Irrecoverable;
+ break;
+ case ParserError::SyntaxErrorUnterminatedLiteral:
+ *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::UnterminatedLiteral;
+ break;
+ case ParserError::SyntaxErrorRecoverable:
+ *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::Recoverable;
+ break;
+ }
+
+ if (error.m_syntaxErrorType != ParserError::SyntaxErrorNone) {
+ *message = error.m_message;
+ range = buildErrorRangeObject(error.m_token.m_location);
+ }
+}
+
+void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
+{
+ InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId);
+ if (injectedScript.hasNoValue())
+ return;
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions;
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole))
+ previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
+#endif
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole))
+ muteConsole();
+
+ injectedScript.evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
+
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole)) {
+ unmuteConsole();
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
+#endif
+ }
+}
+
+void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<InspectorArray>* const optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
+{
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
+ if (injectedScript.hasNoValue()) {
+ *errorString = ASCIILiteral("Inspected frame has gone");
+ return;
+ }
+
+ String arguments;
+ if (optionalArguments)
+ arguments = (*optionalArguments)->toJSONString();
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions;
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole))
+ previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
+#endif
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole))
+ muteConsole();
+
+ injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
+
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole)) {
+ unmuteConsole();
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
+#endif
+ }
+}
+
+void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties)
+{
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
+ if (injectedScript.hasNoValue()) {
+ *errorString = ASCIILiteral("Inspected frame has gone");
+ return;
+ }
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
+#endif
+ muteConsole();
+
+ injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, &result);
+ injectedScript.getInternalProperties(errorString, objectId, &internalProperties);
+
+ unmuteConsole();
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
+#endif
+}
+
+void InspectorRuntimeAgent::releaseObject(ErrorString*, const String& objectId)
+{
+ InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
+ if (!injectedScript.hasNoValue())
+ injectedScript.releaseObject(objectId);
+}
+
+void InspectorRuntimeAgent::releaseObjectGroup(ErrorString*, const String& objectGroup)
+{
+ m_injectedScriptManager->releaseObjectGroup(objectGroup);
+}
+
+void InspectorRuntimeAgent::run(ErrorString*)
+{
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenthfromrev162766trunkSourceWebCoreinspectorInspectorRuntimeAgenth"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h (from rev 162766, trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h) (0 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorRuntimeAgent_h
+#define InspectorRuntimeAgent_h
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorJSBackendDispatchers.h"
+#include "InspectorJSFrontendDispatchers.h"
+#include "inspector/InspectorAgentBase.h"
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+
+namespace JSC {
+class VM;
+}
+
+namespace Inspector {
+
+class InjectedScript;
+class InjectedScriptManager;
+class InspectorArray;
+class ScriptDebugServer;
+typedef String ErrorString;
+
+class JS_EXPORT_PRIVATE InspectorRuntimeAgent : public InspectorAgentBase, public InspectorRuntimeBackendDispatcherHandler {
+ WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent);
+public:
+ virtual ~InspectorRuntimeAgent();
+
+ virtual void enable(ErrorString*) override { m_enabled = true; }
+ virtual void disable(ErrorString*) override { m_enabled = false; }
+ virtual void parse(ErrorString*, const String& expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType::Enum* result, Inspector::TypeBuilder::OptOutput<String>* message, RefPtr<Inspector::TypeBuilder::Runtime::ErrorRange>&) override final;
+ virtual void evaluate(ErrorString*, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override final;
+ virtual void callFunctionOn(ErrorString*, const String& objectId, const String& expression, const RefPtr<Inspector::InspectorArray>* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override final;
+ virtual void releaseObject(ErrorString*, const ErrorString& objectId) override final;
+ virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties) override final;
+ virtual void releaseObjectGroup(ErrorString*, const String& objectGroup) override final;
+ virtual void run(ErrorString*) override;
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ void setScriptDebugServer(ScriptDebugServer* scriptDebugServer) { m_scriptDebugServer = scriptDebugServer; }
+#endif
+
+ bool enabled() const { return m_enabled; }
+
+protected:
+ InspectorRuntimeAgent(InjectedScriptManager*);
+
+ InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
+
+ virtual JSC::VM* globalVM() = 0;
+ virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
+
+ virtual void muteConsole() = 0;
+ virtual void unmuteConsole() = 0;
+
+private:
+ InjectedScriptManager* m_injectedScriptManager;
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ ScriptDebugServer* m_scriptDebugServer;
+#endif
+ bool m_enabled;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+#endif // InspectorRuntimeAgent_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectRuntimeAgentcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp (0 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSGlobalObjectRuntimeAgent.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "InjectedScript.h"
+#include "InjectedScriptManager.h"
+#include "JSGlobalObject.h"
+
+using namespace JSC;
+
+namespace Inspector {
+
+JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(InjectedScriptManager* injectedScriptManager, JSGlobalObject& globalObject)
+ : InspectorRuntimeAgent(injectedScriptManager)
+ , m_globalObject(globalObject)
+{
+}
+
+void JSGlobalObjectRuntimeAgent::didCreateFrontendAndBackend(InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
+{
+ m_frontendDispatcher = std::make_unique<InspectorRuntimeFrontendDispatcher>(frontendChannel);
+ m_backendDispatcher = InspectorRuntimeBackendDispatcher::create(backendDispatcher, this);
+}
+
+void JSGlobalObjectRuntimeAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason)
+{
+ m_frontendDispatcher = nullptr;
+ m_backendDispatcher.clear();
+}
+
+VM* JSGlobalObjectRuntimeAgent::globalVM()
+{
+ return &m_globalObject.vm();
+}
+
+InjectedScript JSGlobalObjectRuntimeAgent::injectedScriptForEval(ErrorString* errorString, const int* executionContextId)
+{
+ ASSERT_UNUSED(executionContextId, !executionContextId);
+
+ JSC::ExecState* scriptState = m_globalObject.globalExec();
+ InjectedScript injectedScript = injectedScriptManager()->injectedScriptFor(scriptState);
+ if (injectedScript.hasNoValue())
+ *errorString = ASCIILiteral("Internal error: main world execution context not found.");
+
+ return injectedScript;
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectRuntimeAgenth"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h (0 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h         (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSGlobalObjectRuntimeAgent_h
+#define JSGlobalObjectRuntimeAgent_h
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorRuntimeAgent.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace JSC {
+class JSGlobalObject;
+}
+
+namespace Inspector {
+
+class JSGlobalObjectRuntimeAgent final : public InspectorRuntimeAgent {
+public:
+ JSGlobalObjectRuntimeAgent(InjectedScriptManager*, JSC::JSGlobalObject&);
+
+ virtual void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*) override;
+ virtual void willDestroyFrontendAndBackend(InspectorDisconnectReason) override;
+
+ virtual JSC::VM* globalVM() override;
+ virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) override;
+
+ // FIXME: JavaScript inspector does not yet have a console object to mute.
+ virtual void muteConsole() override { }
+ virtual void unmuteConsole() override { }
+
+private:
+ std::unique_ptr<InspectorRuntimeFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<InspectorRuntimeBackendDispatcher> m_backendDispatcher;
+ JSC::JSGlobalObject& m_globalObject;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(JSGlobalObjectRuntimeAgent_h)
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -1603,7 +1603,6 @@
</span><span class="cx"> inspector/InspectorPageAgent.cpp
</span><span class="cx"> inspector/InspectorProfilerAgent.cpp
</span><span class="cx"> inspector/InspectorResourceAgent.cpp
</span><del>- inspector/InspectorRuntimeAgent.cpp
</del><span class="cx"> inspector/InspectorStyleSheet.cpp
</span><span class="cx"> inspector/InspectorStyleTextEditor.cpp
</span><span class="cx"> inspector/InspectorTimelineAgent.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/ChangeLog        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2014-01-24 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Move InspectorRuntimeAgent into JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=127605
+
+ Reviewed by Timothy Hatcher.
+
+ Covered by existing tests. No change in functionality.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/InspectorAllInOne.cpp:
+ Remove WebCore InspectorRuntimeAgent.
+
+ * ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h: Added.
+ Add JavaScriptCore InspectorRuntimeAgent.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/WorkerInspectorController.h:
+ * inspector/WorkerInspectorController.cpp:
+ (WebCore::WorkerInspectorController::WorkerInspectorController):
+ New constructors for the runtime agent.
+
+ * inspector/PageRuntimeAgent.h:
+ * inspector/PageRuntimeAgent.cpp:
+ (WebCore::PageRuntimeAgent::PageRuntimeAgent):
+ (WebCore::PageRuntimeAgent::enable):
+ (WebCore::PageRuntimeAgent::disable):
+ (WebCore::PageRuntimeAgent::didCreateMainWorldContext):
+ (WebCore::PageRuntimeAgent::didCreateIsolatedContext):
+ (WebCore::PageRuntimeAgent::globalVM):
+ Modernize and implement globalVM.
+
+ * inspector/WorkerRuntimeAgent.h:
+ * inspector/WorkerRuntimeAgent.cpp:
+ (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
+ (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
+ (WebCore::WorkerRuntimeAgent::globalVM):
+ Modernize and implement globalVM.
+
</ins><span class="cx"> 2014-01-25 Diego Pino Garcia <dpino@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Add parameters from 'DOM Object Model Core' spec and 'DOM CSS' spec that can be NULL
</span></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersinspectoragentsInspectorRuntimeAgenth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h (0 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h         (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+#ifndef WebCore_FWD_InspectorRuntimeAgent_h
+#define WebCore_FWD_InspectorRuntimeAgent_h
+#include <JavaScriptCore/InspectorRuntimeAgent.h>
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -3826,8 +3826,6 @@
</span><span class="cx">         Source/WebCore/inspector/InspectorProfilerAgent.h \
</span><span class="cx">         Source/WebCore/inspector/InspectorResourceAgent.cpp \
</span><span class="cx">         Source/WebCore/inspector/InspectorResourceAgent.h \
</span><del>-        Source/WebCore/inspector/InspectorRuntimeAgent.cpp \
-        Source/WebCore/inspector/InspectorRuntimeAgent.h \
</del><span class="cx">         Source/WebCore/inspector/InspectorStyleSheet.cpp \
</span><span class="cx">         Source/WebCore/inspector/InspectorStyleSheet.h \
</span><span class="cx">         Source/WebCore/inspector/InspectorStyleTextEditor.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -17778,14 +17778,6 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\InspectorRuntimeAgent.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\inspector\InspectorStyleSheet.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</span><span class="lines">@@ -18501,7 +18493,6 @@
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptHost.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptManager.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptModule.h" />
</span><del>- <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgent.h" />
</del><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgentBase.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgentRegistry.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorBackendDispatcher.h" />
</span><span class="lines">@@ -18512,6 +18503,8 @@
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSTypeBuilders.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorTypeBuilder.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorValues.h" />
</span><ins>+ <ClInclude Include="..\ForwardingHeaders\inspector\agents\InspectorAgent.h" />
+ <ClInclude Include="..\ForwardingHeaders\inspector\agents\InspectorRuntimeAgent.h" />
</ins><span class="cx"> <ClInclude Include="..\ForwardingHeaders\masm\X86Assembler.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\parser\SourceCode.h" />
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\parser\SourceProvider.h" />
</span><span class="lines">@@ -20880,7 +20873,6 @@
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorPageAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorProfilerAgent.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorResourceAgent.h" />
</span><del>- <ClInclude Include="..\inspector\InspectorRuntimeAgent.h" />
</del><span class="cx"> <ClInclude Include="..\inspector\InspectorStyleSheet.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorStyleTextEditor.h" />
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorTimelineAgent.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -274,6 +274,9 @@
</span><span class="cx"> <Filter Include="ForwardingHeaders\inspector">
</span><span class="cx"> <UniqueIdentifier>{132bade2-0aab-6274-0adff-ae8aed5aed4}</UniqueIdentifier>
</span><span class="cx"> </Filter>
</span><ins>+ <Filter Include="ForwardingHeaders\inspector\agents">
+ <UniqueIdentifier>{132bade2-0aab-6274-0adff-abcdacbdabc}</UniqueIdentifier>
+ </Filter>
</ins><span class="cx"> <Filter Include="history">
</span><span class="cx"> <UniqueIdentifier>{6f39dedf-2d3a-414e-83fe-7bf64f911cfb}</UniqueIdentifier>
</span><span class="cx"> </Filter>
</span><span class="lines">@@ -4818,9 +4821,6 @@
</span><span class="cx"> <ClCompile Include="..\inspector\InspectorResourceAgent.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\inspector\InspectorRuntimeAgent.cpp">
- <Filter>inspector</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\inspector\InspectorStyleSheet.cpp">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -12089,9 +12089,6 @@
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptModule.h">
</span><span class="cx"> <Filter>ForwardingHeaders\inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgent.h">
- <Filter>ForwardingHeaders\inspector</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgentBase.h">
</span><span class="cx"> <Filter>ForwardingHeaders\inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="lines">@@ -12122,6 +12119,12 @@
</span><span class="cx"> <ClInclude Include="..\ForwardingHeaders\inspector\InspectorValues.h">
</span><span class="cx"> <Filter>ForwardingHeaders\inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\ForwardingHeaders\inspector\agents\InspectorAgent.h">
+ <Filter>ForwardingHeaders\inspector</Filter>
+ </ClInclude>
+ <ClInclude Include="..\ForwardingHeaders\inspector\agents\InspectorRuntimeAgent.h">
+ <Filter>ForwardingHeaders\inspector</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\history\BackForwardClient.h">
</span><span class="cx"> <Filter>history</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="lines">@@ -12353,9 +12356,6 @@
</span><span class="cx"> <ClInclude Include="..\inspector\InspectorResourceAgent.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\inspector\InspectorRuntimeAgent.h">
- <Filter>inspector</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\inspector\InspectorStyleSheet.h">
</span><span class="cx"> <Filter>inspector</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -2265,7 +2265,6 @@
</span><span class="cx">                 7A74ECBA101839A600BF939E /* InspectorDOMStorageAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */; };
</span><span class="cx">                 7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */; };
</span><span class="cx">                 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */; };
</span><del>-                7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */; };
</del><span class="cx">                 7AA51DD5148506A900AD2752 /* InspectorMemoryAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */; };
</span><span class="cx">                 7AA51DD6148506A900AD2752 /* InspectorMemoryAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */; };
</span><span class="cx">                 7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */; };
</span><span class="lines">@@ -2275,7 +2274,6 @@
</span><span class="cx">                 7ACD88D314C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */; };
</span><span class="cx">                 7ACD88D414C08BD60084EDD2 /* InspectorIndexedDBAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */; };
</span><span class="cx">                 7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; };
</span><del>-                7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */; };
</del><span class="cx">                 7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; };
</span><span class="cx">                 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
</span><span class="cx">                 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; };
</span><span class="lines">@@ -9204,7 +9202,6 @@
</span><span class="cx">                 7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageAgent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageAgent.h; sourceTree = "<group>"; };
</span><span class="cx">                 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; };
</span><del>-                7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorRuntimeAgent.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorMemoryAgent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorMemoryAgent.h; sourceTree = "<group>"; };
</span><span class="cx">                 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMEditor.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -9214,7 +9211,6 @@
</span><span class="cx">                 7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorIndexedDBAgent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorIndexedDBAgent.h; sourceTree = "<group>"; };
</span><span class="cx">                 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
</span><del>-                7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorRuntimeAgent.h; sourceTree = "<group>"; };
</del><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -14853,8 +14849,6 @@
</span><span class="cx">                                 9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */,
</span><span class="cx">                                 82AB1771125C826700C5069D /* InspectorResourceAgent.cpp */,
</span><span class="cx">                                 82AB1772125C826700C5069D /* InspectorResourceAgent.h */,
</span><del>-                                7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */,
-                                7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */,
</del><span class="cx">                                 82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */,
</span><span class="cx">                                 82AB1770125C826700C5069D /* InspectorStyleSheet.h */,
</span><span class="cx">                                 82889B4A13C62392009A6156 /* InspectorStyleTextEditor.cpp */,
</span><span class="lines">@@ -23960,7 +23954,6 @@
</span><span class="cx">                                 4F6FDD651341DEDD001F8EE3 /* InspectorPageAgent.h in Headers */,
</span><span class="cx">                                 9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */,
</span><span class="cx">                                 82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */,
</span><del>-                                7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */,
</del><span class="cx">                                 82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
</span><span class="cx">                                 82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */,
</span><span class="cx">                                 31EAF97E121435A400E7C1BF /* DeviceMotionClientIOS.h in Headers */,
</span><span class="lines">@@ -27289,7 +27282,6 @@
</span><span class="cx">                                 E1FF8F5F1807442100132674 /* SubtleCrypto.cpp in Sources */,
</span><span class="cx">                                 9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */,
</span><span class="cx">                                 82AB1775125C826700C5069D /* InspectorResourceAgent.cpp in Sources */,
</span><del>-                                7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */,
</del><span class="cx">                                 82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
</span><span class="cx">                                 82889B4C13C62392009A6156 /* InspectorStyleTextEditor.cpp in Sources */,
</span><span class="cx">                                 07277E4E17D018CC0015534D /* JSMediaStreamAudioDestinationNode.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorAllInOne.cpp (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorAllInOne.cpp        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/InspectorAllInOne.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -60,7 +60,6 @@
</span><span class="cx"> #include "InspectorPageAgent.cpp"
</span><span class="cx"> #include "InspectorProfilerAgent.cpp"
</span><span class="cx"> #include "InspectorResourceAgent.cpp"
</span><del>-#include "InspectorRuntimeAgent.cpp"
</del><span class="cx"> #include "InspectorStyleSheet.cpp"
</span><span class="cx"> #include "InspectorStyleTextEditor.cpp"
</span><span class="cx"> #include "InspectorTimelineAgent.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.cpp        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -106,6 +106,11 @@
</span><span class="cx"> m_pageAgent = pageAgentPtr.get();
</span><span class="cx"> m_agents.append(std::move(pageAgentPtr));
</span><span class="cx">
</span><ins>+ auto runtimeAgentPtr = std::make_unique<PageRuntimeAgent>(m_injectedScriptManager.get(), &page, pageAgent);
+ PageRuntimeAgent* runtimeAgent = runtimeAgentPtr.get();
+ m_instrumentingAgents->setPageRuntimeAgent(runtimeAgent);
+ m_agents.append(std::move(runtimeAgentPtr));
+
</ins><span class="cx"> auto domAgentPtr = std::make_unique<InspectorDOMAgent>(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get());
</span><span class="cx"> m_domAgent = domAgentPtr.get();
</span><span class="cx"> m_agents.append(std::move(domAgentPtr));
</span><span class="lines">@@ -137,10 +142,6 @@
</span><span class="cx"> m_resourceAgent = resourceAgentPtr.get();
</span><span class="cx"> m_agents.append(std::move(resourceAgentPtr));
</span><span class="cx">
</span><del>- auto runtimeAgentPtr = std::make_unique<PageRuntimeAgent>(m_instrumentingAgents.get(), m_injectedScriptManager.get(), &page, pageAgent);
- InspectorRuntimeAgent* runtimeAgent = runtimeAgentPtr.get();
- m_agents.append(std::move(runtimeAgentPtr));
-
</del><span class="cx"> auto consoleAgentPtr = std::make_unique<PageConsoleAgent>(m_instrumentingAgents.get(), m_injectedScriptManager.get(), m_domAgent);
</span><span class="cx"> InspectorConsoleAgent* consoleAgent = consoleAgentPtr.get();
</span><span class="cx"> m_agents.append(std::move(consoleAgentPtr));
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorRuntimeAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -1,223 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorRuntimeAgent.h"
-
-#include "JSDOMWindowBase.h"
-#include <inspector/InjectedScript.h>
-#include <inspector/InjectedScriptManager.h>
-#include <inspector/InspectorValues.h>
-#include <parser/ParserError.h>
-#include <parser/SourceCode.h>
-#include <runtime/Completion.h>
-#include <runtime/JSLock.h>
-#include <wtf/PassRefPtr.h>
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-#include <inspector/ScriptDebugServer.h>
-#endif
-
-using namespace JSC;
-
-using namespace Inspector;
-
-namespace WebCore {
-
-static bool asBool(const bool* const b)
-{
- return b ? *b : false;
-}
-
-InspectorRuntimeAgent::InspectorRuntimeAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager)
- : InspectorAgentBase(ASCIILiteral("Runtime"), instrumentingAgents)
- , m_enabled(false)
- , m_injectedScriptManager(injectedScriptManager)
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- , m_scriptDebugServer(nullptr)
-#endif
-{
-}
-
-InspectorRuntimeAgent::~InspectorRuntimeAgent()
-{
-}
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-static ScriptDebugServer::PauseOnExceptionsState setPauseOnExceptionsState(ScriptDebugServer* scriptDebugServer, ScriptDebugServer::PauseOnExceptionsState newState)
-{
- ASSERT(scriptDebugServer);
- ScriptDebugServer::PauseOnExceptionsState presentState = scriptDebugServer->pauseOnExceptionsState();
- if (presentState != newState)
- scriptDebugServer->setPauseOnExceptionsState(newState);
- return presentState;
-}
-#endif
-
-static PassRefPtr<Inspector::TypeBuilder::Runtime::ErrorRange> buildErrorRangeObject(const JSTokenLocation& tokenLocation)
-{
- RefPtr<Inspector::TypeBuilder::Runtime::ErrorRange> result = Inspector::TypeBuilder::Runtime::ErrorRange::create()
- .setStartOffset(tokenLocation.startOffset)
- .setEndOffset(tokenLocation.endOffset);
- return result.release();
-}
-
-void InspectorRuntimeAgent::parse(ErrorString*, const String& expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType::Enum* result, Inspector::TypeBuilder::OptOutput<String>* message, RefPtr<Inspector::TypeBuilder::Runtime::ErrorRange>& range)
-{
- VM* vm = JSDOMWindowBase::commonVM();
- JSLockHolder lock(vm);
-
- ParserError error;
- checkSyntax(*vm, JSC::makeSource(expression), error);
-
- switch (error.m_syntaxErrorType) {
- case ParserError::SyntaxErrorNone:
- *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::None;
- break;
- case ParserError::SyntaxErrorIrrecoverable:
- *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::Irrecoverable;
- break;
- case ParserError::SyntaxErrorUnterminatedLiteral:
- *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::UnterminatedLiteral;
- break;
- case ParserError::SyntaxErrorRecoverable:
- *result = Inspector::TypeBuilder::Runtime::SyntaxErrorType::Recoverable;
- break;
- }
-
- if (error.m_syntaxErrorType != ParserError::SyntaxErrorNone) {
- *message = error.m_message;
- range = buildErrorRangeObject(error.m_token.m_location);
- }
-}
-
-void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
-{
- InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId);
- if (injectedScript.hasNoValue())
- return;
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions;
- if (asBool(doNotPauseOnExceptionsAndMuteConsole))
- previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
-#endif
- if (asBool(doNotPauseOnExceptionsAndMuteConsole))
- muteConsole();
-
- injectedScript.evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
-
- if (asBool(doNotPauseOnExceptionsAndMuteConsole)) {
- unmuteConsole();
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
-#endif
- }
-}
-
-void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<InspectorArray>* const optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
-{
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
- if (injectedScript.hasNoValue()) {
- *errorString = "Inspected frame has gone";
- return;
- }
- String arguments;
- if (optionalArguments)
- arguments = (*optionalArguments)->toJSONString();
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions;
- if (asBool(doNotPauseOnExceptionsAndMuteConsole))
- previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
-#endif
- if (asBool(doNotPauseOnExceptionsAndMuteConsole))
- muteConsole();
-
- injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
-
- if (asBool(doNotPauseOnExceptionsAndMuteConsole)) {
- unmuteConsole();
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
-#endif
- }
-}
-
-void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties)
-{
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
- if (injectedScript.hasNoValue()) {
- *errorString = "Inspected frame has gone";
- return;
- }
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
-#endif
- muteConsole();
-
- injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, &result);
- injectedScript.getInternalProperties(errorString, objectId, &internalProperties);
-
- unmuteConsole();
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
-#endif
-}
-
-void InspectorRuntimeAgent::releaseObject(ErrorString*, const String& objectId)
-{
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
- if (!injectedScript.hasNoValue())
- injectedScript.releaseObject(objectId);
-}
-
-void InspectorRuntimeAgent::releaseObjectGroup(ErrorString*, const String& objectGroup)
-{
- m_injectedScriptManager->releaseObjectGroup(objectGroup);
-}
-
-void InspectorRuntimeAgent::run(ErrorString*)
-{
-}
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-void InspectorRuntimeAgent::setScriptDebugServer(ScriptDebugServer* scriptDebugServer)
-{
- m_scriptDebugServer = scriptDebugServer;
-}
-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorRuntimeAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -1,116 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InspectorRuntimeAgent_h
-#define InspectorRuntimeAgent_h
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorWebAgentBase.h"
-#include "InspectorWebBackendDispatchers.h"
-#include <inspector/InspectorJSBackendDispatchers.h>
-#include <inspector/InspectorJSFrontendDispatchers.h>
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-
-namespace Inspector {
-class InjectedScript;
-class InjectedScriptManager;
-class InspectorArray;
-class InspectorObject;
-class InspectorValue;
-class ScriptDebugServer;
-}
-
-namespace WebCore {
-
-class InstrumentingAgents;
-class WorkerGlobalScope;
-
-typedef String ErrorString;
-
-class InspectorRuntimeAgent : public InspectorAgentBase, public Inspector::InspectorRuntimeBackendDispatcherHandler {
- WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent);
-public:
- virtual ~InspectorRuntimeAgent();
-
- // Part of the protocol.
- virtual void enable(ErrorString*) override { m_enabled = true; }
- virtual void disable(ErrorString*) override { m_enabled = false; }
- virtual void parse(ErrorString*, const String& expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType::Enum* result, Inspector::TypeBuilder::OptOutput<String>* message, RefPtr<Inspector::TypeBuilder::Runtime::ErrorRange>&) override;
- virtual void evaluate(ErrorString*,
- const String& expression,
- const String* objectGroup,
- const bool* includeCommandLineAPI,
- const bool* doNotPauseOnExceptionsAndMuteConsole,
- const int* executionContextId,
- const bool* returnByValue,
- const bool* generatePreview,
- RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result,
- Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override;
- virtual void callFunctionOn(ErrorString*,
- const String& objectId,
- const String& expression,
- const RefPtr<Inspector::InspectorArray>* optionalArguments,
- const bool* doNotPauseOnExceptionsAndMuteConsole,
- const bool* returnByValue,
- const bool* generatePreview,
- RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result,
- Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override;
- virtual void releaseObject(ErrorString*, const String& objectId) override;
- virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties) override;
- virtual void releaseObjectGroup(ErrorString*, const String& objectGroup) override;
- virtual void run(ErrorString*) override;
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- void setScriptDebugServer(Inspector::ScriptDebugServer*);
-#endif
-
-protected:
- InspectorRuntimeAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*);
- virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
-
- virtual void muteConsole() = 0;
- virtual void unmuteConsole() = 0;
-
- Inspector::InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
- bool m_enabled;
-
-private:
- Inspector::InjectedScriptManager* m_injectedScriptManager;
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- Inspector::ScriptDebugServer* m_scriptDebugServer;
-#endif
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
-#endif // InspectorRuntimeAgent_h
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -29,18 +29,20 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><ins>+#include "PageRuntimeAgent.h"
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">
</span><del>-#include "PageRuntimeAgent.h"
-
</del><span class="cx"> #include "Document.h"
</span><ins>+#include "Frame.h"
</ins><span class="cx"> #include "InspectorPageAgent.h"
</span><span class="cx"> #include "InstrumentingAgents.h"
</span><ins>+#include "JSDOMWindowBase.h"
</ins><span class="cx"> #include "MainFrame.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PageConsole.h"
</span><span class="cx"> #include "ScriptController.h"
</span><ins>+#include "ScriptState.h"
</ins><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include <inspector/InjectedScript.h>
</span><span class="cx"> #include <inspector/InjectedScriptManager.h>
</span><span class="lines">@@ -51,20 +53,14 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-PageRuntimeAgent::PageRuntimeAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
- : InspectorRuntimeAgent(instrumentingAgents, injectedScriptManager)
</del><ins>+PageRuntimeAgent::PageRuntimeAgent(InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
+ : InspectorRuntimeAgent(injectedScriptManager)
</ins><span class="cx"> , m_inspectedPage(page)
</span><span class="cx"> , m_pageAgent(pageAgent)
</span><span class="cx"> , m_mainWorldContextCreated(false)
</span><span class="cx"> {
</span><del>- m_instrumentingAgents->setPageRuntimeAgent(this);
</del><span class="cx"> }
</span><span class="cx">
</span><del>-PageRuntimeAgent::~PageRuntimeAgent()
-{
- m_instrumentingAgents->setPageRuntimeAgent(nullptr);
-}
-
</del><span class="cx"> void PageRuntimeAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
</span><span class="cx"> {
</span><span class="cx"> m_frontendDispatcher = std::make_unique<InspectorRuntimeFrontendDispatcher>(frontendChannel);
</span><span class="lines">@@ -82,7 +78,7 @@
</span><span class="cx">
</span><span class="cx"> void PageRuntimeAgent::enable(ErrorString* errorString)
</span><span class="cx"> {
</span><del>- if (m_enabled)
</del><ins>+ if (enabled())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> InspectorRuntimeAgent::enable(errorString);
</span><span class="lines">@@ -96,7 +92,7 @@
</span><span class="cx">
</span><span class="cx"> void PageRuntimeAgent::disable(ErrorString* errorString)
</span><span class="cx"> {
</span><del>- if (!m_enabled)
</del><ins>+ if (!enabled())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> InspectorRuntimeAgent::disable(errorString);
</span><span class="lines">@@ -106,8 +102,9 @@
</span><span class="cx"> {
</span><span class="cx"> m_mainWorldContextCreated = true;
</span><span class="cx">
</span><del>- if (!m_enabled)
</del><ins>+ if (!enabled())
</ins><span class="cx"> return;
</span><ins>+
</ins><span class="cx"> ASSERT(m_frontendDispatcher);
</span><span class="cx"> String frameId = m_pageAgent->frameId(frame);
</span><span class="cx"> JSC::ExecState* scriptState = mainWorldExecState(frame);
</span><span class="lines">@@ -116,13 +113,19 @@
</span><span class="cx">
</span><span class="cx"> void PageRuntimeAgent::didCreateIsolatedContext(Frame* frame, JSC::ExecState* scriptState, SecurityOrigin* origin)
</span><span class="cx"> {
</span><del>- if (!m_enabled)
</del><ins>+ if (!enabled())
</ins><span class="cx"> return;
</span><ins>+
</ins><span class="cx"> ASSERT(m_frontendDispatcher);
</span><span class="cx"> String frameId = m_pageAgent->frameId(frame);
</span><span class="cx"> notifyContextCreated(frameId, scriptState, origin, false);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSC::VM* PageRuntimeAgent::globalVM()
+{
+ return JSDOMWindowBase::commonVM();
+}
+
</ins><span class="cx"> InjectedScript PageRuntimeAgent::injectedScriptForEval(ErrorString* 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 (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageRuntimeAgent.h        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/PageRuntimeAgent.h        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -33,11 +33,14 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">
</span><del>-#include "InspectorRuntimeAgent.h"
-#include "InspectorWebFrontendDispatchers.h"
-#include "ScriptState.h"
</del><ins>+#include <inspector/InspectorJSFrontendDispatchers.h>
+#include <inspector/agents/InspectorRuntimeAgent.h>
</ins><span class="cx"> #include <wtf/PassOwnPtr.h>
</span><span class="cx">
</span><ins>+namespace JSC {
+class ExecState;
+}
+
</ins><span class="cx"> namespace Inspector {
</span><span class="cx"> class InjectedScriptManager;
</span><span class="cx"> }
</span><span class="lines">@@ -45,13 +48,15 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class InspectorPageAgent;
</span><ins>+class Frame;
</ins><span class="cx"> class Page;
</span><span class="cx"> class SecurityOrigin;
</span><ins>+typedef String ErrorString;
</ins><span class="cx">
</span><del>-class PageRuntimeAgent : public InspectorRuntimeAgent {
</del><ins>+class PageRuntimeAgent final : public Inspector::InspectorRuntimeAgent {
</ins><span class="cx"> public:
</span><del>- PageRuntimeAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*, Page*, InspectorPageAgent*);
- virtual ~PageRuntimeAgent();
</del><ins>+ PageRuntimeAgent(Inspector::InjectedScriptManager*, Page*, InspectorPageAgent*);
+ virtual ~PageRuntimeAgent() { }
</ins><span class="cx">
</span><span class="cx"> virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
</span><span class="cx"> virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;
</span><span class="lines">@@ -62,6 +67,7 @@
</span><span class="cx"> void didCreateIsolatedContext(Frame*, JSC::ExecState*, SecurityOrigin*);
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ virtual JSC::VM* globalVM() override;
</ins><span class="cx"> virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, 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="trunkSourceWebCoreinspectorWorkerInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -85,8 +85,9 @@
</span><span class="cx"> , m_injectedScriptManager(std::make_unique<PageInjectedScriptManager>(*this, PageInjectedScriptHost::create()))
</span><span class="cx"> , m_runtimeAgent(nullptr)
</span><span class="cx"> {
</span><del>- auto runtimeAgent = std::make_unique<WorkerRuntimeAgent>(m_instrumentingAgents.get(), m_injectedScriptManager.get(), &workerGlobalScope);
</del><ins>+ auto runtimeAgent = std::make_unique<WorkerRuntimeAgent>(m_injectedScriptManager.get(), &workerGlobalScope);
</ins><span class="cx"> m_runtimeAgent = runtimeAgent.get();
</span><ins>+ m_instrumentingAgents->setWorkerRuntimeAgent(m_runtimeAgent);
</ins><span class="cx"> m_agents.append(std::move(runtimeAgent));
</span><span class="cx">
</span><span class="cx"> auto consoleAgent = std::make_unique<WorkerConsoleAgent>(m_instrumentingAgents.get(), m_injectedScriptManager.get());
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.h (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerInspectorController.h        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.h        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -50,10 +50,10 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class InspectorInstrumentation;
</span><del>-class InspectorRuntimeAgent;
</del><span class="cx"> class InstrumentingAgents;
</span><span class="cx"> class PageInjectedScriptManager;
</span><span class="cx"> class WorkerGlobalScope;
</span><ins>+class WorkerRuntimeAgent;
</ins><span class="cx">
</span><span class="cx"> class WorkerInspectorController final : public Inspector::InspectorEnvironment {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(WorkerInspectorController);
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> WorkerGlobalScope& m_workerGlobalScope;
</span><span class="cx"> RefPtr<InstrumentingAgents> m_instrumentingAgents;
</span><span class="cx"> std::unique_ptr<PageInjectedScriptManager> m_injectedScriptManager;
</span><del>- InspectorRuntimeAgent* m_runtimeAgent;
</del><ins>+ WorkerRuntimeAgent* m_runtimeAgent;
</ins><span class="cx"> Inspector::InspectorAgentRegistry m_agents;
</span><span class="cx"> std::unique_ptr<InspectorFrontendChannel> m_frontendChannel;
</span><span class="cx"> RefPtr<Inspector::InspectorBackendDispatcher> m_backendDispatcher;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">
</span><span class="cx"> #include "InstrumentingAgents.h"
</span><ins>+#include "JSDOMWindowBase.h"
</ins><span class="cx"> #include "ScriptState.h"
</span><span class="cx"> #include "WorkerDebuggerAgent.h"
</span><span class="cx"> #include "WorkerGlobalScope.h"
</span><span class="lines">@@ -46,19 +47,13 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-WorkerRuntimeAgent::WorkerRuntimeAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager, WorkerGlobalScope* workerGlobalScope)
- : InspectorRuntimeAgent(instrumentingAgents, injectedScriptManager)
</del><ins>+WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptManager, WorkerGlobalScope* workerGlobalScope)
+ : InspectorRuntimeAgent(injectedScriptManager)
</ins><span class="cx"> , m_workerGlobalScope(workerGlobalScope)
</span><span class="cx"> , m_paused(false)
</span><span class="cx"> {
</span><del>- m_instrumentingAgents->setWorkerRuntimeAgent(this);
</del><span class="cx"> }
</span><span class="cx">
</span><del>-WorkerRuntimeAgent::~WorkerRuntimeAgent()
-{
- m_instrumentingAgents->setWorkerRuntimeAgent(nullptr);
-}
-
</del><span class="cx"> void WorkerRuntimeAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, InspectorBackendDispatcher* backendDispatcher)
</span><span class="cx"> {
</span><span class="cx"> m_backendDispatcher = InspectorRuntimeBackendDispatcher::create(backendDispatcher, this);
</span><span class="lines">@@ -72,9 +67,10 @@
</span><span class="cx"> InjectedScript WorkerRuntimeAgent::injectedScriptForEval(ErrorString* error, const int* executionContextId)
</span><span class="cx"> {
</span><span class="cx"> if (executionContextId) {
</span><del>- *error = "Execution context id is not supported for workers as there is only one execution context.";
</del><ins>+ *error = ASCIILiteral("Execution context id is not supported for workers as there is only one execution context.");
</ins><span class="cx"> return InjectedScript();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> JSC::ExecState* scriptState = execStateFromWorkerGlobalScope(m_workerGlobalScope);
</span><span class="cx"> return injectedScriptManager()->injectedScriptFor(scriptState);
</span><span class="cx"> }
</span><span class="lines">@@ -94,6 +90,11 @@
</span><span class="cx"> m_paused = false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSC::VM* WorkerRuntimeAgent::globalVM()
+{
+ return JSDOMWindowBase::commonVM();
+}
+
</ins><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><span class="cx"> void WorkerRuntimeAgent::pauseWorkerGlobalScope(WorkerGlobalScope* context)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorWorkerRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h (162766 => 162767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h        2014-01-25 17:25:03 UTC (rev 162766)
+++ trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h        2014-01-25 17:48:16 UTC (rev 162767)
</span><span class="lines">@@ -33,29 +33,30 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">
</span><del>-#include "InspectorRuntimeAgent.h"
</del><ins>+#include <inspector/agents/InspectorRuntimeAgent.h>
</ins><span class="cx"> #include <wtf/PassOwnPtr.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class WorkerGlobalScope;
</span><ins>+typedef String ErrorString;
</ins><span class="cx">
</span><del>-class WorkerRuntimeAgent : public InspectorRuntimeAgent {
</del><ins>+class WorkerRuntimeAgent final : public Inspector::InspectorRuntimeAgent {
</ins><span class="cx"> public:
</span><del>- WorkerRuntimeAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*, WorkerGlobalScope*);
- virtual ~WorkerRuntimeAgent();
</del><ins>+ WorkerRuntimeAgent(Inspector::InjectedScriptManager*, WorkerGlobalScope*);
+ virtual ~WorkerRuntimeAgent() { }
</ins><span class="cx">
</span><span class="cx"> virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
</span><span class="cx"> virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;
</span><span class="cx">
</span><del>- // Protocol commands.
</del><span class="cx"> virtual void run(ErrorString*) override;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><span class="cx"> void pauseWorkerGlobalScope(WorkerGlobalScope*);
</span><del>-#endif // ENABLE(JAVASCRIPT_DEBUGGER)
</del><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> private:
</span><ins>+ virtual JSC::VM* globalVM() override;
</ins><span class="cx"> virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, 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>