<!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>[224345] trunk/Source/WebCore</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/224345">224345</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2017-11-02 11:25:28 -0700 (Thu, 02 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Move InspectorAgents into a folder
https://bugs.webkit.org/show_bug.cgi?id=179132

Reviewed by Devin Rousso.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Move files around.

* inspector/agents/InspectorApplicationCacheAgent.cpp: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp.
* inspector/agents/InspectorApplicationCacheAgent.h: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.h.
* inspector/agents/InspectorCSSAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCSSAgent.cpp.
* inspector/agents/InspectorCSSAgent.h: Renamed from Source/WebCore/inspector/InspectorCSSAgent.h.
* inspector/agents/InspectorCanvasAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.cpp.
* inspector/agents/InspectorCanvasAgent.h: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.h.
* inspector/agents/InspectorDOMAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMAgent.cpp.
* inspector/agents/InspectorDOMAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMAgent.h.
* inspector/agents/InspectorDOMDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp.
* inspector/agents/InspectorDOMDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.h.
* inspector/agents/InspectorDOMStorageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.cpp.
* inspector/agents/InspectorDOMStorageAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.h.
* inspector/agents/InspectorDatabaseAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.cpp.
* inspector/agents/InspectorDatabaseAgent.h: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.h.
* inspector/agents/InspectorIndexedDBAgent.cpp: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.cpp.
* inspector/agents/InspectorIndexedDBAgent.h: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.h.
* inspector/agents/InspectorLayerTreeAgent.cpp: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.cpp.
* inspector/agents/InspectorLayerTreeAgent.h: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.h.
* inspector/agents/InspectorMemoryAgent.cpp: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.cpp.
* inspector/agents/InspectorMemoryAgent.h: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.h.
* inspector/agents/InspectorNetworkAgent.cpp: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.cpp.
* inspector/agents/InspectorNetworkAgent.h: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.h.
* inspector/agents/InspectorPageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorPageAgent.cpp.
* inspector/agents/InspectorPageAgent.h: Renamed from Source/WebCore/inspector/InspectorPageAgent.h.
* inspector/agents/InspectorTimelineAgent.cpp: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.cpp.
* inspector/agents/InspectorTimelineAgent.h: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.h.
* inspector/agents/InspectorWorkerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.cpp.
* inspector/agents/InspectorWorkerAgent.h: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.h.
* inspector/agents/WebConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WebConsoleAgent.cpp.
* inspector/agents/WebConsoleAgent.h: Renamed from Source/WebCore/inspector/WebConsoleAgent.h.
* inspector/agents/WebDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WebDebuggerAgent.cpp.
* inspector/agents/WebDebuggerAgent.h: Renamed from Source/WebCore/inspector/WebDebuggerAgent.h.
* inspector/agents/WebHeapAgent.cpp: Renamed from Source/WebCore/inspector/WebHeapAgent.cpp.
* inspector/agents/WebHeapAgent.h: Renamed from Source/WebCore/inspector/WebHeapAgent.h.
* inspector/agents/page/PageConsoleAgent.cpp: Renamed from Source/WebCore/inspector/PageConsoleAgent.cpp.
* inspector/agents/page/PageConsoleAgent.h: Renamed from Source/WebCore/inspector/PageConsoleAgent.h.
* inspector/agents/page/PageDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/PageDebuggerAgent.cpp.
* inspector/agents/page/PageDebuggerAgent.h: Renamed from Source/WebCore/inspector/PageDebuggerAgent.h.
* inspector/agents/page/PageHeapAgent.cpp: Renamed from Source/WebCore/inspector/PageHeapAgent.cpp.
* inspector/agents/page/PageHeapAgent.h: Renamed from Source/WebCore/inspector/PageHeapAgent.h.
* inspector/agents/page/PageRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/PageRuntimeAgent.cpp.
* inspector/agents/page/PageRuntimeAgent.h: Renamed from Source/WebCore/inspector/PageRuntimeAgent.h.
* inspector/agents/worker/WorkerConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.cpp.
* inspector/agents/worker/WorkerConsoleAgent.h: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.h.
* inspector/agents/worker/WorkerDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.cpp.
* inspector/agents/worker/WorkerDebuggerAgent.h: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.h.
* inspector/agents/worker/WorkerRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.cpp.
* inspector/agents/worker/WorkerRuntimeAgent.h: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.h.
Move agents into folders.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/inspector/agents/</li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorApplicationCacheAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorApplicationCacheAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorApplicationCacheAgenth">trunk/Source/WebCore/inspector/agents/InspectorApplicationCacheAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorCSSAgenth">trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorCanvasAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorCanvasAgenth">trunk/Source/WebCore/inspector/agents/InspectorCanvasAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDOMAgenth">trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDOMDebuggerAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDOMDebuggerAgenth">trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDOMStorageAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDOMStorageAgenth">trunk/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDatabaseAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorDatabaseAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDatabaseAgenth">trunk/Source/WebCore/inspector/agents/InspectorDatabaseAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorIndexedDBAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorIndexedDBAgenth">trunk/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorLayerTreeAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorLayerTreeAgenth">trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorMemoryAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorMemoryAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorMemoryAgenth">trunk/Source/WebCore/inspector/agents/InspectorMemoryAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorNetworkAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorNetworkAgenth">trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorPageAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorPageAgenth">trunk/Source/WebCore/inspector/agents/InspectorPageAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorTimelineAgenth">trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorWorkerAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorWorkerAgenth">trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsWebConsoleAgentcpp">trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsWebConsoleAgenth">trunk/Source/WebCore/inspector/agents/WebConsoleAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsWebDebuggerAgentcpp">trunk/Source/WebCore/inspector/agents/WebDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsWebDebuggerAgenth">trunk/Source/WebCore/inspector/agents/WebDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsWebHeapAgentcpp">trunk/Source/WebCore/inspector/agents/WebHeapAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsWebHeapAgenth">trunk/Source/WebCore/inspector/agents/WebHeapAgent.h</a></li>
<li>trunk/Source/WebCore/inspector/agents/page/</li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageConsoleAgentcpp">trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageConsoleAgenth">trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageDebuggerAgentcpp">trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageDebuggerAgenth">trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageHeapAgentcpp">trunk/Source/WebCore/inspector/agents/page/PageHeapAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageHeapAgenth">trunk/Source/WebCore/inspector/agents/page/PageHeapAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageRuntimeAgentcpp">trunk/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentspagePageRuntimeAgenth">trunk/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h</a></li>
<li>trunk/Source/WebCore/inspector/agents/worker/</li>
<li><a href="#trunkSourceWebCoreinspectoragentsworkerWorkerConsoleAgentcpp">trunk/Source/WebCore/inspector/agents/worker/WorkerConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsworkerWorkerConsoleAgenth">trunk/Source/WebCore/inspector/agents/worker/WorkerConsoleAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsworkerWorkerDebuggerAgentcpp">trunk/Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsworkerWorkerDebuggerAgenth">trunk/Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsworkerWorkerRuntimeAgentcpp">trunk/Source/WebCore/inspector/agents/worker/WorkerRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsworkerWorkerRuntimeAgenth">trunk/Source/WebCore/inspector/agents/worker/WorkerRuntimeAgent.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreinspectorInspectorApplicationCacheAgentcpp">trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorApplicationCacheAgenth">trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgenth">trunk/Source/WebCore/inspector/InspectorCSSAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCanvasAgentcpp">trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCanvasAgenth">trunk/Source/WebCore/inspector/InspectorCanvasAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgenth">trunk/Source/WebCore/inspector/InspectorDOMAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMDebuggerAgenth">trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMStorageAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMStorageAgenth">trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDatabaseAgentcpp">trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDatabaseAgenth">trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp">trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorIndexedDBAgenth">trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorLayerTreeAgentcpp">trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorLayerTreeAgenth">trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorMemoryAgentcpp">trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorMemoryAgenth">trunk/Source/WebCore/inspector/InspectorMemoryAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorNetworkAgentcpp">trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorNetworkAgenth">trunk/Source/WebCore/inspector/InspectorNetworkAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgenth">trunk/Source/WebCore/inspector/InspectorPageAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgenth">trunk/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorWorkerAgentcpp">trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorWorkerAgenth">trunk/Source/WebCore/inspector/InspectorWorkerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageConsoleAgentcpp">trunk/Source/WebCore/inspector/PageConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageConsoleAgenth">trunk/Source/WebCore/inspector/PageConsoleAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageDebuggerAgentcpp">trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageDebuggerAgenth">trunk/Source/WebCore/inspector/PageDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageHeapAgentcpp">trunk/Source/WebCore/inspector/PageHeapAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageHeapAgenth">trunk/Source/WebCore/inspector/PageHeapAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageRuntimeAgentcpp">trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageRuntimeAgenth">trunk/Source/WebCore/inspector/PageRuntimeAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebConsoleAgentcpp">trunk/Source/WebCore/inspector/WebConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebConsoleAgenth">trunk/Source/WebCore/inspector/WebConsoleAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebDebuggerAgentcpp">trunk/Source/WebCore/inspector/WebDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebDebuggerAgenth">trunk/Source/WebCore/inspector/WebDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebHeapAgentcpp">trunk/Source/WebCore/inspector/WebHeapAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWebHeapAgenth">trunk/Source/WebCore/inspector/WebHeapAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerConsoleAgentcpp">trunk/Source/WebCore/inspector/WorkerConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerConsoleAgenth">trunk/Source/WebCore/inspector/WorkerConsoleAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerDebuggerAgentcpp">trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerDebuggerAgenth">trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerRuntimeAgentcpp">trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorWorkerRuntimeAgenth">trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt      2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -77,6 +77,9 @@
</span><span class="cx">     "${WEBCORE_DIR}/html/shadow"
</span><span class="cx">     "${WEBCORE_DIR}/html/track"
</span><span class="cx">     "${WEBCORE_DIR}/inspector"
</span><ins>+    "${WEBCORE_DIR}/inspector/agents"
+    "${WEBCORE_DIR}/inspector/agents/page"
+    "${WEBCORE_DIR}/inspector/agents/worker"
</ins><span class="cx">     "${WEBCORE_DIR}/loader"
</span><span class="cx">     "${WEBCORE_DIR}/loader/appcache"
</span><span class="cx">     "${WEBCORE_DIR}/loader/archive"
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/ChangeLog      2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Move InspectorAgents into a folder
+        https://bugs.webkit.org/show_bug.cgi?id=179132
+
+        Reviewed by Devin Rousso.
+
+        * CMakeLists.txt:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        Move files around.
+
+        * inspector/agents/InspectorApplicationCacheAgent.cpp: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp.
+        * inspector/agents/InspectorApplicationCacheAgent.h: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.h.
+        * inspector/agents/InspectorCSSAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCSSAgent.cpp.
+        * inspector/agents/InspectorCSSAgent.h: Renamed from Source/WebCore/inspector/InspectorCSSAgent.h.
+        * inspector/agents/InspectorCanvasAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.cpp.
+        * inspector/agents/InspectorCanvasAgent.h: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.h.
+        * inspector/agents/InspectorDOMAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMAgent.cpp.
+        * inspector/agents/InspectorDOMAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMAgent.h.
+        * inspector/agents/InspectorDOMDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp.
+        * inspector/agents/InspectorDOMDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.h.
+        * inspector/agents/InspectorDOMStorageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.cpp.
+        * inspector/agents/InspectorDOMStorageAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.h.
+        * inspector/agents/InspectorDatabaseAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.cpp.
+        * inspector/agents/InspectorDatabaseAgent.h: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.h.
+        * inspector/agents/InspectorIndexedDBAgent.cpp: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.cpp.
+        * inspector/agents/InspectorIndexedDBAgent.h: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.h.
+        * inspector/agents/InspectorLayerTreeAgent.cpp: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.cpp.
+        * inspector/agents/InspectorLayerTreeAgent.h: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.h.
+        * inspector/agents/InspectorMemoryAgent.cpp: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.cpp.
+        * inspector/agents/InspectorMemoryAgent.h: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.h.
+        * inspector/agents/InspectorNetworkAgent.cpp: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.cpp.
+        * inspector/agents/InspectorNetworkAgent.h: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.h.
+        * inspector/agents/InspectorPageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorPageAgent.cpp.
+        * inspector/agents/InspectorPageAgent.h: Renamed from Source/WebCore/inspector/InspectorPageAgent.h.
+        * inspector/agents/InspectorTimelineAgent.cpp: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.cpp.
+        * inspector/agents/InspectorTimelineAgent.h: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.h.
+        * inspector/agents/InspectorWorkerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.cpp.
+        * inspector/agents/InspectorWorkerAgent.h: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.h.
+        * inspector/agents/WebConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WebConsoleAgent.cpp.
+        * inspector/agents/WebConsoleAgent.h: Renamed from Source/WebCore/inspector/WebConsoleAgent.h.
+        * inspector/agents/WebDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WebDebuggerAgent.cpp.
+        * inspector/agents/WebDebuggerAgent.h: Renamed from Source/WebCore/inspector/WebDebuggerAgent.h.
+        * inspector/agents/WebHeapAgent.cpp: Renamed from Source/WebCore/inspector/WebHeapAgent.cpp.
+        * inspector/agents/WebHeapAgent.h: Renamed from Source/WebCore/inspector/WebHeapAgent.h.
+        * inspector/agents/page/PageConsoleAgent.cpp: Renamed from Source/WebCore/inspector/PageConsoleAgent.cpp.
+        * inspector/agents/page/PageConsoleAgent.h: Renamed from Source/WebCore/inspector/PageConsoleAgent.h.
+        * inspector/agents/page/PageDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/PageDebuggerAgent.cpp.
+        * inspector/agents/page/PageDebuggerAgent.h: Renamed from Source/WebCore/inspector/PageDebuggerAgent.h.
+        * inspector/agents/page/PageHeapAgent.cpp: Renamed from Source/WebCore/inspector/PageHeapAgent.cpp.
+        * inspector/agents/page/PageHeapAgent.h: Renamed from Source/WebCore/inspector/PageHeapAgent.h.
+        * inspector/agents/page/PageRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/PageRuntimeAgent.cpp.
+        * inspector/agents/page/PageRuntimeAgent.h: Renamed from Source/WebCore/inspector/PageRuntimeAgent.h.
+        * inspector/agents/worker/WorkerConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.cpp.
+        * inspector/agents/worker/WorkerConsoleAgent.h: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.h.
+        * inspector/agents/worker/WorkerDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.cpp.
+        * inspector/agents/worker/WorkerDebuggerAgent.h: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.h.
+        * inspector/agents/worker/WorkerRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.cpp.
+        * inspector/agents/worker/WorkerRuntimeAgent.h: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.h.
+        Move agents into folders.
+
</ins><span class="cx"> 2017-11-02  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Service Worker fetch should transmit headers to its client
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/Sources.txt    2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1107,51 +1107,54 @@
</span><span class="cx"> inspector/CommandLineAPIModule.cpp
</span><span class="cx"> inspector/DOMEditor.cpp
</span><span class="cx"> inspector/DOMPatchSupport.cpp
</span><del>-inspector/InspectorApplicationCacheAgent.cpp
-inspector/InspectorCSSAgent.cpp
</del><span class="cx"> inspector/InspectorCanvas.cpp
</span><del>-inspector/InspectorCanvasAgent.cpp
</del><span class="cx"> inspector/InspectorClient.cpp
</span><span class="cx"> inspector/InspectorController.cpp
</span><del>-inspector/InspectorDOMAgent.cpp
-inspector/InspectorDOMDebuggerAgent.cpp
-inspector/InspectorDOMStorageAgent.cpp
-inspector/InspectorDatabaseAgent.cpp
</del><span class="cx"> inspector/InspectorDatabaseResource.cpp
</span><span class="cx"> inspector/InspectorFrontendClientLocal.cpp
</span><span class="cx"> inspector/InspectorFrontendHost.cpp
</span><span class="cx"> inspector/InspectorHistory.cpp
</span><del>-inspector/InspectorIndexedDBAgent.cpp
</del><span class="cx"> inspector/InspectorInstrumentation.cpp
</span><span class="cx"> inspector/InspectorInstrumentationCookie.cpp
</span><del>-inspector/InspectorLayerTreeAgent.cpp
-inspector/InspectorMemoryAgent.cpp
-inspector/InspectorNetworkAgent.cpp
</del><span class="cx"> inspector/InspectorNodeFinder.cpp
</span><span class="cx"> inspector/InspectorOverlay.cpp
</span><del>-inspector/InspectorPageAgent.cpp
</del><span class="cx"> inspector/InspectorStyleSheet.cpp
</span><del>-inspector/InspectorTimelineAgent.cpp
-inspector/InspectorWorkerAgent.cpp
</del><span class="cx"> inspector/InstrumentingAgents.cpp
</span><span class="cx"> inspector/NetworkResourcesData.cpp
</span><del>-inspector/PageConsoleAgent.cpp
-inspector/PageDebuggerAgent.cpp
-inspector/PageHeapAgent.cpp
-inspector/PageRuntimeAgent.cpp
</del><span class="cx"> inspector/PageScriptDebugServer.cpp
</span><span class="cx"> inspector/TimelineRecordFactory.cpp
</span><del>-inspector/WebConsoleAgent.cpp
-inspector/WebDebuggerAgent.cpp
-inspector/WebHeapAgent.cpp
</del><span class="cx"> inspector/WebInjectedScriptHost.cpp
</span><span class="cx"> inspector/WebInjectedScriptManager.cpp
</span><del>-inspector/WorkerConsoleAgent.cpp
-inspector/WorkerDebuggerAgent.cpp
</del><span class="cx"> inspector/WorkerInspectorController.cpp
</span><del>-inspector/WorkerRuntimeAgent.cpp
</del><span class="cx"> inspector/WorkerScriptDebugServer.cpp
</span><span class="cx"> 
</span><ins>+inspector/agents/InspectorApplicationCacheAgent.cpp
+inspector/agents/InspectorCSSAgent.cpp
+inspector/agents/InspectorCanvasAgent.cpp
+inspector/agents/InspectorDOMAgent.cpp
+inspector/agents/InspectorDOMDebuggerAgent.cpp
+inspector/agents/InspectorDOMStorageAgent.cpp
+inspector/agents/InspectorDatabaseAgent.cpp
+inspector/agents/InspectorIndexedDBAgent.cpp
+inspector/agents/InspectorLayerTreeAgent.cpp
+inspector/agents/InspectorMemoryAgent.cpp
+inspector/agents/InspectorNetworkAgent.cpp
+inspector/agents/InspectorPageAgent.cpp
+inspector/agents/InspectorTimelineAgent.cpp
+inspector/agents/InspectorWorkerAgent.cpp
+inspector/agents/WebConsoleAgent.cpp
+inspector/agents/WebDebuggerAgent.cpp
+inspector/agents/WebHeapAgent.cpp
+
+inspector/agents/page/PageConsoleAgent.cpp
+inspector/agents/page/PageDebuggerAgent.cpp
+inspector/agents/page/PageHeapAgent.cpp
+inspector/agents/page/PageRuntimeAgent.cpp
+
+inspector/agents/worker/WorkerConsoleAgent.cpp
+inspector/agents/worker/WorkerDebuggerAgent.cpp
+inspector/agents/worker/WorkerRuntimeAgent.cpp
+
</ins><span class="cx"> loader/ContentFilter.cpp
</span><span class="cx"> loader/CookieJar.cpp
</span><span class="cx"> loader/CrossOriginAccessControl.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1247,7 +1247,6 @@
</span><span class="cx">          4E19592C0A39DACC00220FE5 /* MediaQueryEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959260A39DACC00220FE5 /* MediaQueryEvaluator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          4F1534DE11B532EC0021FD86 /* EditingBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DD11B532EC0021FD86 /* EditingBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               4F6FDD651341DEDD001F8EE3 /* InspectorPageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">           4FA65A6C1108ABED002615E0 /* MathMLSpaceElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FA65A6A1108ABED002615E0 /* MathMLSpaceElement.h */; };
</span><span class="cx">          501BAAA913950E2C00F7ACEB /* WindRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 501BAAA813950E2C00F7ACEB /* WindRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          504AACCE1834455900E3D9BC /* InspectorNodeFinder.h in Headers */ = {isa = PBXBuildFile; fileRef = 504AACCC1834455900E3D9BC /* InspectorNodeFinder.h */; };
</span><span class="lines">@@ -1794,7 +1793,6 @@
</span><span class="cx">          65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */; };
</span><span class="cx">          6A22E8701F10418600F546C3 /* InspectorCanvas.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A22E86F1F10418600F546C3 /* InspectorCanvas.h */; };
</span><del>-               6A4B6D6519D22519006F11D3 /* InspectorCanvasAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A4B6D6419D22519006F11D3 /* InspectorCanvasAgent.h */; };
</del><span class="cx">           6A72798B1F16C29C003F39B8 /* InspectorShaderProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A7279881F16C29B003F39B8 /* InspectorShaderProgram.h */; };
</span><span class="cx">          6A72798C1F16C29C003F39B8 /* InspectorShaderProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A7279891F16C29B003F39B8 /* InspectorShaderProgram.cpp */; };
</span><span class="cx">          6B3480940EEF50D400AC1B41 /* NativeImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1865,7 +1863,6 @@
</span><span class="cx">          71556CBE1F9F0A4900E78D08 /* JSKeyframeEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */; };
</span><span class="cx">          71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; };
</span><span class="cx">          71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; };
</span><del>-               71B1E125164048F700B1880A /* InspectorLayerTreeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B1E124164048CC00B1880A /* InspectorLayerTreeAgent.h */; };
</del><span class="cx">           71C916081D1483A300ACA47D /* UserInterfaceLayoutDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */ = {isa = PBXBuildFile; fileRef = 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */; };
</span><span class="cx">          71E2183A17359FB8006E6E4D /* PlugInsResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E2183817359FB8006E6E4D /* PlugInsResources.h */; };
</span><span class="lines">@@ -1877,7 +1874,6 @@
</span><span class="cx">          724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          727AFED41A2EA6AE000442E8 /* EXTsRGB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */; };
</span><span class="cx">          72F1ADA21A3904DC00014E18 /* EXTFragDepth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */; };
</span><del>-               754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; };
</del><span class="cx">           7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; };
</span><span class="cx">          75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; };
</span><span class="cx">          75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793EC70D0CE72D007FC0AC /* JSMessageEvent.h */; };
</span><span class="lines">@@ -1923,7 +1919,6 @@
</span><span class="cx">          7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */; };
</span><span class="cx">          7A1D7FCB18F85F0F00C385AD /* mediaControlsLocalizedStrings.js in Resources */ = {isa = PBXBuildFile; fileRef = 7A1D7FC918F85F0F00C385AD /* mediaControlsLocalizedStrings.js */; };
</span><del>-               7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">           7A29F57218C69514004D0F81 /* OutOfBandTextTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A29F57118C69514004D0F81 /* OutOfBandTextTrackPrivateAVF.h */; };
</span><span class="cx">          7A45032F18DB717200377B34 /* BufferedLineReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A45032D18DB717200377B34 /* BufferedLineReader.cpp */; };
</span><span class="cx">          7A45033018DB717200377B34 /* BufferedLineReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A45032E18DB717200377B34 /* BufferedLineReader.h */; };
</span><span class="lines">@@ -1931,7 +1926,6 @@
</span><span class="cx">          7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A54881514E432A1006AE05A /* DOMPatchSupport.h */; };
</span><span class="cx">          7A5515F5191830A3009687D2 /* YouTubePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A5515F3191830A3009687D2 /* YouTubePluginReplacement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          7A674BDC0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */; };
</span><del>-               7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */; };
</del><span class="cx">           7A929CA71C598AA9004DF226 /* ResourceLoadStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A93868218DCC14500B8263D /* VTTScanner.cpp */; };
</span><span class="cx">          7A93868618DCC14500B8263D /* VTTScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A93868318DCC14500B8263D /* VTTScanner.h */; };
</span><span class="lines">@@ -1941,8 +1935,6 @@
</span><span class="cx">          7AA3A6A4194B5C22001CBD24 /* TileCoverageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA3A6A2194B5C22001CBD24 /* TileCoverageMap.h */; };
</span><span class="cx">          7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AABA25814BC613300AA9A11 /* DOMEditor.h */; };
</span><span class="cx">          7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AAFE8CE19CB8672000F56D8 /* ScrollLatchingState.h */; };
</span><del>-               7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */; };
-               7ACD88D414C08BD60084EDD2 /* InspectorIndexedDBAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */; };
</del><span class="cx">           7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          7AE335F21ACB09E200E401EF /* WheelEventTestTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AE335F01ACB09E200E401EF /* WheelEventTestTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          7AE6C93C1BE0C60100E19E03 /* MainThreadSharedTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AE6C93A1BE0C60100E19E03 /* MainThreadSharedTimer.h */; };
</span><span class="lines">@@ -2156,9 +2148,7 @@
</span><span class="cx">          81AC6C36131C57D30009A7E0 /* StringCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 81AC6C35131C57D30009A7E0 /* StringCallback.h */; };
</span><span class="cx">          81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE20A811F4B66F00915DFA /* JSIDBCursor.h */; };
</span><span class="cx">          81F65FF613788FAA00FF6F2D /* DragState.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F65FF513788FAA00FF6F2D /* DragState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               82AB1744124B99EC00C5069D /* InspectorCSSAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 82AB1742124B99EC00C5069D /* InspectorCSSAgent.h */; };
</del><span class="cx">           82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 82AB1770125C826700C5069D /* InspectorStyleSheet.h */; };
</span><del>-               82AB1776125C826700C5069D /* InspectorNetworkAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 82AB1772125C826700C5069D /* InspectorNetworkAgent.h */; };
</del><span class="cx">           82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */ = {isa = PBXBuildFile; fileRef = 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          830030F61B7D33B500ED3AAC /* GenericCachedHTMLCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 830030F41B7D33A600ED3AAC /* GenericCachedHTMLCollection.h */; };
</span><span class="cx">          830030F81B7D3B7800ED3AAC /* CachedHTMLCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 830030F71B7D398800ED3AAC /* CachedHTMLCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2824,16 +2814,12 @@
</span><span class="cx">          A454424F119B3687009BE912 /* RenderMeter.h in Headers */ = {isa = PBXBuildFile; fileRef = A454424D119B3687009BE912 /* RenderMeter.h */; };
</span><span class="cx">          A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = A456FA2511AD4A830020B420 /* LabelsNodeList.h */; };
</span><span class="cx">          A501920E132EBF2E008BFE55 /* Autocapitalize.h in Headers */ = {isa = PBXBuildFile; fileRef = A501920C132EBF2E008BFE55 /* Autocapitalize.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               A5071E811C506B69009951BE /* InspectorMemoryAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5071E7F1C5067A0009951BE /* InspectorMemoryAgent.h */; };
</del><span class="cx">           A5071E851C56D0DC009951BE /* ResourceUsageData.h in Headers */ = {isa = PBXBuildFile; fileRef = A5071E821C56D079009951BE /* ResourceUsageData.h */; };
</span><span class="cx">          A5071E871C56D0E1009951BE /* ResourceUsageThread.h in Headers */ = {isa = PBXBuildFile; fileRef = A5071E841C56D079009951BE /* ResourceUsageThread.h */; };
</span><span class="cx">          A513B3D7114B1666001C429B /* KeyEventCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */; };
</span><span class="cx">          A516E8B7136E04DB0076C3C0 /* LocalizedDateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A516E8B4136E04DB0076C3C0 /* LocalizedDateCache.h */; };
</span><del>-               A52A68621DBB0F630083373F /* WorkerConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A52A68601DBB0F5B0083373F /* WorkerConsoleAgent.h */; };
-               A52A68661DBD4B5D0083373F /* WorkerDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A52A68641DBD4B580083373F /* WorkerDebuggerAgent.h */; };
</del><span class="cx">           A52B349E1FA41703008B6246 /* WorkerDebuggerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A52B349C1FA416F8008B6246 /* WorkerDebuggerProxy.h */; };
</span><span class="cx">          A5416FE618810EF80009FC5F /* YouTubeEmbedShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A5416FE418810EF80009FC5F /* YouTubeEmbedShadowElement.h */; };
</span><del>-               A54A0C5E1DB6D9C40017A90B /* InspectorWorkerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A0C5C1DB6D9B10017A90B /* InspectorWorkerAgent.h */; };
</del><span class="cx">           A54A0C621DB7F8C10017A90B /* WorkerInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A0C601DB7F8B70017A90B /* WorkerInspectorController.h */; };
</span><span class="cx">          A54A0C661DB805360017A90B /* WorkerScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A0C641DB805320017A90B /* WorkerScriptDebugServer.h */; };
</span><span class="cx">          A54A0C681DB807D90017A90B /* WorkerToPageFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A0C671DB807D00017A90B /* WorkerToPageFrontendChannel.h */; };
</span><span class="lines">@@ -2840,12 +2826,10 @@
</span><span class="cx">          A54A0C6C1DB831F90017A90B /* WorkerInspectorProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A0C6A1DB831F20017A90B /* WorkerInspectorProxy.h */; };
</span><span class="cx">          A554B5F31E38393A001D4E03 /* PerformanceUserTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A554B5F11E383936001D4E03 /* PerformanceUserTiming.h */; };
</span><span class="cx">          A55639D11C6F09E300806D8E /* WorkerConsoleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */; };
</span><del>-               A56C5B9B189F34570082D13C /* WebConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A56C5B99189F34570082D13C /* WebConsoleAgent.h */; };
</del><span class="cx">           A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          A578F4351DE00EEB003DFC6A /* PromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F4331DE00ED6003DFC6A /* PromiseRejectionEvent.h */; };
</span><span class="cx">          A578F43C1DE01423003DFC6A /* JSPromiseRejectionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F43A1DE013FB003DFC6A /* JSPromiseRejectionEvent.h */; };
</span><span class="cx">          A578F43F1DE0B630003DFC6A /* RejectedPromiseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = A578F43E1DE0B62B003DFC6A /* RejectedPromiseTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               A57FD71C1DB9423E006AE24B /* WorkerRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A57FD71A1DB94236006AE24B /* WorkerRuntimeAgent.h */; };
</del><span class="cx">           A5840E1D187B74D500843B10 /* InspectorInstrumentationCookie.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E1B187B74D500843B10 /* InspectorInstrumentationCookie.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          A5840E25187B8AC200843B10 /* WebInjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E23187B8AC200843B10 /* WebInjectedScriptHost.h */; };
</span><span class="cx">          A584FE2618637DAB00843B10 /* CommandLineAPIModuleSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A584FE2518637DAB00843B10 /* CommandLineAPIModuleSource.h */; };
</span><span class="lines">@@ -2865,13 +2849,34 @@
</span><span class="cx">          A5A9934A1E3809CB005B5E4D /* JSPerformanceObserverCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A993451E380999005B5E4D /* JSPerformanceObserverCallback.h */; };
</span><span class="cx">          A5A9934C1E3809CF005B5E4D /* JSPerformanceObserverEntryList.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A993471E380999005B5E4D /* JSPerformanceObserverEntryList.h */; };
</span><span class="cx">          A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               A5B81CA71FAA44620037D1E6 /* InspectorApplicationCacheAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C971FAA44260037D1E6 /* InspectorApplicationCacheAgent.h */; };
+               A5B81CA81FAA44620037D1E6 /* InspectorCanvasAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C911FAA44260037D1E6 /* InspectorCanvasAgent.h */; };
+               A5B81CA91FAA44620037D1E6 /* InspectorCSSAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CA11FAA44270037D1E6 /* InspectorCSSAgent.h */; };
+               A5B81CAA1FAA44620037D1E6 /* InspectorDatabaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C931FAA44260037D1E6 /* InspectorDatabaseAgent.h */; };
+               A5B81CAB1FAA44620037D1E6 /* InspectorDOMAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C861FAA44260037D1E6 /* InspectorDOMAgent.h */; };
+               A5B81CAC1FAA44620037D1E6 /* InspectorDOMDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CA31FAA44270037D1E6 /* InspectorDOMDebuggerAgent.h */; };
+               A5B81CAD1FAA44620037D1E6 /* InspectorDOMStorageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C8C1FAA44260037D1E6 /* InspectorDOMStorageAgent.h */; };
+               A5B81CAE1FAA44620037D1E6 /* InspectorIndexedDBAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C9E1FAA44260037D1E6 /* InspectorIndexedDBAgent.h */; };
+               A5B81CAF1FAA44620037D1E6 /* InspectorLayerTreeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C8F1FAA44260037D1E6 /* InspectorLayerTreeAgent.h */; };
+               A5B81CB01FAA44620037D1E6 /* InspectorMemoryAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C8D1FAA44260037D1E6 /* InspectorMemoryAgent.h */; };
+               A5B81CB11FAA44620037D1E6 /* InspectorNetworkAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C941FAA44260037D1E6 /* InspectorNetworkAgent.h */; };
+               A5B81CB21FAA44620037D1E6 /* InspectorPageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C891FAA44260037D1E6 /* InspectorPageAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5B81CB31FAA44620037D1E6 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C8B1FAA44260037D1E6 /* InspectorTimelineAgent.h */; };
+               A5B81CB41FAA44620037D1E6 /* InspectorWorkerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C8A1FAA44260037D1E6 /* InspectorWorkerAgent.h */; };
+               A5B81CB51FAA44620037D1E6 /* WebConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C8E1FAA44260037D1E6 /* WebConsoleAgent.h */; };
+               A5B81CB61FAA44620037D1E6 /* WebDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C9B1FAA44260037D1E6 /* WebDebuggerAgent.h */; };
+               A5B81CB71FAA44620037D1E6 /* WebHeapAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81C9F1FAA44260037D1E6 /* WebHeapAgent.h */; };
+               A5B81CC21FAA44BC0037D1E6 /* PageConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CBB1FAA44B70037D1E6 /* PageConsoleAgent.h */; };
+               A5B81CC31FAA44BC0037D1E6 /* PageDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CBE1FAA44B70037D1E6 /* PageDebuggerAgent.h */; };
+               A5B81CC41FAA44BC0037D1E6 /* PageHeapAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CBC1FAA44B70037D1E6 /* PageHeapAgent.h */; };
+               A5B81CC51FAA44BC0037D1E6 /* PageRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CBF1FAA44B70037D1E6 /* PageRuntimeAgent.h */; };
+               A5B81CCD1FAA44DE0037D1E6 /* WorkerConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CCA1FAA44DA0037D1E6 /* WorkerConsoleAgent.h */; };
+               A5B81CCE1FAA44DE0037D1E6 /* WorkerDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CCC1FAA44DA0037D1E6 /* WorkerDebuggerAgent.h */; };
+               A5B81CCF1FAA44DE0037D1E6 /* WorkerRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5B81CC91FAA44DA0037D1E6 /* WorkerRuntimeAgent.h */; };
</ins><span class="cx">           A5CE9F3F1E4C4174001BBE7C /* ResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = A5CE9F3C1E4BC586001BBE7C /* ResourceTiming.h */; };
</span><span class="cx">          A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */; };
</span><del>-               A5E2123C1E4924A400CE1044 /* WebHeapAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E2123A1E49249200CE1044 /* WebHeapAgent.h */; };
-               A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E616721894581F009ADF50 /* WebDebuggerAgent.h */; };
</del><span class="cx">           A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F36D3918F758720054C024 /* PageScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */; };
</span><del>-               A5F8CD121D18F32E00AC0E53 /* PageHeapAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F8CD111D18EEC300AC0E53 /* PageHeapAgent.h */; };
</del><span class="cx">           A6148A7912E41E3B0044A784 /* JSHTMLKeygenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */; };
</span><span class="cx">          A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = A6D169631346B4C1000EB770 /* ShadowRoot.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          A6D5A99C1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6D5A99A1629D6FF00297330 /* ScrollingTreeScrollingNodeDelegate.cpp */; };
</span><span class="lines">@@ -3441,7 +3446,6 @@
</span><span class="cx">          B6D9D23514EABD260090D75E /* FocusEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D9D23314EABD260090D75E /* FocusEvent.h */; };
</span><span class="cx">          B6D9D27B14EAC0860090D75E /* JSFocusEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D9D27914EAC0860090D75E /* JSFocusEvent.h */; };
</span><span class="cx">          B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B776D43A1104525D00BEB0EC /* PrintContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */; settings = {ATTRIBUTES = (); }; };
</del><span class="cx">           B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B8DBDB48130B0F8A00F5CDB1 /* SetSelectionCommand.h */; };
</span><span class="cx">          B8DBDB4E130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B8DBDB4A130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h */; };
</span><span class="cx">          BC00F0150E0A189500FD04E3 /* JSFile.h in Headers */ = {isa = PBXBuildFile; fileRef = BC00F0110E0A189500FD04E3 /* JSFile.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -4596,12 +4600,8 @@
</span><span class="cx">          F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F12171F416A8BC63000053CA /* WebVTTElement.h */; };
</span><span class="cx">          F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               F34742DD134362F000531BC2 /* PageDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F34742DB134362F000531BC2 /* PageDebuggerAgent.h */; };
-               F3820893147D35F90010BC06 /* PageConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F382088B147D35F90010BC06 /* PageConsoleAgent.h */; };
-               F3820895147D35F90010BC06 /* PageRuntimeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F382088D147D35F90010BC06 /* PageRuntimeAgent.h */; };
</del><span class="cx">           F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */ = {isa = PBXBuildFile; fileRef = F3ABFE0B130E9DA000E7F7D1 /* InstrumentingAgents.h */; };
</span><span class="cx">          F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSErrorHandler.h */; };
</span><del>-               F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */; };
</del><span class="cx">           F433E9031DBBDBA200EF0D14 /* StaticPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          F44EBBD91DB5D21400277334 /* StaticRange.h in Headers */ = {isa = PBXBuildFile; fileRef = F44EBBD81DB5D21400277334 /* StaticRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          F45C231E1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h in Headers */ = {isa = PBXBuildFile; fileRef = F45C231C1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -7448,8 +7448,6 @@
</span><span class="cx">          4E1959260A39DACC00220FE5 /* MediaQueryEvaluator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaQueryEvaluator.h; sourceTree = "<group>"; };
</span><span class="cx">          4F1534DD11B532EC0021FD86 /* EditingBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehavior.h; sourceTree = "<group>"; };
</span><span class="cx">          4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehaviorTypes.h; sourceTree = "<group>"; };
</span><del>-               4F6FDD621341DEDD001F8EE3 /* InspectorPageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorPageAgent.cpp; sourceTree = "<group>"; };
-               4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorPageAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           4FA65A691108ABED002615E0 /* MathMLSpaceElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLSpaceElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">          4FA65A6A1108ABED002615E0 /* MathMLSpaceElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLSpaceElement.h; sourceTree = "<group>"; };
</span><span class="cx">          4FAB48641643A66D00F70C07 /* ElementRareData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ElementRareData.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8443,8 +8441,6 @@
</span><span class="cx">          697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySVGElement.h; sourceTree = "<group>"; };
</span><span class="cx">          6A22E86F1F10418600F546C3 /* InspectorCanvas.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InspectorCanvas.h; sourceTree = "<group>"; };
</span><span class="cx">          6A22E8721F1042C400F546C3 /* InspectorCanvas.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCanvas.cpp; sourceTree = "<group>"; };
</span><del>-               6A4B6D6419D22519006F11D3 /* InspectorCanvasAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCanvasAgent.h; sourceTree = "<group>"; };
-               6A4B6D6619D225D8006F11D3 /* InspectorCanvasAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCanvasAgent.cpp; sourceTree = "<group>"; };
</del><span class="cx">           6A7279881F16C29B003F39B8 /* InspectorShaderProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorShaderProgram.h; sourceTree = "<group>"; };
</span><span class="cx">          6A7279891F16C29B003F39B8 /* InspectorShaderProgram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorShaderProgram.cpp; sourceTree = "<group>"; };
</span><span class="cx">          6B3480920EEF50D400AC1B41 /* NativeImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImage.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -8673,8 +8669,6 @@
</span><span class="cx">          71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; };
</span><span class="cx">          71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; };
</span><span class="cx">          71B0460A1DD3C2EE00EE19CF /* status-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "status-support.js"; sourceTree = "<group>"; };
</span><del>-               71B1E123164048CC00B1880A /* InspectorLayerTreeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorLayerTreeAgent.cpp; sourceTree = "<group>"; };
-               71B1E124164048CC00B1880A /* InspectorLayerTreeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorLayerTreeAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInterfaceLayoutDirection.h; sourceTree = "<group>"; };
</span><span class="cx">          71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedEnumeration.cpp; sourceTree = "<group>"; };
</span><span class="cx">          71D02D901DB55C4E00DD5CF5 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.js; sourceTree = "<group>"; };
</span><span class="lines">@@ -8773,8 +8767,6 @@
</span><span class="cx">          72F1ADA11A3904C300014E18 /* EXTFragDepth.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTFragDepth.idl; sourceTree = "<group>"; };
</span><span class="cx">          72F1ADA31A390B9F00014E18 /* JSEXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTFragDepth.cpp; sourceTree = "<group>"; };
</span><span class="cx">          72F1ADA41A390B9F00014E18 /* JSEXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTFragDepth.h; sourceTree = "<group>"; };
</span><del>-               754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
-               754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
</del><span class="cx">           7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineRecordFactory.h; sourceTree = "<group>"; };
</span><span class="cx">          7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineRecordFactory.cpp; sourceTree = "<group>"; };
</span><span class="cx">          75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MessageEvent.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8867,8 +8859,6 @@
</span><span class="cx">          7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInspectorFrontendHost.h; sourceTree = "<group>"; };
</span><span class="cx">          7A1D7FCA18F85F0F00C385AD /* English */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = English; path = English.lproj/mediaControlsLocalizedStrings.js; sourceTree = SOURCE_ROOT; };
</span><span class="cx">          7A1F2B51126C61B20006A7E6 /* InspectorClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorClient.cpp; sourceTree = "<group>"; };
</span><del>-               7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMAgent.cpp; sourceTree = "<group>"; };
-               7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           7A29BA67187B732200F29CEB /* TemporaryOpenGLSetting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemporaryOpenGLSetting.h; sourceTree = "<group>"; };
</span><span class="cx">          7A29BA69187B781C00F29CEB /* TemporaryOpenGLSetting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TemporaryOpenGLSetting.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7A29F57118C69514004D0F81 /* OutOfBandTextTrackPrivateAVF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OutOfBandTextTrackPrivateAVF.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -8883,8 +8873,6 @@
</span><span class="cx">          7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; };
</span><span class="cx">          7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = InspectorOverlayPage.html; sourceTree = "<group>"; };
</span><del>-               7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageAgent.cpp; sourceTree = "<group>"; };
-               7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           7A929CA11C598378004DF226 /* ResourceLoadStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatistics.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatistics.h; sourceTree = "<group>"; };
</span><span class="cx">          7A93868218DCC14500B8263D /* VTTScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTTScanner.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8901,10 +8889,6 @@
</span><span class="cx">          7AABA25814BC613300AA9A11 /* DOMEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMEditor.h; sourceTree = "<group>"; };
</span><span class="cx">          7AAFE8CD19CB8672000F56D8 /* ScrollLatchingState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollLatchingState.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7AAFE8CE19CB8672000F56D8 /* ScrollLatchingState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLatchingState.h; sourceTree = "<group>"; };
</span><del>-               7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseAgent.cpp; sourceTree = "<group>"; };
-               7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseAgent.h; sourceTree = "<group>"; };
-               7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorIndexedDBAgent.cpp; sourceTree = "<group>"; };
-               7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorIndexedDBAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
</span><span class="cx">          7AE335EF1ACB09E200E401EF /* WheelEventTestTrigger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WheelEventTestTrigger.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7AE335F01ACB09E200E401EF /* WheelEventTestTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WheelEventTestTrigger.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -9347,12 +9331,8 @@
</span><span class="cx">          81BE20A811F4B66F00915DFA /* JSIDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBCursor.h; sourceTree = "<group>"; };
</span><span class="cx">          81F65FF513788FAA00FF6F2D /* DragState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragState.h; sourceTree = "<group>"; };
</span><span class="cx">          8225432CA9D4B4CF4628EC7F /* JSBeforeUnloadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBeforeUnloadEvent.cpp; sourceTree = "<group>"; };
</span><del>-               82AB1741124B99EC00C5069D /* InspectorCSSAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCSSAgent.cpp; sourceTree = "<group>"; };
-               82AB1742124B99EC00C5069D /* InspectorCSSAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCSSAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorStyleSheet.cpp; sourceTree = "<group>"; };
</span><span class="cx">          82AB1770125C826700C5069D /* InspectorStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorStyleSheet.h; sourceTree = "<group>"; };
</span><del>-               82AB1771125C826700C5069D /* InspectorNetworkAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorNetworkAgent.cpp; sourceTree = "<group>"; };
-               82AB1772125C826700C5069D /* InspectorNetworkAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorNetworkAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           82E3D8DC122EA0D1003AE5BC /* CSSPropertySourceData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertySourceData.cpp; sourceTree = "<group>"; };
</span><span class="cx">          82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertySourceData.h; sourceTree = "<group>"; };
</span><span class="cx">          830030F31B7D33A600ED3AAC /* GenericCachedHTMLCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GenericCachedHTMLCollection.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -10688,8 +10668,6 @@
</span><span class="cx">          A456FA2411AD4A830020B420 /* LabelsNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LabelsNodeList.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A456FA2511AD4A830020B420 /* LabelsNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelsNodeList.h; sourceTree = "<group>"; };
</span><span class="cx">          A501920C132EBF2E008BFE55 /* Autocapitalize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Autocapitalize.h; sourceTree = "<group>"; };
</span><del>-               A5071E7E1C5067A0009951BE /* InspectorMemoryAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorMemoryAgent.cpp; sourceTree = "<group>"; };
-               A5071E7F1C5067A0009951BE /* InspectorMemoryAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorMemoryAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           A5071E821C56D079009951BE /* ResourceUsageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceUsageData.h; sourceTree = "<group>"; };
</span><span class="cx">          A5071E831C56D079009951BE /* ResourceUsageThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceUsageThread.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A5071E841C56D079009951BE /* ResourceUsageThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceUsageThread.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -10699,15 +10677,9 @@
</span><span class="cx">          A516E8B5136E04DB0076C3C0 /* LocalizedDateCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalizedDateCache.mm; sourceTree = "<group>"; };
</span><span class="cx">          A518225417E2A0D400A9BA1D /* InspectorOverlayPage.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = InspectorOverlayPage.css; sourceTree = "<group>"; };
</span><span class="cx">          A518225517E2A0D400A9BA1D /* InspectorOverlayPage.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = InspectorOverlayPage.js; sourceTree = "<group>"; };
</span><del>-               A52A685F1DBB0F5B0083373F /* WorkerConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerConsoleAgent.cpp; sourceTree = "<group>"; };
-               A52A68601DBB0F5B0083373F /* WorkerConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerConsoleAgent.h; sourceTree = "<group>"; };
-               A52A68631DBD4B580083373F /* WorkerDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerDebuggerAgent.cpp; sourceTree = "<group>"; };
-               A52A68641DBD4B580083373F /* WorkerDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerDebuggerAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           A52B349C1FA416F8008B6246 /* WorkerDebuggerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerDebuggerProxy.h; sourceTree = "<group>"; };
</span><span class="cx">          A5416FE318810EF80009FC5F /* YouTubeEmbedShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YouTubeEmbedShadowElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A5416FE418810EF80009FC5F /* YouTubeEmbedShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YouTubeEmbedShadowElement.h; sourceTree = "<group>"; };
</span><del>-               A54A0C5B1DB6D9B10017A90B /* InspectorWorkerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorWorkerAgent.cpp; sourceTree = "<group>"; };
-               A54A0C5C1DB6D9B10017A90B /* InspectorWorkerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWorkerAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           A54A0C5F1DB7F8B70017A90B /* WorkerInspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerInspectorController.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A54A0C601DB7F8B70017A90B /* WorkerInspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerInspectorController.h; sourceTree = "<group>"; };
</span><span class="cx">          A54A0C631DB805320017A90B /* WorkerScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerScriptDebugServer.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -10719,8 +10691,6 @@
</span><span class="cx">          A554B5F11E383936001D4E03 /* PerformanceUserTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceUserTiming.h; sourceTree = "<group>"; };
</span><span class="cx">          A55639CF1C6EFD5900806D8E /* WorkerConsoleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerConsoleClient.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A55639D01C6EFD5900806D8E /* WorkerConsoleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerConsoleClient.h; sourceTree = "<group>"; };
</span><del>-               A56C5B98189F34570082D13C /* WebConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebConsoleAgent.cpp; sourceTree = "<group>"; };
-               A56C5B99189F34570082D13C /* WebConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebConsoleAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A5732B09136A161D005C8D7C /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
</span><span class="cx">          A578F4321DE00ED6003DFC6A /* PromiseRejectionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PromiseRejectionEvent.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -10730,8 +10700,6 @@
</span><span class="cx">          A578F43A1DE013FB003DFC6A /* JSPromiseRejectionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPromiseRejectionEvent.h; sourceTree = "<group>"; };
</span><span class="cx">          A578F43D1DE0B62B003DFC6A /* RejectedPromiseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RejectedPromiseTracker.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A578F43E1DE0B62B003DFC6A /* RejectedPromiseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RejectedPromiseTracker.h; sourceTree = "<group>"; };
</span><del>-               A57FD7191DB94236006AE24B /* WorkerRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerRuntimeAgent.cpp; sourceTree = "<group>"; };
-               A57FD71A1DB94236006AE24B /* WorkerRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerRuntimeAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           A5840E1A187B74D500843B10 /* InspectorInstrumentationCookie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentationCookie.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A5840E1B187B74D500843B10 /* InspectorInstrumentationCookie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentationCookie.h; sourceTree = "<group>"; };
</span><span class="cx">          A5840E22187B8AC200843B10 /* WebInjectedScriptHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInjectedScriptHost.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -10771,6 +10739,54 @@
</span><span class="cx">          A5A993471E380999005B5E4D /* JSPerformanceObserverEntryList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPerformanceObserverEntryList.h; sourceTree = "<group>"; };
</span><span class="cx">          A5AFB34D115151A700B045CB /* StepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StepRange.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = "<group>"; };
</span><ins>+               A5B81C851FAA44260037D1E6 /* InspectorMemoryAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorMemoryAgent.cpp; path = inspector/agents/InspectorMemoryAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C861FAA44260037D1E6 /* InspectorDOMAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorDOMAgent.h; path = inspector/agents/InspectorDOMAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C871FAA44260037D1E6 /* WebHeapAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebHeapAgent.cpp; path = inspector/agents/WebHeapAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C881FAA44260037D1E6 /* InspectorDOMDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorDOMDebuggerAgent.cpp; path = inspector/agents/InspectorDOMDebuggerAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C891FAA44260037D1E6 /* InspectorPageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorPageAgent.h; path = inspector/agents/InspectorPageAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C8A1FAA44260037D1E6 /* InspectorWorkerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorWorkerAgent.h; path = inspector/agents/InspectorWorkerAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C8B1FAA44260037D1E6 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorTimelineAgent.h; path = inspector/agents/InspectorTimelineAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C8C1FAA44260037D1E6 /* InspectorDOMStorageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorDOMStorageAgent.h; path = inspector/agents/InspectorDOMStorageAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C8D1FAA44260037D1E6 /* InspectorMemoryAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorMemoryAgent.h; path = inspector/agents/InspectorMemoryAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C8E1FAA44260037D1E6 /* WebConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebConsoleAgent.h; path = inspector/agents/WebConsoleAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C8F1FAA44260037D1E6 /* InspectorLayerTreeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorLayerTreeAgent.h; path = inspector/agents/InspectorLayerTreeAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C901FAA44260037D1E6 /* InspectorDOMAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorDOMAgent.cpp; path = inspector/agents/InspectorDOMAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C911FAA44260037D1E6 /* InspectorCanvasAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorCanvasAgent.h; path = inspector/agents/InspectorCanvasAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C921FAA44260037D1E6 /* InspectorCSSAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorCSSAgent.cpp; path = inspector/agents/InspectorCSSAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C931FAA44260037D1E6 /* InspectorDatabaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorDatabaseAgent.h; path = inspector/agents/InspectorDatabaseAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C941FAA44260037D1E6 /* InspectorNetworkAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorNetworkAgent.h; path = inspector/agents/InspectorNetworkAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C951FAA44260037D1E6 /* InspectorPageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorPageAgent.cpp; path = inspector/agents/InspectorPageAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C961FAA44260037D1E6 /* InspectorCanvasAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorCanvasAgent.cpp; path = inspector/agents/InspectorCanvasAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C971FAA44260037D1E6 /* InspectorApplicationCacheAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorApplicationCacheAgent.h; path = inspector/agents/InspectorApplicationCacheAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C981FAA44260037D1E6 /* InspectorWorkerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorWorkerAgent.cpp; path = inspector/agents/InspectorWorkerAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C991FAA44260037D1E6 /* WebConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebConsoleAgent.cpp; path = inspector/agents/WebConsoleAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C9A1FAA44260037D1E6 /* InspectorDOMStorageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorDOMStorageAgent.cpp; path = inspector/agents/InspectorDOMStorageAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C9B1FAA44260037D1E6 /* WebDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebDebuggerAgent.h; path = inspector/agents/WebDebuggerAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C9C1FAA44260037D1E6 /* InspectorNetworkAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorNetworkAgent.cpp; path = inspector/agents/InspectorNetworkAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C9D1FAA44260037D1E6 /* InspectorIndexedDBAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorIndexedDBAgent.cpp; path = inspector/agents/InspectorIndexedDBAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81C9E1FAA44260037D1E6 /* InspectorIndexedDBAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorIndexedDBAgent.h; path = inspector/agents/InspectorIndexedDBAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81C9F1FAA44260037D1E6 /* WebHeapAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebHeapAgent.h; path = inspector/agents/WebHeapAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81CA01FAA44270037D1E6 /* InspectorApplicationCacheAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorApplicationCacheAgent.cpp; path = inspector/agents/InspectorApplicationCacheAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81CA11FAA44270037D1E6 /* InspectorCSSAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorCSSAgent.h; path = inspector/agents/InspectorCSSAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81CA21FAA44270037D1E6 /* WebDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebDebuggerAgent.cpp; path = inspector/agents/WebDebuggerAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81CA31FAA44270037D1E6 /* InspectorDOMDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorDOMDebuggerAgent.h; path = inspector/agents/InspectorDOMDebuggerAgent.h; sourceTree = SOURCE_ROOT; };
+               A5B81CA41FAA44270037D1E6 /* InspectorLayerTreeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorLayerTreeAgent.cpp; path = inspector/agents/InspectorLayerTreeAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81CA51FAA44270037D1E6 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorDatabaseAgent.cpp; path = inspector/agents/InspectorDatabaseAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81CA61FAA44270037D1E6 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InspectorTimelineAgent.cpp; path = inspector/agents/InspectorTimelineAgent.cpp; sourceTree = SOURCE_ROOT; };
+               A5B81CBA1FAA44B70037D1E6 /* PageHeapAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageHeapAgent.cpp; sourceTree = "<group>"; };
+               A5B81CBB1FAA44B70037D1E6 /* PageConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageConsoleAgent.h; sourceTree = "<group>"; };
+               A5B81CBC1FAA44B70037D1E6 /* PageHeapAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageHeapAgent.h; sourceTree = "<group>"; };
+               A5B81CBD1FAA44B70037D1E6 /* PageDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageDebuggerAgent.cpp; sourceTree = "<group>"; };
+               A5B81CBE1FAA44B70037D1E6 /* PageDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageDebuggerAgent.h; sourceTree = "<group>"; };
+               A5B81CBF1FAA44B70037D1E6 /* PageRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageRuntimeAgent.h; sourceTree = "<group>"; };
+               A5B81CC01FAA44B70037D1E6 /* PageConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageConsoleAgent.cpp; sourceTree = "<group>"; };
+               A5B81CC11FAA44B70037D1E6 /* PageRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageRuntimeAgent.cpp; sourceTree = "<group>"; };
+               A5B81CC71FAA44DA0037D1E6 /* WorkerRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerRuntimeAgent.cpp; sourceTree = "<group>"; };
+               A5B81CC81FAA44DA0037D1E6 /* WorkerDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerDebuggerAgent.cpp; sourceTree = "<group>"; };
+               A5B81CC91FAA44DA0037D1E6 /* WorkerRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerRuntimeAgent.h; sourceTree = "<group>"; };
+               A5B81CCA1FAA44DA0037D1E6 /* WorkerConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerConsoleAgent.h; sourceTree = "<group>"; };
+               A5B81CCB1FAA44DA0037D1E6 /* WorkerConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerConsoleAgent.cpp; sourceTree = "<group>"; };
+               A5B81CCC1FAA44DA0037D1E6 /* WorkerDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerDebuggerAgent.h; sourceTree = "<group>"; };
</ins><span class="cx">           A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyEventCocoa.h; sourceTree = "<group>"; };
</span><span class="cx">          A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyEventCocoa.mm; sourceTree = "<group>"; };
</span><span class="cx">          A5CE9F3C1E4BC586001BBE7C /* ResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceTiming.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -10778,15 +10794,9 @@
</span><span class="cx">          A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPlaybackTargetAvailabilityEvent.h; sourceTree = "<group>"; };
</span><span class="cx">          A5DEBDA116FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitPlaybackTargetAvailabilityEvent.idl; sourceTree = "<group>"; };
</span><del>-               A5E212391E49249200CE1044 /* WebHeapAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebHeapAgent.cpp; sourceTree = "<group>"; };
-               A5E2123A1E49249200CE1044 /* WebHeapAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHeapAgent.h; sourceTree = "<group>"; };
-               A5E616711894581F009ADF50 /* WebDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDebuggerAgent.cpp; sourceTree = "<group>"; };
-               A5E616721894581F009ADF50 /* WebDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDebuggerAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           A5F36D3818F758720054C024 /* PageScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageScriptDebugServer.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A5F36D3918F758720054C024 /* PageScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageScriptDebugServer.h; sourceTree = "<group>"; };
</span><span class="cx">          A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autocapitalize.cpp; sourceTree = "<group>"; };
</span><del>-               A5F8CD101D18EEC300AC0E53 /* PageHeapAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageHeapAgent.cpp; sourceTree = "<group>"; };
-               A5F8CD111D18EEC300AC0E53 /* PageHeapAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageHeapAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           A6148A7612E41E3B0044A784 /* JSHTMLKeygenElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLKeygenElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLKeygenElement.h; sourceTree = "<group>"; };
</span><span class="cx">          A6148A7F12E41ED10044A784 /* HTMLKeygenElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLKeygenElement.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -12069,8 +12079,6 @@
</span><span class="cx">          B6D9D27A14EAC0860090D75E /* JSFocusEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFocusEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">          B776D43A1104525D00BEB0EC /* PrintContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintContext.h; sourceTree = "<group>"; };
</span><span class="cx">          B776D43C1104527500BEB0EC /* PrintContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintContext.cpp; sourceTree = "<group>"; };
</span><del>-               B885E8D211E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorApplicationCacheAgent.cpp; sourceTree = "<group>"; };
-               B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorApplicationCacheAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           B8DBDB47130B0F8A00F5CDB1 /* SetSelectionCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SetSelectionCommand.cpp; sourceTree = "<group>"; };
</span><span class="cx">          B8DBDB48130B0F8A00F5CDB1 /* SetSelectionCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetSelectionCommand.h; sourceTree = "<group>"; };
</span><span class="cx">          B8DBDB49130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpellingCorrectionCommand.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -13903,18 +13911,10 @@
</span><span class="cx">          F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClient.h; sourceTree = "<group>"; };
</span><span class="cx">          F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClientLocal.h; sourceTree = "<group>"; };
</span><span class="cx">          F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontendClientLocal.cpp; sourceTree = "<group>"; };
</span><del>-               F34742DA134362F000531BC2 /* PageDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageDebuggerAgent.cpp; sourceTree = "<group>"; };
-               F34742DB134362F000531BC2 /* PageDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageDebuggerAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           F350B73413F1377D00880C43 /* InstrumentingAgents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InstrumentingAgents.cpp; sourceTree = "<group>"; };
</span><del>-               F382088A147D35F90010BC06 /* PageConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageConsoleAgent.cpp; sourceTree = "<group>"; };
-               F382088B147D35F90010BC06 /* PageConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageConsoleAgent.h; sourceTree = "<group>"; };
-               F382088C147D35F90010BC06 /* PageRuntimeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageRuntimeAgent.cpp; sourceTree = "<group>"; };
-               F382088D147D35F90010BC06 /* PageRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageRuntimeAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           F3ABFE0B130E9DA000E7F7D1 /* InstrumentingAgents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstrumentingAgents.h; sourceTree = "<group>"; };
</span><span class="cx">          F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorHandler.cpp; sourceTree = "<group>"; };
</span><span class="cx">          F3D461471161D53200CA0D09 /* JSErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorHandler.h; sourceTree = "<group>"; };
</span><del>-               F3D4C47612E07663003DA150 /* InspectorDOMDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMDebuggerAgent.cpp; sourceTree = "<group>"; };
-               F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMDebuggerAgent.h; sourceTree = "<group>"; };
</del><span class="cx">           F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPasteboard.h; sourceTree = "<group>"; };
</span><span class="cx">          F433E9041DBBDBC200EF0D14 /* StaticPasteboard.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StaticPasteboard.cpp; sourceTree = "<group>"; };
</span><span class="cx">          F44EBBD61DB5D1B600277334 /* StaticRange.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StaticRange.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -15584,6 +15584,7 @@
</span><span class="cx">          1C81B94D0E9732D900266E07 /* inspector */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               A5B81C831FAA44060037D1E6 /* agents */,
</ins><span class="cx">                           A584FE311864D5AF00843B10 /* CommandLineAPIHost.cpp */,
</span><span class="cx">                          A584FE321864D5AF00843B10 /* CommandLineAPIHost.h */,
</span><span class="cx">                          A584FE331864D5AF00843B10 /* CommandLineAPIHost.idl */,
</span><span class="lines">@@ -15594,28 +15595,14 @@
</span><span class="cx">                          7AABA25814BC613300AA9A11 /* DOMEditor.h */,
</span><span class="cx">                          7A54881614E432A1006AE05A /* DOMPatchSupport.cpp */,
</span><span class="cx">                          7A54881514E432A1006AE05A /* DOMPatchSupport.h */,
</span><del>-                               B885E8D211E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp */,
-                               B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */,
</del><span class="cx">                           6A22E8721F1042C400F546C3 /* InspectorCanvas.cpp */,
</span><span class="cx">                          6A22E86F1F10418600F546C3 /* InspectorCanvas.h */,
</span><del>-                               6A4B6D6619D225D8006F11D3 /* InspectorCanvasAgent.cpp */,
-                               6A4B6D6419D22519006F11D3 /* InspectorCanvasAgent.h */,
</del><span class="cx">                           7A1F2B51126C61B20006A7E6 /* InspectorClient.cpp */,
</span><span class="cx">                          1C81B9580E97330800266E07 /* InspectorClient.h */,
</span><span class="cx">                          1C81B9570E97330800266E07 /* InspectorController.cpp */,
</span><span class="cx">                          1C81B9560E97330800266E07 /* InspectorController.h */,
</span><del>-                               82AB1741124B99EC00C5069D /* InspectorCSSAgent.cpp */,
-                               82AB1742124B99EC00C5069D /* InspectorCSSAgent.h */,
-                               7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */,
-                               7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */,
</del><span class="cx">                           41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */,
</span><span class="cx">                          41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */,
</span><del>-                               7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */,
-                               7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */,
-                               F3D4C47612E07663003DA150 /* InspectorDOMDebuggerAgent.cpp */,
-                               F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */,
-                               7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */,
-                               7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */,
</del><span class="cx">                           F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */,
</span><span class="cx">                          F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */,
</span><span class="cx">                          F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */,
</span><span class="lines">@@ -15624,18 +15611,10 @@
</span><span class="cx">                          7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */,
</span><span class="cx">                          7A54857D14E02D51006AE05A /* InspectorHistory.cpp */,
</span><span class="cx">                          7A54857E14E02D51006AE05A /* InspectorHistory.h */,
</span><del>-                               7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */,
-                               7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */,
</del><span class="cx">                           20D629241253690B00081543 /* InspectorInstrumentation.cpp */,
</span><span class="cx">                          20D629251253690B00081543 /* InspectorInstrumentation.h */,
</span><span class="cx">                          A5840E1A187B74D500843B10 /* InspectorInstrumentationCookie.cpp */,
</span><span class="cx">                          A5840E1B187B74D500843B10 /* InspectorInstrumentationCookie.h */,
</span><del>-                               71B1E123164048CC00B1880A /* InspectorLayerTreeAgent.cpp */,
-                               71B1E124164048CC00B1880A /* InspectorLayerTreeAgent.h */,
-                               A5071E7E1C5067A0009951BE /* InspectorMemoryAgent.cpp */,
-                               A5071E7F1C5067A0009951BE /* InspectorMemoryAgent.h */,
-                               82AB1771125C826700C5069D /* InspectorNetworkAgent.cpp */,
-                               82AB1772125C826700C5069D /* InspectorNetworkAgent.h */,
</del><span class="cx">                           504AACCB1834455900E3D9BC /* InspectorNodeFinder.cpp */,
</span><span class="cx">                          504AACCC1834455900E3D9BC /* InspectorNodeFinder.h */,
</span><span class="cx">                          7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */,
</span><span class="lines">@@ -15643,52 +15622,26 @@
</span><span class="cx">                          A518225417E2A0D400A9BA1D /* InspectorOverlayPage.css */,
</span><span class="cx">                          7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */,
</span><span class="cx">                          A518225517E2A0D400A9BA1D /* InspectorOverlayPage.js */,
</span><del>-                               4F6FDD621341DEDD001F8EE3 /* InspectorPageAgent.cpp */,
-                               4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */,
</del><span class="cx">                           6A7279891F16C29B003F39B8 /* InspectorShaderProgram.cpp */,
</span><span class="cx">                          6A7279881F16C29B003F39B8 /* InspectorShaderProgram.h */,
</span><span class="cx">                          82AB176F125C826700C5069D /* InspectorStyleSheet.cpp */,
</span><span class="cx">                          82AB1770125C826700C5069D /* InspectorStyleSheet.h */,
</span><del>-                               754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */,
-                               754133A7102E00E800075D00 /* InspectorTimelineAgent.h */,
</del><span class="cx">                           A593CF8A1840535200BFCE27 /* InspectorWebAgentBase.h */,
</span><del>-                               A54A0C5B1DB6D9B10017A90B /* InspectorWorkerAgent.cpp */,
-                               A54A0C5C1DB6D9B10017A90B /* InspectorWorkerAgent.h */,
</del><span class="cx">                           F350B73413F1377D00880C43 /* InstrumentingAgents.cpp */,
</span><span class="cx">                          F3ABFE0B130E9DA000E7F7D1 /* InstrumentingAgents.h */,
</span><span class="cx">                          59C27F04138D28C10079B7E2 /* NetworkResourcesData.cpp */,
</span><span class="cx">                          59C27F06138D28CF0079B7E2 /* NetworkResourcesData.h */,
</span><del>-                               F382088A147D35F90010BC06 /* PageConsoleAgent.cpp */,
-                               F382088B147D35F90010BC06 /* PageConsoleAgent.h */,
-                               F34742DA134362F000531BC2 /* PageDebuggerAgent.cpp */,
-                               F34742DB134362F000531BC2 /* PageDebuggerAgent.h */,
-                               A5F8CD101D18EEC300AC0E53 /* PageHeapAgent.cpp */,
-                               A5F8CD111D18EEC300AC0E53 /* PageHeapAgent.h */,
-                               F382088C147D35F90010BC06 /* PageRuntimeAgent.cpp */,
-                               F382088D147D35F90010BC06 /* PageRuntimeAgent.h */,
</del><span class="cx">                           A5F36D3818F758720054C024 /* PageScriptDebugServer.cpp */,
</span><span class="cx">                          A5F36D3918F758720054C024 /* PageScriptDebugServer.h */,
</span><span class="cx">                          91B952221F58A58000931DC2 /* RecordingSwizzleTypes.h */,
</span><span class="cx">                          7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */,
</span><span class="cx">                          7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */,
</span><del>-                               A56C5B98189F34570082D13C /* WebConsoleAgent.cpp */,
-                               A56C5B99189F34570082D13C /* WebConsoleAgent.h */,
-                               A5E616711894581F009ADF50 /* WebDebuggerAgent.cpp */,
-                               A5E616721894581F009ADF50 /* WebDebuggerAgent.h */,
-                               A5E212391E49249200CE1044 /* WebHeapAgent.cpp */,
-                               A5E2123A1E49249200CE1044 /* WebHeapAgent.h */,
</del><span class="cx">                           A5840E22187B8AC200843B10 /* WebInjectedScriptHost.cpp */,
</span><span class="cx">                          A5840E23187B8AC200843B10 /* WebInjectedScriptHost.h */,
</span><span class="cx">                          A584FE2D1864CB8400843B10 /* WebInjectedScriptManager.cpp */,
</span><span class="cx">                          A584FE2E1864CB8400843B10 /* WebInjectedScriptManager.h */,
</span><del>-                               A52A685F1DBB0F5B0083373F /* WorkerConsoleAgent.cpp */,
-                               A52A68601DBB0F5B0083373F /* WorkerConsoleAgent.h */,
-                               A52A68631DBD4B580083373F /* WorkerDebuggerAgent.cpp */,
-                               A52A68641DBD4B580083373F /* WorkerDebuggerAgent.h */,
</del><span class="cx">                           A54A0C5F1DB7F8B70017A90B /* WorkerInspectorController.cpp */,
</span><span class="cx">                          A54A0C601DB7F8B70017A90B /* WorkerInspectorController.h */,
</span><del>-                               A57FD7191DB94236006AE24B /* WorkerRuntimeAgent.cpp */,
-                               A57FD71A1DB94236006AE24B /* WorkerRuntimeAgent.h */,
</del><span class="cx">                           A54A0C631DB805320017A90B /* WorkerScriptDebugServer.cpp */,
</span><span class="cx">                          A54A0C641DB805320017A90B /* WorkerScriptDebugServer.h */,
</span><span class="cx">                          A54A0C671DB807D00017A90B /* WorkerToPageFrontendChannel.h */,
</span><span class="lines">@@ -20538,6 +20491,77 @@
</span><span class="cx">                  path = ios;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="cx">          };
</span><ins>+               A5B81C831FAA44060037D1E6 /* agents */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A5B81CB91FAA44820037D1E6 /* page */,
+                               A5B81CC61FAA44C30037D1E6 /* worker */,
+                               A5B81CA01FAA44270037D1E6 /* InspectorApplicationCacheAgent.cpp */,
+                               A5B81C971FAA44260037D1E6 /* InspectorApplicationCacheAgent.h */,
+                               A5B81C961FAA44260037D1E6 /* InspectorCanvasAgent.cpp */,
+                               A5B81C911FAA44260037D1E6 /* InspectorCanvasAgent.h */,
+                               A5B81C921FAA44260037D1E6 /* InspectorCSSAgent.cpp */,
+                               A5B81CA11FAA44270037D1E6 /* InspectorCSSAgent.h */,
+                               A5B81CA51FAA44270037D1E6 /* InspectorDatabaseAgent.cpp */,
+                               A5B81C931FAA44260037D1E6 /* InspectorDatabaseAgent.h */,
+                               A5B81C901FAA44260037D1E6 /* InspectorDOMAgent.cpp */,
+                               A5B81C861FAA44260037D1E6 /* InspectorDOMAgent.h */,
+                               A5B81C881FAA44260037D1E6 /* InspectorDOMDebuggerAgent.cpp */,
+                               A5B81CA31FAA44270037D1E6 /* InspectorDOMDebuggerAgent.h */,
+                               A5B81C9A1FAA44260037D1E6 /* InspectorDOMStorageAgent.cpp */,
+                               A5B81C8C1FAA44260037D1E6 /* InspectorDOMStorageAgent.h */,
+                               A5B81C9D1FAA44260037D1E6 /* InspectorIndexedDBAgent.cpp */,
+                               A5B81C9E1FAA44260037D1E6 /* InspectorIndexedDBAgent.h */,
+                               A5B81CA41FAA44270037D1E6 /* InspectorLayerTreeAgent.cpp */,
+                               A5B81C8F1FAA44260037D1E6 /* InspectorLayerTreeAgent.h */,
+                               A5B81C851FAA44260037D1E6 /* InspectorMemoryAgent.cpp */,
+                               A5B81C8D1FAA44260037D1E6 /* InspectorMemoryAgent.h */,
+                               A5B81C9C1FAA44260037D1E6 /* InspectorNetworkAgent.cpp */,
+                               A5B81C941FAA44260037D1E6 /* InspectorNetworkAgent.h */,
+                               A5B81C951FAA44260037D1E6 /* InspectorPageAgent.cpp */,
+                               A5B81C891FAA44260037D1E6 /* InspectorPageAgent.h */,
+                               A5B81CA61FAA44270037D1E6 /* InspectorTimelineAgent.cpp */,
+                               A5B81C8B1FAA44260037D1E6 /* InspectorTimelineAgent.h */,
+                               A5B81C981FAA44260037D1E6 /* InspectorWorkerAgent.cpp */,
+                               A5B81C8A1FAA44260037D1E6 /* InspectorWorkerAgent.h */,
+                               A5B81C991FAA44260037D1E6 /* WebConsoleAgent.cpp */,
+                               A5B81C8E1FAA44260037D1E6 /* WebConsoleAgent.h */,
+                               A5B81CA21FAA44270037D1E6 /* WebDebuggerAgent.cpp */,
+                               A5B81C9B1FAA44260037D1E6 /* WebDebuggerAgent.h */,
+                               A5B81C871FAA44260037D1E6 /* WebHeapAgent.cpp */,
+                               A5B81C9F1FAA44260037D1E6 /* WebHeapAgent.h */,
+                       );
+                       path = agents;
+                       sourceTree = "<group>";
+               };
+               A5B81CB91FAA44820037D1E6 /* page */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A5B81CC01FAA44B70037D1E6 /* PageConsoleAgent.cpp */,
+                               A5B81CBB1FAA44B70037D1E6 /* PageConsoleAgent.h */,
+                               A5B81CBD1FAA44B70037D1E6 /* PageDebuggerAgent.cpp */,
+                               A5B81CBE1FAA44B70037D1E6 /* PageDebuggerAgent.h */,
+                               A5B81CBA1FAA44B70037D1E6 /* PageHeapAgent.cpp */,
+                               A5B81CBC1FAA44B70037D1E6 /* PageHeapAgent.h */,
+                               A5B81CC11FAA44B70037D1E6 /* PageRuntimeAgent.cpp */,
+                               A5B81CBF1FAA44B70037D1E6 /* PageRuntimeAgent.h */,
+                       );
+                       path = page;
+                       sourceTree = "<group>";
+               };
+               A5B81CC61FAA44C30037D1E6 /* worker */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A5B81CCB1FAA44DA0037D1E6 /* WorkerConsoleAgent.cpp */,
+                               A5B81CCA1FAA44DA0037D1E6 /* WorkerConsoleAgent.h */,
+                               A5B81CC81FAA44DA0037D1E6 /* WorkerDebuggerAgent.cpp */,
+                               A5B81CCC1FAA44DA0037D1E6 /* WorkerDebuggerAgent.h */,
+                               A5B81CC71FAA44DA0037D1E6 /* WorkerRuntimeAgent.cpp */,
+                               A5B81CC91FAA44DA0037D1E6 /* WorkerRuntimeAgent.h */,
+                       );
+                       path = worker;
+                       sourceTree = "<group>";
+               };
</ins><span class="cx">           A5C974CE11485FDA0066F2AB /* cocoa */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><span class="lines">@@ -27116,36 +27140,36 @@
</span><span class="cx">                          93309DEE099E64920056E581 /* InsertNodeBeforeCommand.h in Headers */,
</span><span class="cx">                          93309DF0099E64920056E581 /* InsertParagraphSeparatorCommand.h in Headers */,
</span><span class="cx">                          93309DF2099E64920056E581 /* InsertTextCommand.h in Headers */,
</span><del>-                               B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */,
</del><ins>+                                A5B81CA71FAA44620037D1E6 /* InspectorApplicationCacheAgent.h in Headers */,
</ins><span class="cx">                           6A22E8701F10418600F546C3 /* InspectorCanvas.h in Headers */,
</span><del>-                               6A4B6D6519D22519006F11D3 /* InspectorCanvasAgent.h in Headers */,
</del><ins>+                                A5B81CA81FAA44620037D1E6 /* InspectorCanvasAgent.h in Headers */,
</ins><span class="cx">                           1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */,
</span><span class="cx">                          1C81B95A0E97330800266E07 /* InspectorController.h in Headers */,
</span><del>-                               82AB1744124B99EC00C5069D /* InspectorCSSAgent.h in Headers */,
</del><ins>+                                A5B81CA91FAA44620037D1E6 /* InspectorCSSAgent.h in Headers */,
</ins><span class="cx">                           4A9CC82116BF9BB400EC645A /* InspectorCSSOMWrappers.h in Headers */,
</span><del>-                               7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */,
</del><ins>+                                A5B81CAA1FAA44620037D1E6 /* InspectorDatabaseAgent.h in Headers */,
</ins><span class="cx">                           41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */,
</span><del>-                               7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */,
-                               F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */,
-                               7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */,
</del><ins>+                                A5B81CAB1FAA44620037D1E6 /* InspectorDOMAgent.h in Headers */,
+                               A5B81CAC1FAA44620037D1E6 /* InspectorDOMDebuggerAgent.h in Headers */,
+                               A5B81CAD1FAA44620037D1E6 /* InspectorDOMStorageAgent.h in Headers */,
</ins><span class="cx">                           F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,
</span><span class="cx">                          F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
</span><span class="cx">                          7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
</span><span class="cx">                          7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */,
</span><del>-                               7ACD88D414C08BD60084EDD2 /* InspectorIndexedDBAgent.h in Headers */,
</del><ins>+                                A5B81CAE1FAA44620037D1E6 /* InspectorIndexedDBAgent.h in Headers */,
</ins><span class="cx">                           20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */,
</span><span class="cx">                          A5840E1D187B74D500843B10 /* InspectorInstrumentationCookie.h in Headers */,
</span><del>-                               71B1E125164048F700B1880A /* InspectorLayerTreeAgent.h in Headers */,
-                               A5071E811C506B69009951BE /* InspectorMemoryAgent.h in Headers */,
-                               82AB1776125C826700C5069D /* InspectorNetworkAgent.h in Headers */,
</del><ins>+                                A5B81CAF1FAA44620037D1E6 /* InspectorLayerTreeAgent.h in Headers */,
+                               A5B81CB01FAA44620037D1E6 /* InspectorMemoryAgent.h in Headers */,
+                               A5B81CB11FAA44620037D1E6 /* InspectorNetworkAgent.h in Headers */,
</ins><span class="cx">                           504AACCE1834455900E3D9BC /* InspectorNodeFinder.h in Headers */,
</span><span class="cx">                          0F03C0751884805500A5F8CA /* InspectorOverlay.h in Headers */,
</span><del>-                               4F6FDD651341DEDD001F8EE3 /* InspectorPageAgent.h in Headers */,
</del><ins>+                                A5B81CB21FAA44620037D1E6 /* InspectorPageAgent.h in Headers */,
</ins><span class="cx">                           6A72798B1F16C29C003F39B8 /* InspectorShaderProgram.h in Headers */,
</span><span class="cx">                          82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
</span><del>-                               754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
</del><ins>+                                A5B81CB31FAA44620037D1E6 /* InspectorTimelineAgent.h in Headers */,
</ins><span class="cx">                           A593CF8B1840535200BFCE27 /* InspectorWebAgentBase.h in Headers */,
</span><del>-                               A54A0C5E1DB6D9C40017A90B /* InspectorWorkerAgent.h in Headers */,
</del><ins>+                                A5B81CB41FAA44620037D1E6 /* InspectorWorkerAgent.h in Headers */,
</ins><span class="cx">                           F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */,
</span><span class="cx">                          0F4710DC1DB6FE22002DCEC3 /* IntersectionObserver.h in Headers */,
</span><span class="cx">                          0F8B45721DC3FBA300443C3F /* IntersectionObserverCallback.h in Headers */,
</span><span class="lines">@@ -28302,17 +28326,17 @@
</span><span class="cx">                          65A21468097A329100B9050A /* Page.h in Headers */,
</span><span class="cx">                          1477E7770BF4134A00152872 /* PageCache.h in Headers */,
</span><span class="cx">                          CD5E5B5F1A15CE54000C609E /* PageConfiguration.h in Headers */,
</span><del>-                               F3820893147D35F90010BC06 /* PageConsoleAgent.h in Headers */,
</del><ins>+                                A5B81CC21FAA44BC0037D1E6 /* PageConsoleAgent.h in Headers */,
</ins><span class="cx">                           DAED203116F244480070EC0F /* PageConsoleClient.h in Headers */,
</span><span class="cx">                          A5A2AF0C1829734300DE1729 /* PageDebuggable.h in Headers */,
</span><del>-                               F34742DD134362F000531BC2 /* PageDebuggerAgent.h in Headers */,
</del><ins>+                                A5B81CC31FAA44BC0037D1E6 /* PageDebuggerAgent.h in Headers */,
</ins><span class="cx">                           9302B0BF0D79F82C00C7EE83 /* PageGroup.h in Headers */,
</span><span class="cx">                          7A674BDC0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h in Headers */,
</span><del>-                               A5F8CD121D18F32E00AC0E53 /* PageHeapAgent.h in Headers */,
</del><ins>+                                A5B81CC41FAA44BC0037D1E6 /* PageHeapAgent.h in Headers */,
</ins><span class="cx">                           2D5C9D0019C7B52E00B3C5C1 /* PageOverlay.h in Headers */,
</span><span class="cx">                          2D5C9D0219C7B52E00B3C5C1 /* PageOverlayController.h in Headers */,
</span><span class="cx">                          FBDB61A116D6037E00BB3394 /* PageRuleCollector.h in Headers */,
</span><del>-                               F3820895147D35F90010BC06 /* PageRuntimeAgent.h in Headers */,
</del><ins>+                                A5B81CC51FAA44BC0037D1E6 /* PageRuntimeAgent.h in Headers */,
</ins><span class="cx">                           A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */,
</span><span class="cx">                          371E65CC13661EDC00BEEDB0 /* PageSerializer.h in Headers */,
</span><span class="cx">                          E1284AE110447D4500EAEB52 /* PageTransitionEvent.h in Headers */,
</span><span class="lines">@@ -29509,7 +29533,7 @@
</span><span class="cx">                          41B2A6261EF1BF6D002B9D7A /* WebAudioSourceProvider.h in Headers */,
</span><span class="cx">                          07D637401BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.h in Headers */,
</span><span class="cx">                          1F36EA9C1E21BA1700621E25 /* WebBackgroundTaskController.h in Headers */,
</span><del>-                               A56C5B9B189F34570082D13C /* WebConsoleAgent.h in Headers */,
</del><ins>+                                A5B81CB51FAA44620037D1E6 /* WebConsoleAgent.h in Headers */,
</ins><span class="cx">                           9BBA2CAB1F679E0C00FD1C1E /* WebContentReader.h in Headers */,
</span><span class="cx">                          419BE7591BC7F42B00E1C85B /* WebCoreBuiltinNames.h in Headers */,
</span><span class="cx">                          2D3EF44A1917915C00034184 /* WebCoreCALayerExtras.h in Headers */,
</span><span class="lines">@@ -29540,7 +29564,7 @@
</span><span class="cx">                          37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */,
</span><span class="cx">                          44A20DB90F84166C00B3E1FE /* WebCoreURLResponseIOS.h in Headers */,
</span><span class="cx">                          93F199F008245E59001E9ABC /* WebCoreView.h in Headers */,
</span><del>-                               A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */,
</del><ins>+                                A5B81CB61FAA44620037D1E6 /* WebDebuggerAgent.h in Headers */,
</ins><span class="cx">                           FE0D84E910484348001A179E /* WebEvent.h in Headers */,
</span><span class="cx">                          225A16B50D5C11E900090295 /* WebEventRegion.h in Headers */,
</span><span class="cx">                          D3F3D36E1A69B7E00059FC2B /* WebGL2RenderingContext.h in Headers */,
</span><span class="lines">@@ -29581,7 +29605,7 @@
</span><span class="cx">                          6F995A261A7078B100A735F4 /* WebGLVertexArrayObject.h in Headers */,
</span><span class="cx">                          77A17A7812F28642004E02F6 /* WebGLVertexArrayObjectOES.h in Headers */,
</span><span class="cx">                          316BDB8C1E6E153000DE0D5A /* WebGPULayer.h in Headers */,
</span><del>-                               A5E2123C1E4924A400CE1044 /* WebHeapAgent.h in Headers */,
</del><ins>+                                A5B81CB71FAA44620037D1E6 /* WebHeapAgent.h in Headers */,
</ins><span class="cx">                           A5840E25187B8AC200843B10 /* WebInjectedScriptHost.h in Headers */,
</span><span class="cx">                          A584FE301864CB8400843B10 /* WebInjectedScriptManager.h in Headers */,
</span><span class="cx">                          F48223111E3869B80066FC79 /* WebItemProviderPasteboard.h in Headers */,
</span><span class="lines">@@ -29651,9 +29675,9 @@
</span><span class="cx">                          379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */,
</span><span class="cx">                          2E4346460F546A8200B0F1BA /* Worker.h in Headers */,
</span><span class="cx">                          41A7D3531F438D16008988DE /* WorkerCacheStorageConnection.h in Headers */,
</span><del>-                               A52A68621DBB0F630083373F /* WorkerConsoleAgent.h in Headers */,
</del><ins>+                                A5B81CCD1FAA44DE0037D1E6 /* WorkerConsoleAgent.h in Headers */,
</ins><span class="cx">                           A55639D11C6F09E300806D8E /* WorkerConsoleClient.h in Headers */,
</span><del>-                               A52A68661DBD4B5D0083373F /* WorkerDebuggerAgent.h in Headers */,
</del><ins>+                                A5B81CCE1FAA44DE0037D1E6 /* WorkerDebuggerAgent.h in Headers */,
</ins><span class="cx">                           A52B349E1FA41703008B6246 /* WorkerDebuggerProxy.h in Headers */,
</span><span class="cx">                          A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */,
</span><span class="cx">                          2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */,
</span><span class="lines">@@ -29670,7 +29694,7 @@
</span><span class="cx">                          2E4346510F546A8200B0F1BA /* WorkerObjectProxy.h in Headers */,
</span><span class="cx">                          416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */,
</span><span class="cx">                          2E4346530F546A8200B0F1BA /* WorkerRunLoop.h in Headers */,
</span><del>-                               A57FD71C1DB9423E006AE24B /* WorkerRuntimeAgent.h in Headers */,
</del><ins>+                                A5B81CCF1FAA44DE0037D1E6 /* WorkerRuntimeAgent.h in Headers */,
</ins><span class="cx">                           E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */,
</span><span class="cx">                          A54A0C661DB805360017A90B /* WorkerScriptDebugServer.h in Headers */,
</span><span class="cx">                          A7D6B3490F61104500B79FD1 /* WorkerScriptLoader.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorApplicationCacheAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp        2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp   2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,183 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2015 Apple Inc. All rights reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorApplicationCacheAgent.h"
-
-#include "ApplicationCacheHost.h"
-#include "DocumentLoader.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "MainFrame.h"
-#include "NetworkStateNotifier.h"
-#include <inspector/InspectorValues.h>
-#include <wtf/text/StringBuilder.h>
-
-namespace WebCore {
-
-using namespace Inspector;
-
-InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(WebAgentContext& context, InspectorPageAgent* pageAgent)
-    : InspectorAgentBase(ASCIILiteral("ApplicationCache"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::ApplicationCacheFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::ApplicationCacheBackendDispatcher::create(context.backendDispatcher, this))
-    , m_pageAgent(pageAgent)
-{
-}
-
-void InspectorApplicationCacheAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
-{
-}
-
-void InspectorApplicationCacheAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    m_instrumentingAgents.setInspectorApplicationCacheAgent(nullptr);
-}
-
-void InspectorApplicationCacheAgent::enable(ErrorString&)
-{
-    m_instrumentingAgents.setInspectorApplicationCacheAgent(this);
-
-    // We need to pass initial navigator.onOnline.
-    networkStateChanged();
-}
-
-void InspectorApplicationCacheAgent::updateApplicationCacheStatus(Frame* frame)
-{
-    if (!frame)
-        return;
-    auto* documentLoader = frame->loader().documentLoader();
-    if (!documentLoader)
-        return;
-
-    auto& host = documentLoader->applicationCacheHost();
-    int status = host.status();
-    auto manifestURL = host.applicationCacheInfo().manifest.string();
-
-    m_frontendDispatcher->applicationCacheStatusUpdated(m_pageAgent->frameId(frame), manifestURL, status);
-}
-
-void InspectorApplicationCacheAgent::networkStateChanged()
-{
-    m_frontendDispatcher->networkStateUpdated(NetworkStateNotifier::singleton().onLine());
-}
-
-void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::FrameWithManifest>>& result)
-{
-    result = Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::FrameWithManifest>::create();
-
-    for (Frame* frame = &m_pageAgent->mainFrame(); frame; frame = frame->tree().traverseNext()) {
-        auto* documentLoader = frame->loader().documentLoader();
-        if (!documentLoader)
-            continue;
-
-        auto& host = documentLoader->applicationCacheHost();
-        String manifestURL = host.applicationCacheInfo().manifest.string();
-        if (!manifestURL.isEmpty()) {
-            result->addItem(Inspector::Protocol::ApplicationCache::FrameWithManifest::create()
-                .setFrameId(m_pageAgent->frameId(frame))
-                .setManifestURL(manifestURL)
-                .setStatus(static_cast<int>(host.status()))
-                .release());
-        }
-    }
-}
-
-DocumentLoader* InspectorApplicationCacheAgent::assertFrameWithDocumentLoader(ErrorString& errorString, const String& frameId)
-{
-    Frame* frame = m_pageAgent->assertFrame(errorString, frameId);
-    if (!frame)
-        return nullptr;
-
-    return InspectorPageAgent::assertDocumentLoader(errorString, frame);
-}
-
-void InspectorApplicationCacheAgent::getManifestForFrame(ErrorString& errorString, const String& frameId, String* manifestURL)
-{
-    DocumentLoader* documentLoader = assertFrameWithDocumentLoader(errorString, frameId);
-    if (!documentLoader)
-        return;
-
-    *manifestURL = documentLoader->applicationCacheHost().applicationCacheInfo().manifest.string();
-}
-
-void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString& errorString, const String& frameId, RefPtr<Inspector::Protocol::ApplicationCache::ApplicationCache>& applicationCache)
-{
-    auto* documentLoader = assertFrameWithDocumentLoader(errorString, frameId);
-    if (!documentLoader)
-        return;
-
-    auto& host = documentLoader->applicationCacheHost();
-    applicationCache = buildObjectForApplicationCache(host.resourceList(), host.applicationCacheInfo());
-}
-
-Ref<Inspector::Protocol::ApplicationCache::ApplicationCache> InspectorApplicationCacheAgent::buildObjectForApplicationCache(const Vector<ApplicationCacheHost::ResourceInfo>& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo)
-{
-    return Inspector::Protocol::ApplicationCache::ApplicationCache::create()
-        .setManifestURL(applicationCacheInfo.manifest.string())
-        .setSize(applicationCacheInfo.size)
-        .setCreationTime(applicationCacheInfo.creationTime)
-        .setUpdateTime(applicationCacheInfo.updateTime)
-        .setResources(buildArrayForApplicationCacheResources(applicationCacheResources))
-        .release();
-}
-
-Ref<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const Vector<ApplicationCacheHost::ResourceInfo>& applicationCacheResources)
-{
-    auto result = Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>::create();
-    for (auto& info : applicationCacheResources)
-        result->addItem(buildObjectForApplicationCacheResource(info));
-    return result;
-}
-
-Ref<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo)
-{
-    StringBuilder types;
-
-    if (resourceInfo.isMaster)
-        types.appendLiteral("Master ");
-
-    if (resourceInfo.isManifest)
-        types.appendLiteral("Manifest ");
-
-    if (resourceInfo.isFallback)
-        types.appendLiteral("Fallback ");
-
-    if (resourceInfo.isForeign)
-        types.appendLiteral("Foreign ");
-
-    if (resourceInfo.isExplicit)
-        types.appendLiteral("Explicit ");
-
-    return Inspector::Protocol::ApplicationCache::ApplicationCacheResource::create()
-        .setUrl(resourceInfo.resource.string())
-        .setSize(static_cast<int>(resourceInfo.size))
-        .setType(types.toString())
-        .release();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorApplicationCacheAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h  2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h     2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2015 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. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "ApplicationCacheHost.h"
-#include "InspectorWebAgentBase.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <wtf/Noncopyable.h>
-
-namespace Inspector {
-class ApplicationCacheFrontendDispatcher;
-class InspectorObject;
-class InspectorValue;
-}
-
-namespace WebCore {
-
-class Frame;
-class InspectorPageAgent;
-class Page;
-
-typedef String ErrorString;
-
-class InspectorApplicationCacheAgent final : public InspectorAgentBase, public Inspector::ApplicationCacheBackendDispatcherHandler {
-    WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorApplicationCacheAgent(WebAgentContext&, InspectorPageAgent*);
-    virtual ~InspectorApplicationCacheAgent() = default;
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    void updateApplicationCacheStatus(Frame*);
-    void networkStateChanged();
-
-    void enable(ErrorString&) override;
-    void getFramesWithManifests(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::FrameWithManifest>>& result) override;
-    void getManifestForFrame(ErrorString&, const String& frameId, String* manifestURL) override;
-    void getApplicationCacheForFrame(ErrorString&, const String& frameId, RefPtr<Inspector::Protocol::ApplicationCache::ApplicationCache>&) override;
-
-private:
-    Ref<Inspector::Protocol::ApplicationCache::ApplicationCache> buildObjectForApplicationCache(const Vector<ApplicationCacheHost::ResourceInfo>&, const ApplicationCacheHost::CacheInfo&);
-    Ref<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> buildArrayForApplicationCacheResources(const Vector<ApplicationCacheHost::ResourceInfo>&);
-    Ref<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
-
-    DocumentLoader* assertFrameWithDocumentLoader(ErrorString&, const String& frameId);
-
-    std::unique_ptr<Inspector::ApplicationCacheFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::ApplicationCacheBackendDispatcher> m_backendDispatcher;
-    InspectorPageAgent* m_pageAgent { nullptr };
-};
-
-} // namespace WebCore
-
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp     2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,980 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2015-2017 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. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorCSSAgent.h"
-
-#include "CSSComputedStyleDeclaration.h"
-#include "CSSImportRule.h"
-#include "CSSPropertyNames.h"
-#include "CSSPropertySourceData.h"
-#include "CSSRule.h"
-#include "CSSRuleList.h"
-#include "CSSStyleRule.h"
-#include "CSSStyleSheet.h"
-#include "ContentSecurityPolicy.h"
-#include "DOMWindow.h"
-#include "FontCache.h"
-#include "Frame.h"
-#include "HTMLHeadElement.h"
-#include "HTMLStyleElement.h"
-#include "InspectorHistory.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "Node.h"
-#include "NodeList.h"
-#include "PseudoElement.h"
-#include "SVGStyleElement.h"
-#include "SelectorChecker.h"
-#include "ShadowRoot.h"
-#include "StyleProperties.h"
-#include "StylePropertyShorthand.h"
-#include "StyleResolver.h"
-#include "StyleRule.h"
-#include "StyleScope.h"
-#include "StyleSheetList.h"
-#include <inspector/InspectorProtocolObjects.h>
-#include <wtf/Ref.h>
-#include <wtf/Vector.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringConcatenate.h>
-
-
-namespace WebCore {
-using namespace Inspector;
-
-enum ForcePseudoClassFlags {
-    PseudoClassNone = 0,
-    PseudoClassHover = 1 << 0,
-    PseudoClassFocus = 1 << 1,
-    PseudoClassActive = 1 << 2,
-    PseudoClassVisited = 1 << 3
-};
-
-static unsigned computePseudoClassMask(const InspectorArray& pseudoClassArray)
-{
-    static NeverDestroyed<String> active(MAKE_STATIC_STRING_IMPL("active"));
-    static NeverDestroyed<String> hover(MAKE_STATIC_STRING_IMPL("hover"));
-    static NeverDestroyed<String> focus(MAKE_STATIC_STRING_IMPL("focus"));
-    static NeverDestroyed<String> visited(MAKE_STATIC_STRING_IMPL("visited"));
-    if (!pseudoClassArray.length())
-        return PseudoClassNone;
-
-    unsigned result = PseudoClassNone;
-    for (auto& pseudoClassValue : pseudoClassArray) {
-        String pseudoClass;
-        bool success = pseudoClassValue->asString(pseudoClass);
-        if (!success)
-            continue;
-        if (pseudoClass == active)
-            result |= PseudoClassActive;
-        else if (pseudoClass == hover)
-            result |= PseudoClassHover;
-        else if (pseudoClass == focus)
-            result |= PseudoClassFocus;
-        else if (pseudoClass == visited)
-            result |= PseudoClassVisited;
-    }
-
-    return result;
-}
-
-class InspectorCSSAgent::StyleSheetAction : public InspectorHistory::Action {
-    WTF_MAKE_NONCOPYABLE(StyleSheetAction);
-public:
-    StyleSheetAction(const String& name, InspectorStyleSheet* styleSheet)
-        : InspectorHistory::Action(name)
-        , m_styleSheet(styleSheet)
-    {
-    }
-
-protected:
-    RefPtr<InspectorStyleSheet> m_styleSheet;
-};
-
-class InspectorCSSAgent::SetStyleSheetTextAction final : public InspectorCSSAgent::StyleSheetAction {
-    WTF_MAKE_NONCOPYABLE(SetStyleSheetTextAction);
-public:
-    SetStyleSheetTextAction(InspectorStyleSheet* styleSheet, const String& text)
-        : InspectorCSSAgent::StyleSheetAction(ASCIILiteral("SetStyleSheetText"), styleSheet)
-        , m_text(text)
-    {
-    }
-
-private:
-    ExceptionOr<void> perform() final
-    {
-        auto result = m_styleSheet->text();
-        if (result.hasException())
-            return result.releaseException();
-        m_oldText = result.releaseReturnValue();
-        return redo();
-    }
-
-    ExceptionOr<void> undo() final
-    {
-        auto result = m_styleSheet->setText(m_oldText);
-        if (result.hasException())
-            return result.releaseException();
-        m_styleSheet->reparseStyleSheet(m_oldText);
-        return { };
-    }
-
-    ExceptionOr<void> redo() final
-    {
-        auto result = m_styleSheet->setText(m_text);
-        if (result.hasException())
-            return result.releaseException();
-        m_styleSheet->reparseStyleSheet(m_text);
-        return { };
-    }
-
-    String mergeId() final
-    {
-        return String::format("SetStyleSheetText %s", m_styleSheet->id().utf8().data());
-    }
-
-    void merge(std::unique_ptr<Action> action) override
-    {
-        ASSERT(action->mergeId() == mergeId());
-        m_text = static_cast<SetStyleSheetTextAction&>(*action).m_text;
-    }
-
-    String m_text;
-    String m_oldText;
-};
-
-class InspectorCSSAgent::SetStyleTextAction final : public InspectorCSSAgent::StyleSheetAction {
-    WTF_MAKE_NONCOPYABLE(SetStyleTextAction);
-public:
-    SetStyleTextAction(InspectorStyleSheet* styleSheet, const InspectorCSSId& cssId, const String& text)
-        : InspectorCSSAgent::StyleSheetAction(ASCIILiteral("SetStyleText"), styleSheet)
-        , m_cssId(cssId)
-        , m_text(text)
-    {
-    }
-
-    ExceptionOr<void> perform() override
-    {
-        return redo();
-    }
-
-    ExceptionOr<void> undo() override
-    {
-        return m_styleSheet->setStyleText(m_cssId, m_oldText, nullptr);
-    }
-
-    ExceptionOr<void> redo() override
-    {
-        return m_styleSheet->setStyleText(m_cssId, m_text, &m_oldText);
-    }
-
-    String mergeId() override
-    {
-        ASSERT(m_styleSheet->id() == m_cssId.styleSheetId());
-        return String::format("SetStyleText %s:%u", m_styleSheet->id().utf8().data(), m_cssId.ordinal());
-    }
-
-    void merge(std::unique_ptr<Action> action) override
-    {
-        ASSERT(action->mergeId() == mergeId());
-
-        SetStyleTextAction* other = static_cast<SetStyleTextAction*>(action.get());
-        m_text = other->m_text;
-    }
-
-private:
-    InspectorCSSId m_cssId;
-    String m_text;
-    String m_oldText;
-};
-
-class InspectorCSSAgent::SetRuleSelectorAction final : public InspectorCSSAgent::StyleSheetAction {
-    WTF_MAKE_NONCOPYABLE(SetRuleSelectorAction);
-public:
-    SetRuleSelectorAction(InspectorStyleSheet* styleSheet, const InspectorCSSId& cssId, const String& selector)
-        : InspectorCSSAgent::StyleSheetAction(ASCIILiteral("SetRuleSelector"), styleSheet)
-        , m_cssId(cssId)
-        , m_selector(selector)
-    {
-    }
-
-private:
-    ExceptionOr<void> perform() final
-    {
-        auto result = m_styleSheet->ruleSelector(m_cssId);
-        if (result.hasException())
-            return result.releaseException();
-        m_oldSelector = result.releaseReturnValue();
-        return redo();
-    }
-
-    ExceptionOr<void> undo() final
-    {
-        return m_styleSheet->setRuleSelector(m_cssId, m_oldSelector);
-    }
-
-    ExceptionOr<void> redo() final
-    {
-        return m_styleSheet->setRuleSelector(m_cssId, m_selector);
-    }
-
-    InspectorCSSId m_cssId;
-    String m_selector;
-    String m_oldSelector;
-};
-
-class InspectorCSSAgent::AddRuleAction final : public InspectorCSSAgent::StyleSheetAction {
-    WTF_MAKE_NONCOPYABLE(AddRuleAction);
-public:
-    AddRuleAction(InspectorStyleSheet* styleSheet, const String& selector)
-        : InspectorCSSAgent::StyleSheetAction(ASCIILiteral("AddRule"), styleSheet)
-        , m_selector(selector)
-    {
-    }
-
-    InspectorCSSId newRuleId() const { return m_newId; }
-
-private:
-    ExceptionOr<void> perform() final
-    {
-        return redo();
-    }
-
-    ExceptionOr<void> undo() final
-    {
-        return m_styleSheet->deleteRule(m_newId);
-    }
-
-    ExceptionOr<void> redo() final
-    {
-        auto result = m_styleSheet->addRule(m_selector);
-        if (result.hasException())
-            return result.releaseException();
-        m_newId = m_styleSheet->ruleId(result.releaseReturnValue());
-        return { };
-    }
-
-    InspectorCSSId m_newId;
-    String m_selector;
-    String m_oldSelector;
-};
-
-CSSStyleRule* InspectorCSSAgent::asCSSStyleRule(CSSRule& rule)
-{
-    if (!is<CSSStyleRule>(rule))
-        return nullptr;
-    return downcast<CSSStyleRule>(&rule);
-}
-
-InspectorCSSAgent::InspectorCSSAgent(WebAgentContext& context, InspectorDOMAgent* domAgent)
-    : InspectorAgentBase(ASCIILiteral("CSS"), context)
-    , m_frontendDispatcher(std::make_unique<CSSFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(CSSBackendDispatcher::create(context.backendDispatcher, this))
-    , m_domAgent(domAgent)
-{
-    m_domAgent->setDOMListener(this);
-}
-
-InspectorCSSAgent::~InspectorCSSAgent()
-{
-    ASSERT(!m_domAgent);
-    reset();
-}
-
-void InspectorCSSAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorCSSAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    resetNonPersistentData();
-
-    String unused;
-    disable(unused);
-}
-
-void InspectorCSSAgent::discardAgent()
-{
-    m_domAgent->setDOMListener(nullptr);
-    m_domAgent = nullptr;
-}
-
-void InspectorCSSAgent::reset()
-{
-    // FIXME: Should we be resetting on main frame navigations?
-    m_idToInspectorStyleSheet.clear();
-    m_cssStyleSheetToInspectorStyleSheet.clear();
-    m_nodeToInspectorStyleSheet.clear();
-    m_documentToInspectorStyleSheet.clear();
-    m_documentToKnownCSSStyleSheets.clear();
-    resetNonPersistentData();
-}
-
-void InspectorCSSAgent::resetNonPersistentData()
-{
-    resetPseudoStates();
-}
-
-void InspectorCSSAgent::enable(ErrorString&)
-{
-    m_instrumentingAgents.setInspectorCSSAgent(this);
-
-    for (auto* document : m_domAgent->documents())
-        activeStyleSheetsUpdated(*document);
-}
-
-void InspectorCSSAgent::disable(ErrorString&)
-{
-    m_instrumentingAgents.setInspectorCSSAgent(nullptr);
-}
-
-void InspectorCSSAgent::documentDetached(Document& document)
-{
-    Vector<CSSStyleSheet*> emptyList;
-    setActiveStyleSheetsForDocument(document, emptyList);
-
-    m_documentToKnownCSSStyleSheets.remove(&document);
-    m_documentToInspectorStyleSheet.remove(&document);
-    m_documentsWithForcedPseudoStates.remove(&document);
-}
-
-void InspectorCSSAgent::mediaQueryResultChanged()
-{
-    m_frontendDispatcher->mediaQueryResultChanged();
-}
-
-void InspectorCSSAgent::activeStyleSheetsUpdated(Document& document)
-{
-    Vector<CSSStyleSheet*> cssStyleSheets;
-    collectAllDocumentStyleSheets(document, cssStyleSheets);
-
-    setActiveStyleSheetsForDocument(document, cssStyleSheets);
-}
-
-void InspectorCSSAgent::setActiveStyleSheetsForDocument(Document& document, Vector<CSSStyleSheet*>& activeStyleSheets)
-{
-    HashSet<CSSStyleSheet*>& previouslyKnownActiveStyleSheets = m_documentToKnownCSSStyleSheets.add(&document, HashSet<CSSStyleSheet*>()).iterator->value;
-
-    HashSet<CSSStyleSheet*> removedStyleSheets(previouslyKnownActiveStyleSheets);
-    Vector<CSSStyleSheet*> addedStyleSheets;
-    for (auto& activeStyleSheet : activeStyleSheets) {
-        if (removedStyleSheets.contains(activeStyleSheet))
-            removedStyleSheets.remove(activeStyleSheet);
-        else
-            addedStyleSheets.append(activeStyleSheet);
-    }
-
-    for (auto* cssStyleSheet : removedStyleSheets) {
-        previouslyKnownActiveStyleSheets.remove(cssStyleSheet);
-        RefPtr<InspectorStyleSheet> inspectorStyleSheet = m_cssStyleSheetToInspectorStyleSheet.get(cssStyleSheet);
-        if (m_idToInspectorStyleSheet.contains(inspectorStyleSheet->id())) {
-            String id = unbindStyleSheet(inspectorStyleSheet.get());
-            m_frontendDispatcher->styleSheetRemoved(id);
-        }
-    }
-
-    for (auto* cssStyleSheet : addedStyleSheets) {
-        previouslyKnownActiveStyleSheets.add(cssStyleSheet);
-        if (!m_cssStyleSheetToInspectorStyleSheet.contains(cssStyleSheet)) {
-            InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(cssStyleSheet);
-            m_frontendDispatcher->styleSheetAdded(inspectorStyleSheet->buildObjectForStyleSheetInfo());
-        }
-    }
-}
-
-bool InspectorCSSAgent::forcePseudoState(const Element& element, CSSSelector::PseudoClassType pseudoClassType)
-{
-    if (m_nodeIdToForcedPseudoState.isEmpty())
-        return false;
-
-    int nodeId = m_domAgent->boundNodeId(&element);
-    if (!nodeId)
-        return false;
-
-    auto it = m_nodeIdToForcedPseudoState.find(nodeId);
-    if (it == m_nodeIdToForcedPseudoState.end())
-        return false;
-
-    unsigned forcedPseudoState = it->value;
-    switch (pseudoClassType) {
-    case CSSSelector::PseudoClassActive:
-        return forcedPseudoState & PseudoClassActive;
-    case CSSSelector::PseudoClassFocus:
-        return forcedPseudoState & PseudoClassFocus;
-    case CSSSelector::PseudoClassHover:
-        return forcedPseudoState & PseudoClassHover;
-    case CSSSelector::PseudoClassVisited:
-        return forcedPseudoState & PseudoClassVisited;
-    default:
-        return false;
-    }
-}
-
-void InspectorCSSAgent::getMatchedStylesForNode(ErrorString& errorString, int nodeId, const bool* includePseudo, const bool* includeInherited, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>>& matchedCSSRules, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::PseudoIdMatches>>& pseudoIdMatches, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::InheritedStyleEntry>>& inheritedEntries)
-{
-    Element* element = elementForId(errorString, nodeId);
-    if (!element)
-        return;
-
-    Element* originalElement = element;
-    PseudoId elementPseudoId = element->pseudoId();
-    if (elementPseudoId) {
-        element = downcast<PseudoElement>(*element).hostElement();
-        if (!element) {
-            errorString = ASCIILiteral("Pseudo element has no parent");
-            return;
-        }
-    }
-
-    // Matched rules.
-    StyleResolver& styleResolver = element->styleResolver();
-    auto matchedRules = styleResolver.pseudoStyleRulesForElement(element, elementPseudoId, StyleResolver::AllCSSRules);
-    matchedCSSRules = buildArrayForMatchedRuleList(matchedRules, styleResolver, *element, elementPseudoId);
-
-    if (!originalElement->isPseudoElement()) {
-        // Pseudo elements.
-        if (!includePseudo || *includePseudo) {
-            auto pseudoElements = Inspector::Protocol::Array<Inspector::Protocol::CSS::PseudoIdMatches>::create();
-            for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < AFTER_LAST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
-                auto matchedRules = styleResolver.pseudoStyleRulesForElement(element, pseudoId, StyleResolver::AllCSSRules);
-                if (!matchedRules.isEmpty()) {
-                    auto matches = Inspector::Protocol::CSS::PseudoIdMatches::create()
-                        .setPseudoId(static_cast<int>(pseudoId))
-                        .setMatches(buildArrayForMatchedRuleList(matchedRules, styleResolver, *element, pseudoId))
-                        .release();
-                    pseudoElements->addItem(WTFMove(matches));
-                }
-            }
-
-            pseudoIdMatches = WTFMove(pseudoElements);
-        }
-
-        // Inherited styles.
-        if (!includeInherited || *includeInherited) {
-            auto entries = Inspector::Protocol::Array<Inspector::Protocol::CSS::InheritedStyleEntry>::create();
-            Element* parentElement = element->parentElement();
-            while (parentElement) {
-                StyleResolver& parentStyleResolver = parentElement->styleResolver();
-                auto parentMatchedRules = parentStyleResolver.styleRulesForElement(parentElement, StyleResolver::AllCSSRules);
-                auto entry = Inspector::Protocol::CSS::InheritedStyleEntry::create()
-                    .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRules, styleResolver, *parentElement, NOPSEUDO))
-                    .release();
-                if (is<StyledElement>(*parentElement) && downcast<StyledElement>(*parentElement).cssomStyle().length()) {
-                    auto& styleSheet = asInspectorStyleSheet(downcast<StyledElement>(*parentElement));
-                    entry->setInlineStyle(styleSheet.buildObjectForStyle(styleSheet.styleForId(InspectorCSSId(styleSheet.id(), 0))));
-                }
-
-                entries->addItem(WTFMove(entry));
-                parentElement = parentElement->parentElement();
-            }
-
-            inheritedEntries = WTFMove(entries);
-        }
-    }
-}
-
-void InspectorCSSAgent::getInlineStylesForNode(ErrorString& errorString, int nodeId, RefPtr<Inspector::Protocol::CSS::CSSStyle>& inlineStyle, RefPtr<Inspector::Protocol::CSS::CSSStyle>& attributesStyle)
-{
-    auto* element = elementForId(errorString, nodeId);
-    if (!is<StyledElement>(element))
-        return;
-
-    auto& styledElement = downcast<StyledElement>(*element);
-    auto& styleSheet = asInspectorStyleSheet(styledElement);
-    inlineStyle = styleSheet.buildObjectForStyle(&styledElement.cssomStyle());
-    if (auto attributes = buildObjectForAttributesStyle(styledElement))
-        attributesStyle = WTFMove(attributes);
-    else
-        attributesStyle = nullptr;
-}
-
-void InspectorCSSAgent::getComputedStyleForNode(ErrorString& errorString, int nodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSComputedStyleProperty>>& style)
-{
-    auto* element = elementForId(errorString, nodeId);
-    if (!element)
-        return;
-
-    auto computedStyleInfo = CSSComputedStyleDeclaration::create(*element, true);
-    auto inspectorStyle = InspectorStyle::create(InspectorCSSId(), WTFMove(computedStyleInfo), nullptr);
-    style = inspectorStyle->buildArrayForComputedStyle();
-}
-
-void InspectorCSSAgent::getAllStyleSheets(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSStyleSheetHeader>>& styleInfos)
-{
-    styleInfos = Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSStyleSheetHeader>::create();
-
-    Vector<InspectorStyleSheet*> inspectorStyleSheets;
-    collectAllStyleSheets(inspectorStyleSheets);
-    for (auto* inspectorStyleSheet : inspectorStyleSheets)
-        styleInfos->addItem(inspectorStyleSheet->buildObjectForStyleSheetInfo());
-}
-
-void InspectorCSSAgent::collectAllStyleSheets(Vector<InspectorStyleSheet*>& result)
-{
-    Vector<CSSStyleSheet*> cssStyleSheets;
-    for (auto* document : m_domAgent->documents())
-        collectAllDocumentStyleSheets(*document, cssStyleSheets);
-
-    for (auto* cssStyleSheet : cssStyleSheets)
-        result.append(bindStyleSheet(cssStyleSheet));
-}
-
-void InspectorCSSAgent::collectAllDocumentStyleSheets(Document& document, Vector<CSSStyleSheet*>& result)
-{
-    auto cssStyleSheets = document.styleScope().activeStyleSheetsForInspector();
-    for (auto& cssStyleSheet : cssStyleSheets)
-        collectStyleSheets(cssStyleSheet.get(), result);
-}
-
-void InspectorCSSAgent::collectStyleSheets(CSSStyleSheet* styleSheet, Vector<CSSStyleSheet*>& result)
-{
-    result.append(styleSheet);
-
-    for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) {
-        CSSRule* rule = styleSheet->item(i);
-        if (is<CSSImportRule>(*rule)) {
-            if (CSSStyleSheet* importedStyleSheet = downcast<CSSImportRule>(*rule).styleSheet())
-                collectStyleSheets(importedStyleSheet, result);
-        }
-    }
-}
-
-void InspectorCSSAgent::getStyleSheet(ErrorString& errorString, const String& styleSheetId, RefPtr<Inspector::Protocol::CSS::CSSStyleSheetBody>& styleSheetObject)
-{
-    InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, styleSheetId);
-    if (!inspectorStyleSheet)
-        return;
-
-    styleSheetObject = inspectorStyleSheet->buildObjectForStyleSheet();
-}
-
-void InspectorCSSAgent::getStyleSheetText(ErrorString& errorString, const String& styleSheetId, String* result)
-{
-    InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, styleSheetId);
-    if (!inspectorStyleSheet)
-        return;
-
-    auto text = inspectorStyleSheet->text();
-    if (!text.hasException())
-        *result = text.releaseReturnValue();
-}
-
-void InspectorCSSAgent::setStyleSheetText(ErrorString& errorString, const String& styleSheetId, const String& text)
-{
-    InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, styleSheetId);
-    if (!inspectorStyleSheet)
-        return;
-
-    auto result = m_domAgent->history()->perform(std::make_unique<SetStyleSheetTextAction>(inspectorStyleSheet, text));
-    if (result.hasException())
-        errorString = InspectorDOMAgent::toErrorString(result.releaseException());
-}
-
-void InspectorCSSAgent::setStyleText(ErrorString& errorString, const InspectorObject& fullStyleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
-{
-    InspectorCSSId compoundId(fullStyleId);
-    ASSERT(!compoundId.isEmpty());
-
-    InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, compoundId.styleSheetId());
-    if (!inspectorStyleSheet)
-        return;
-
-    auto performResult = m_domAgent->history()->perform(std::make_unique<SetStyleTextAction>(inspectorStyleSheet, compoundId, text));
-    if (performResult.hasException()) {
-        errorString = InspectorDOMAgent::toErrorString(performResult.releaseException());
-        return;
-    }
-
-    result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
-}
-
-void InspectorCSSAgent::setRuleSelector(ErrorString& errorString, const InspectorObject& fullRuleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result)
-{
-    InspectorCSSId compoundId(fullRuleId);
-    ASSERT(!compoundId.isEmpty());
-
-    InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, compoundId.styleSheetId());
-    if (!inspectorStyleSheet)
-        return;
-
-    auto performResult = m_domAgent->history()->perform(std::make_unique<SetRuleSelectorAction>(inspectorStyleSheet, compoundId, selector));
-    if (performResult.hasException()) {
-        errorString = InspectorDOMAgent::toErrorString(performResult.releaseException());
-        return;
-    }
-
-    result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId), nullptr);
-}
-
-void InspectorCSSAgent::createStyleSheet(ErrorString& errorString, const String& frameId, String* styleSheetId)
-{
-    Frame* frame = m_domAgent->pageAgent()->frameForId(frameId);
-    if (!frame) {
-        errorString = ASCIILiteral("No frame for given id found");
-        return;
-    }
-
-    Document* document = frame->document();
-    if (!document) {
-        errorString = ASCIILiteral("No document for frame");
-        return;
-    }
-
-    InspectorStyleSheet* inspectorStyleSheet = createInspectorStyleSheetForDocument(*document);
-    if (!inspectorStyleSheet) {
-        errorString = ASCIILiteral("Could not create stylesheet for the frame.");
-        return;
-    }
-
-    *styleSheetId = inspectorStyleSheet->id();
-}
-
-InspectorStyleSheet* InspectorCSSAgent::createInspectorStyleSheetForDocument(Document& document)
-{
-    if (!document.isHTMLDocument() && !document.isSVGDocument())
-        return nullptr;
-
-    auto styleElement = HTMLStyleElement::create(document);
-    styleElement->setAttributeWithoutSynchronization(HTMLNames::typeAttr, AtomicString("text/css", AtomicString::ConstructFromLiteral));
-
-    ContainerNode* targetNode;
-    // HEAD is absent in ImageDocuments, for example.
-    if (auto* head = document.head())
-        targetNode = head;
-    else if (auto* body = document.bodyOrFrameset())
-        targetNode = body;
-    else
-        return nullptr;
-
-    // Inserting this <style> into the document will trigger activeStyleSheetsUpdated
-    // and we will create an InspectorStyleSheet for this <style>'s CSSStyleSheet.
-    // Set this flag, so when we create it, we put it into the via inspector map.
-    m_creatingViaInspectorStyleSheet = true;
-    InlineStyleOverrideScope overrideScope(document);
-    auto appendResult = targetNode->appendChild(styleElement);
-    document.styleScope().flushPendingUpdate();
-    m_creatingViaInspectorStyleSheet = false;
-    if (appendResult.hasException())
-        return nullptr;
-
-    auto iterator = m_documentToInspectorStyleSheet.find(&document);
-    ASSERT(iterator != m_documentToInspectorStyleSheet.end());
-    if (iterator == m_documentToInspectorStyleSheet.end())
-        return nullptr;
-
-    auto& inspectorStyleSheetsForDocument = iterator->value;
-    ASSERT(!inspectorStyleSheetsForDocument.isEmpty());
-    if (inspectorStyleSheetsForDocument.isEmpty())
-        return nullptr;
-
-    return inspectorStyleSheetsForDocument.last().get();
-}
-
-void InspectorCSSAgent::addRule(ErrorString& errorString, const String& styleSheetId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result)
-{
-    InspectorStyleSheet* inspectorStyleSheet = assertStyleSheetForId(errorString, styleSheetId);
-    if (!inspectorStyleSheet) {
-        errorString = ASCIILiteral("No target stylesheet found");
-        return;
-    }
-
-    auto action = std::make_unique<AddRuleAction>(inspectorStyleSheet, selector);
-    auto& rawAction = *action;
-    auto performResult = m_domAgent->history()->perform(WTFMove(action));
-    if (performResult.hasException()) {
-        errorString = InspectorDOMAgent::toErrorString(performResult.releaseException());
-        return;
-    }
-
-    InspectorCSSId ruleId = rawAction.newRuleId();
-    CSSStyleRule* rule = inspectorStyleSheet->ruleForId(ruleId);
-    result = inspectorStyleSheet->buildObjectForRule(rule, nullptr);
-}
-
-void InspectorCSSAgent::getSupportedCSSProperties(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSPropertyInfo>>& cssProperties)
-{
-    auto properties = Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSPropertyInfo>::create();
-    for (int i = firstCSSProperty; i <= lastCSSProperty; ++i) {
-        CSSPropertyID id = convertToCSSPropertyID(i);
-        if (isInternalCSSProperty(id))
-            continue;
-
-        auto property = Inspector::Protocol::CSS::CSSPropertyInfo::create()
-            .setName(getPropertyNameString(id))
-            .release();
-
-        const StylePropertyShorthand& shorthand = shorthandForProperty(id);
-        if (!shorthand.length()) {
-            properties->addItem(WTFMove(property));
-            continue;
-        }
-        auto longhands = Inspector::Protocol::Array<String>::create();
-        for (unsigned j = 0; j < shorthand.length(); ++j) {
-            CSSPropertyID longhandID = shorthand.properties()[j];
-            longhands->addItem(getPropertyNameString(longhandID));
-        }
-        property->setLonghands(WTFMove(longhands));
-        properties->addItem(WTFMove(property));
-    }
-    cssProperties = WTFMove(properties);
-}
-
-void InspectorCSSAgent::getSupportedSystemFontFamilyNames(ErrorString&, RefPtr<Inspector::Protocol::Array<String>>& fontFamilyNames)
-{
-    auto families = Inspector::Protocol::Array<String>::create();
-
-    Vector<String> systemFontFamilies = FontCache::singleton().systemFontFamilies();
-    for (const auto& familyName : systemFontFamilies)
-        families->addItem(familyName);
-
-    fontFamilyNames = WTFMove(families);
-}
-
-void InspectorCSSAgent::forcePseudoState(ErrorString& errorString, int nodeId, const InspectorArray& forcedPseudoClasses)
-{
-    Element* element = m_domAgent->assertElement(errorString, nodeId);
-    if (!element)
-        return;
-
-    auto it = m_nodeIdToForcedPseudoState.find(nodeId);
-    unsigned forcedPseudoState = computePseudoClassMask(forcedPseudoClasses);
-    unsigned currentForcedPseudoState = it == m_nodeIdToForcedPseudoState.end() ? 0 : it->value;
-    if (forcedPseudoState == currentForcedPseudoState)
-        return;
-
-    if (forcedPseudoState) {
-        m_nodeIdToForcedPseudoState.set(nodeId, forcedPseudoState);
-        m_documentsWithForcedPseudoStates.add(&element->document());
-    } else {
-        m_nodeIdToForcedPseudoState.remove(nodeId);
-        if (m_nodeIdToForcedPseudoState.isEmpty())
-            m_documentsWithForcedPseudoStates.clear();
-    }
-
-    element->document().styleScope().didChangeStyleSheetEnvironment();
-}
-
-InspectorStyleSheetForInlineStyle& InspectorCSSAgent::asInspectorStyleSheet(StyledElement& element)
-{
-    auto it = m_nodeToInspectorStyleSheet.find(&element);
-    if (it == m_nodeToInspectorStyleSheet.end()) {
-        String newStyleSheetId = String::number(m_lastStyleSheetId++);
-        auto inspectorStyleSheet = InspectorStyleSheetForInlineStyle::create(m_domAgent->pageAgent(), newStyleSheetId, element, Inspector::Protocol::CSS::StyleSheetOrigin::Regular, this);
-        auto& inspectorStyleSheetRef = inspectorStyleSheet.get();
-        m_idToInspectorStyleSheet.set(newStyleSheetId, inspectorStyleSheet.copyRef());
-        m_nodeToInspectorStyleSheet.set(&element, WTFMove(inspectorStyleSheet));
-        return inspectorStyleSheetRef;
-    }
-
-    return *it->value;
-}
-
-Element* InspectorCSSAgent::elementForId(ErrorString& errorString, int nodeId)
-{
-    Node* node = m_domAgent->nodeForId(nodeId);
-    if (!node) {
-        errorString = ASCIILiteral("No node with given id found");
-        return nullptr;
-    }
-    if (!is<Element>(*node)) {
-        errorString = ASCIILiteral("Not an element node");
-        return nullptr;
-    }
-    return downcast<Element>(node);
-}
-
-String InspectorCSSAgent::unbindStyleSheet(InspectorStyleSheet* inspectorStyleSheet)
-{
-    String id = inspectorStyleSheet->id();
-    m_idToInspectorStyleSheet.remove(id);
-    if (inspectorStyleSheet->pageStyleSheet())
-        m_cssStyleSheetToInspectorStyleSheet.remove(inspectorStyleSheet->pageStyleSheet());
-    return id;
-}
-
-InspectorStyleSheet* InspectorCSSAgent::bindStyleSheet(CSSStyleSheet* styleSheet)
-{
-    RefPtr<InspectorStyleSheet> inspectorStyleSheet = m_cssStyleSheetToInspectorStyleSheet.get(styleSheet);
-    if (!inspectorStyleSheet) {
-        String id = String::number(m_lastStyleSheetId++);
-        Document* document = styleSheet->ownerDocument();
-        inspectorStyleSheet = InspectorStyleSheet::create(m_domAgent->pageAgent(), id, styleSheet, detectOrigin(styleSheet, document), InspectorDOMAgent::documentURLString(document), this);
-        m_idToInspectorStyleSheet.set(id, inspectorStyleSheet);
-        m_cssStyleSheetToInspectorStyleSheet.set(styleSheet, inspectorStyleSheet);
-        if (m_creatingViaInspectorStyleSheet) {
-            auto& inspectorStyleSheetsForDocument = m_documentToInspectorStyleSheet.add(document, Vector<RefPtr<InspectorStyleSheet>>()).iterator->value;
-            inspectorStyleSheetsForDocument.append(inspectorStyleSheet);
-        }
-    }
-    return inspectorStyleSheet.get();
-}
-
-InspectorStyleSheet* InspectorCSSAgent::assertStyleSheetForId(ErrorString& errorString, const String& styleSheetId)
-{
-    IdToInspectorStyleSheet::iterator it = m_idToInspectorStyleSheet.find(styleSheetId);
-    if (it == m_idToInspectorStyleSheet.end()) {
-        errorString = ASCIILiteral("No stylesheet with given id found");
-        return nullptr;
-    }
-    return it->value.get();
-}
-
-Inspector::Protocol::CSS::StyleSheetOrigin InspectorCSSAgent::detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument)
-{
-    if (m_creatingViaInspectorStyleSheet)
-        return Inspector::Protocol::CSS::StyleSheetOrigin::Inspector;
-
-    if (pageStyleSheet && !pageStyleSheet->ownerNode() && pageStyleSheet->href().isEmpty())
-        return Inspector::Protocol::CSS::StyleSheetOrigin::UserAgent;
-
-    if (pageStyleSheet && pageStyleSheet->ownerNode() && pageStyleSheet->ownerNode()->nodeName() == "#document")
-        return Inspector::Protocol::CSS::StyleSheetOrigin::User;
-
-    auto iterator = m_documentToInspectorStyleSheet.find(ownerDocument);
-    if (iterator != m_documentToInspectorStyleSheet.end()) {
-        for (auto& inspectorStyleSheet : iterator->value) {
-            if (pageStyleSheet == inspectorStyleSheet->pageStyleSheet())
-                return Inspector::Protocol::CSS::StyleSheetOrigin::Inspector;
-        }
-    }
-
-    return Inspector::Protocol::CSS::StyleSheetOrigin::Regular;
-}
-
-RefPtr<Inspector::Protocol::CSS::CSSRule> InspectorCSSAgent::buildObjectForRule(StyleRule* styleRule, StyleResolver& styleResolver, Element& element)
-{
-    if (!styleRule)
-        return nullptr;
-
-    // StyleRules returned by StyleResolver::styleRulesForElement lack parent pointers since that infomation is not cheaply available.
-    // Since the inspector wants to walk the parent chain, we construct the full wrappers here.
-    styleResolver.inspectorCSSOMWrappers().collectDocumentWrappers(styleResolver.document().extensionStyleSheets());
-    styleResolver.inspectorCSSOMWrappers().collectScopeWrappers(Style::Scope::forNode(element));
-
-    // Possiblity of :host styles if this element has a shadow root.
-    if (ShadowRoot* shadowRoot = element.shadowRoot())
-        styleResolver.inspectorCSSOMWrappers().collectScopeWrappers(shadowRoot->styleScope());
-
-    CSSStyleRule* cssomWrapper = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(styleRule);
-    if (!cssomWrapper)
-        return nullptr;
-
-    InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(cssomWrapper->parentStyleSheet());
-    return inspectorStyleSheet ? inspectorStyleSheet->buildObjectForRule(cssomWrapper, &element) : nullptr;
-}
-
-RefPtr<Inspector::Protocol::CSS::CSSRule> InspectorCSSAgent::buildObjectForRule(CSSStyleRule* rule)
-{
-    if (!rule)
-        return nullptr;
-
-    ASSERT(rule->parentStyleSheet());
-    InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(rule->parentStyleSheet());
-    return inspectorStyleSheet ? inspectorStyleSheet->buildObjectForRule(rule, nullptr) : nullptr;
-}
-
-RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>> InspectorCSSAgent::buildArrayForMatchedRuleList(const Vector<RefPtr<StyleRule>>& matchedRules, StyleResolver& styleResolver, Element& element, PseudoId pseudoId)
-{
-    auto result = Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>::create();
-
-    SelectorChecker::CheckingContext context(SelectorChecker::Mode::CollectingRules);
-    context.pseudoId = pseudoId ? pseudoId : element.pseudoId();
-    SelectorChecker selectorChecker(element.document());
-
-    for (auto& matchedRule : matchedRules) {
-        RefPtr<Inspector::Protocol::CSS::CSSRule> ruleObject = buildObjectForRule(matchedRule.get(), styleResolver, element);
-        if (!ruleObject)
-            continue;
-
-        auto matchingSelectors = Inspector::Protocol::Array<int>::create();
-        const CSSSelectorList& selectorList = matchedRule->selectorList();
-        int index = 0;
-        for (const CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) {
-            unsigned ignoredSpecificity;
-            bool matched = selectorChecker.match(*selector, element, context, ignoredSpecificity);
-            if (matched)
-                matchingSelectors->addItem(index);
-            ++index;
-        }
-
-        auto match = Inspector::Protocol::CSS::RuleMatch::create()
-            .setRule(WTFMove(ruleObject))
-            .setMatchingSelectors(WTFMove(matchingSelectors))
-            .release();
-        result->addItem(WTFMove(match));
-    }
-
-    return WTFMove(result);
-}
-
-RefPtr<Inspector::Protocol::CSS::CSSStyle> InspectorCSSAgent::buildObjectForAttributesStyle(StyledElement& element)
-{
-    // FIXME: Ugliness below.
-    auto* attributeStyle = const_cast<StyleProperties*>(element.presentationAttributeStyle());
-    if (!attributeStyle)
-        return nullptr;
-
-    auto& mutableAttributeStyle = downcast<MutableStyleProperties>(*attributeStyle);
-    auto inspectorStyle = InspectorStyle::create(InspectorCSSId(), mutableAttributeStyle.ensureCSSStyleDeclaration(), nullptr);
-    return inspectorStyle->buildObjectForStyle();
-}
-
-void InspectorCSSAgent::didRemoveDOMNode(Node& node, int nodeId)
-{
-    m_nodeIdToForcedPseudoState.remove(nodeId);
-
-    auto it = m_nodeToInspectorStyleSheet.find(&node);
-    if (it == m_nodeToInspectorStyleSheet.end())
-        return;
-
-    m_idToInspectorStyleSheet.remove(it->value->id());
-    m_nodeToInspectorStyleSheet.remove(&node);
-}
-
-void InspectorCSSAgent::didModifyDOMAttr(Element& element)
-{
-    auto it = m_nodeToInspectorStyleSheet.find(&element);
-    if (it == m_nodeToInspectorStyleSheet.end())
-        return;
-
-    it->value->didModifyElementAttribute();
-}
-
-void InspectorCSSAgent::styleSheetChanged(InspectorStyleSheet* styleSheet)
-{
-    m_frontendDispatcher->styleSheetChanged(styleSheet->id());
-}
-
-void InspectorCSSAgent::resetPseudoStates()
-{
-    for (auto& document : m_documentsWithForcedPseudoStates)
-        document->styleScope().didChangeStyleSheetEnvironment();
-
-    m_nodeIdToForcedPseudoState.clear();
-    m_documentsWithForcedPseudoStates.clear();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorCSSAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.h       2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.h  2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,173 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2015-2016 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. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "CSSSelector.h"
-#include "ContentSecurityPolicy.h"
-#include "InspectorDOMAgent.h"
-#include "InspectorStyleSheet.h"
-#include "InspectorWebAgentBase.h"
-#include "SecurityContext.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorValues.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace Inspector {
-class CSSFrontendDispatcher;
-}
-
-namespace WebCore {
-
-class CSSRule;
-class CSSStyleRule;
-class CSSStyleSheet;
-class Document;
-class Element;
-class Node;
-class NodeList;
-class StyleResolver;
-class StyleRule;
-
-class InspectorCSSAgent final
-    : public InspectorAgentBase
-    , public InspectorDOMAgent::DOMListener
-    , public Inspector::CSSBackendDispatcherHandler
-    , public InspectorStyleSheet::Listener {
-    WTF_MAKE_NONCOPYABLE(InspectorCSSAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    class InlineStyleOverrideScope {
-    public:
-        InlineStyleOverrideScope(SecurityContext& context)
-            : m_contentSecurityPolicy(context.contentSecurityPolicy())
-        {
-            m_contentSecurityPolicy->setOverrideAllowInlineStyle(true);
-        }
-
-        ~InlineStyleOverrideScope()
-        {
-            m_contentSecurityPolicy->setOverrideAllowInlineStyle(false);
-        }
-
-    private:
-        ContentSecurityPolicy* m_contentSecurityPolicy;
-    };
-
-    InspectorCSSAgent(WebAgentContext&, InspectorDOMAgent*);
-    virtual ~InspectorCSSAgent();
-
-    static CSSStyleRule* asCSSStyleRule(CSSRule&);
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-    void discardAgent() override;
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void reset();
-
-    // InspectorInstrumentation
-    void documentDetached(Document&);
-    void mediaQueryResultChanged();
-    void activeStyleSheetsUpdated(Document&);
-    bool forcePseudoState(const Element&, CSSSelector::PseudoClassType);
-
-    void getComputedStyleForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSComputedStyleProperty>>&) override;
-    void getInlineStylesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::CSS::CSSStyle>& inlineStyle, RefPtr<Inspector::Protocol::CSS::CSSStyle>& attributes) override;
-    void getMatchedStylesForNode(ErrorString&, int nodeId, const bool* const includePseudo, const bool* const includeInherited, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>>& matchedCSSRules, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::PseudoIdMatches>>&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::InheritedStyleEntry>>& inheritedEntries) override;
-    void getAllStyleSheets(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSStyleSheetHeader>>& styleSheetInfos) override;
-    void getStyleSheet(ErrorString&, const String& styleSheetId, RefPtr<Inspector::Protocol::CSS::CSSStyleSheetBody>& result) override;
-    void getStyleSheetText(ErrorString&, const String& styleSheetId, String* result) override;
-    void setStyleSheetText(ErrorString&, const String& styleSheetId, const String& text) override;
-    void setStyleText(ErrorString&, const Inspector::InspectorObject& styleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result) override;
-    void setRuleSelector(ErrorString&, const Inspector::InspectorObject& ruleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
-    void createStyleSheet(ErrorString&, const String& frameId, String* styleSheetId) override;
-    void addRule(ErrorString&, const String& styleSheetId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
-    void getSupportedCSSProperties(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSPropertyInfo>>& result) override;
-    void getSupportedSystemFontFamilyNames(ErrorString&, RefPtr<Inspector::Protocol::Array<String>>& result) override;
-    void forcePseudoState(ErrorString&, int nodeId, const Inspector::InspectorArray& forcedPseudoClasses) override;
-
-private:
-    class StyleSheetAction;
-    class SetStyleSheetTextAction;
-    class SetStyleTextAction;
-    class SetRuleSelectorAction;
-    class AddRuleAction;
-
-    typedef HashMap<String, RefPtr<InspectorStyleSheet>> IdToInspectorStyleSheet;
-    typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet>> CSSStyleSheetToInspectorStyleSheet;
-    typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle>> NodeToInspectorStyleSheet; // bogus "stylesheets" with elements' inline styles
-    typedef HashMap<RefPtr<Document>, Vector<RefPtr<InspectorStyleSheet>>> DocumentToViaInspectorStyleSheet; // "via inspector" stylesheets
-    typedef HashMap<int, unsigned> NodeIdToForcedPseudoState;
-
-    void resetNonPersistentData();
-    InspectorStyleSheetForInlineStyle& asInspectorStyleSheet(StyledElement&);
-    Element* elementForId(ErrorString&, int nodeId);
-
-    void collectAllStyleSheets(Vector<InspectorStyleSheet*>&);
-    void collectAllDocumentStyleSheets(Document&, Vector<CSSStyleSheet*>&);
-    void collectStyleSheets(CSSStyleSheet*, Vector<CSSStyleSheet*>&);
-    void setActiveStyleSheetsForDocument(Document&, Vector<CSSStyleSheet*>& activeStyleSheets);
-
-    String unbindStyleSheet(InspectorStyleSheet*);
-    InspectorStyleSheet* bindStyleSheet(CSSStyleSheet*);
-    InspectorStyleSheet* assertStyleSheetForId(ErrorString&, const String&);
-    InspectorStyleSheet* createInspectorStyleSheetForDocument(Document&);
-    Inspector::Protocol::CSS::StyleSheetOrigin detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
-
-    RefPtr<Inspector::Protocol::CSS::CSSRule> buildObjectForRule(StyleRule*, StyleResolver&, Element&);
-    RefPtr<Inspector::Protocol::CSS::CSSRule> buildObjectForRule(CSSStyleRule*);
-    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>> buildArrayForMatchedRuleList(const Vector<RefPtr<StyleRule>>&, StyleResolver&, Element&, PseudoId);
-    RefPtr<Inspector::Protocol::CSS::CSSStyle> buildObjectForAttributesStyle(StyledElement&);
-
-    // InspectorDOMAgent::DOMListener implementation
-    void didRemoveDOMNode(Node&, int nodeId) override;
-    void didModifyDOMAttr(Element&) override;
-
-    // InspectorCSSAgent::Listener implementation
-    void styleSheetChanged(InspectorStyleSheet*) override;
-
-    void resetPseudoStates();
-
-    std::unique_ptr<Inspector::CSSFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::CSSBackendDispatcher> m_backendDispatcher;
-    InspectorDOMAgent* m_domAgent { nullptr };
-
-    IdToInspectorStyleSheet m_idToInspectorStyleSheet;
-    CSSStyleSheetToInspectorStyleSheet m_cssStyleSheetToInspectorStyleSheet;
-    NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet;
-    DocumentToViaInspectorStyleSheet m_documentToInspectorStyleSheet;
-    HashMap<Document*, HashSet<CSSStyleSheet*>> m_documentToKnownCSSStyleSheets;
-    NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState;
-    HashSet<Document*> m_documentsWithForcedPseudoStates;
-
-    int m_lastStyleSheetId { 1 };
-    bool m_creatingViaInspectorStyleSheet { false };
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCanvasAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp  2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorCanvasAgent.cpp     2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,664 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 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. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorCanvasAgent.h"
-
-#include "CanvasRenderingContext.h"
-#include "CanvasRenderingContext2D.h"
-#include "Document.h"
-#include "Element.h"
-#include "Frame.h"
-#include "InspectorDOMAgent.h"
-#include "InstrumentingAgents.h"
-#include "JSCanvasRenderingContext2D.h"
-#include "JSMainThreadExecState.h"
-#include "MainFrame.h"
-#include "ScriptState.h"
-#include "StringAdaptors.h"
-#include <inspector/IdentifiersFactory.h>
-#include <inspector/InjectedScript.h>
-#include <inspector/InjectedScriptManager.h>
-#include <inspector/InspectorProtocolObjects.h>
-#include <runtime/JSCInlines.h>
-
-#if ENABLE(WEBGL)
-#include "JSWebGLRenderingContext.h"
-#include "WebGLProgram.h"
-#include "WebGLShader.h"
-#endif
-
-#if ENABLE(WEBGL2)
-#include "JSWebGL2RenderingContext.h"
-#endif
-
-#if ENABLE(WEBGPU)
-#include "JSWebGPURenderingContext.h"
-#endif
-
-
-namespace WebCore {
-using namespace Inspector;
-
-InspectorCanvasAgent::InspectorCanvasAgent(WebAgentContext& context)
-    : InspectorAgentBase(ASCIILiteral("Canvas"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::CanvasFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::CanvasBackendDispatcher::create(context.backendDispatcher, this))
-    , m_injectedScriptManager(context.injectedScriptManager)
-    , m_canvasDestroyedTimer(*this, &InspectorCanvasAgent::canvasDestroyedTimerFired)
-    , m_canvasRecordingTimer(*this, &InspectorCanvasAgent::canvasRecordingTimerFired)
-{
-}
-
-void InspectorCanvasAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorCanvasAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString ignored;
-    disable(ignored);
-}
-
-void InspectorCanvasAgent::discardAgent()
-{
-    clearCanvasData();
-}
-
-void InspectorCanvasAgent::enable(ErrorString&)
-{
-    if (m_enabled)
-        return;
-
-    m_enabled = true;
-
-    const bool captureBacktrace = false;
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values())
-        m_frontendDispatcher->canvasAdded(inspectorCanvas->buildObjectForCanvas(m_instrumentingAgents, captureBacktrace));
-
-#if ENABLE(WEBGL)
-    for (auto& inspectorProgram : m_identifierToInspectorProgram.values()) {
-        auto& inspectorCanvas = inspectorProgram->canvas();
-        m_frontendDispatcher->programCreated(inspectorCanvas.identifier(), inspectorProgram->identifier());
-    }
-#endif
-}
-
-void InspectorCanvasAgent::disable(ErrorString&)
-{
-    if (!m_enabled)
-        return;
-
-    if (m_canvasDestroyedTimer.isActive())
-        m_canvasDestroyedTimer.stop();
-
-    m_removedCanvasIdentifiers.clear();
-
-    if (m_canvasRecordingTimer.isActive())
-        m_canvasRecordingTimer.stop();
-
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values())
-        inspectorCanvas->resetRecordingData();
-
-    m_enabled = false;
-}
-
-void InspectorCanvasAgent::requestNode(ErrorString& errorString, const String& canvasId, int* nodeId)
-{
-    auto* inspectorCanvas = assertInspectorCanvas(errorString, canvasId);
-    if (!inspectorCanvas)
-        return;
-
-    int documentNodeId = m_instrumentingAgents.inspectorDOMAgent()->boundNodeId(&inspectorCanvas->canvas().document());
-    if (!documentNodeId) {
-        errorString = ASCIILiteral("Document has not been requested");
-        return;
-    }
-
-    *nodeId = m_instrumentingAgents.inspectorDOMAgent()->pushNodeToFrontend(errorString, documentNodeId, &inspectorCanvas->canvas());
-}
-
-void InspectorCanvasAgent::requestContent(ErrorString& errorString, const String& canvasId, String* content)
-{
-    auto* inspectorCanvas = assertInspectorCanvas(errorString, canvasId);
-    if (!inspectorCanvas)
-        return;
-
-    CanvasRenderingContext* context = inspectorCanvas->canvas().renderingContext();
-    if (is<CanvasRenderingContext2D>(context)) {
-        auto result = inspectorCanvas->canvas().toDataURL(ASCIILiteral("image/png"));
-        if (result.hasException()) {
-            errorString = result.releaseException().releaseMessage();
-            return;
-        }
-        *content = result.releaseReturnValue().string;
-    }
-#if ENABLE(WEBGL)
-    else if (is<WebGLRenderingContextBase>(context)) {
-        WebGLRenderingContextBase* gl = downcast<WebGLRenderingContextBase>(context);
-
-        gl->setPreventBufferClearForInspector(true);
-        auto result = inspectorCanvas->canvas().toDataURL(ASCIILiteral("image/png"));
-        gl->setPreventBufferClearForInspector(false);
-
-        if (result.hasException()) {
-            errorString = result.releaseException().releaseMessage();
-            return;
-        }
-        *content = result.releaseReturnValue().string;
-    }
-#endif
-    // FIXME: <https://webkit.org/b/173621> Web Inspector: Support getting the content of WebGPU contexts
-    else
-        errorString = ASCIILiteral("Unsupported canvas context type");
-}
-
-void InspectorCanvasAgent::requestCSSCanvasClientNodes(ErrorString& errorString, const String& canvasId, RefPtr<Inspector::Protocol::Array<int>>& result)
-{
-    auto* inspectorCanvas = assertInspectorCanvas(errorString, canvasId);
-    if (!inspectorCanvas)
-        return;
-
-    result = Inspector::Protocol::Array<int>::create();
-    for (Element* element : inspectorCanvas->canvas().cssCanvasClients()) {
-        if (int documentNodeId = m_instrumentingAgents.inspectorDOMAgent()->boundNodeId(&element->document()))
-            result->addItem(m_instrumentingAgents.inspectorDOMAgent()->pushNodeToFrontend(errorString, documentNodeId, element));
-    }
-}
-
-static JSC::JSValue contextAsScriptValue(JSC::ExecState& state, CanvasRenderingContext* context)
-{
-    JSC::JSLockHolder lock(&state);
-
-    if (is<CanvasRenderingContext2D>(context))
-        return toJS(&state, deprecatedGlobalObjectForPrototype(&state), downcast<CanvasRenderingContext2D>(context));
-#if ENABLE(WEBGL)
-    if (is<WebGLRenderingContext>(context))
-        return toJS(&state, deprecatedGlobalObjectForPrototype(&state), downcast<WebGLRenderingContext>(context));
-#endif
-#if ENABLE(WEBGL2)
-    if (is<WebGL2RenderingContext>(context))
-        return toJS(&state, deprecatedGlobalObjectForPrototype(&state), downcast<WebGL2RenderingContext>(context));
-#endif
-#if ENABLE(WEBGPU)
-    if (is<WebGPURenderingContext>(context))
-        return toJS(&state, deprecatedGlobalObjectForPrototype(&state), downcast<WebGPURenderingContext>(context));
-#endif
-
-    return { };
-}
-
-void InspectorCanvasAgent::resolveCanvasContext(ErrorString& errorString, const String& canvasId, const String* const objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result)
-{
-    auto* inspectorCanvas = assertInspectorCanvas(errorString, canvasId);
-    if (!inspectorCanvas)
-        return;
-
-    Frame* frame = inspectorCanvas->canvas().document().frame();
-    if (!frame) {
-        errorString = ASCIILiteral("Canvas belongs to a document without a frame");
-        return;
-    }
-
-    auto& state = *mainWorldExecState(frame);
-    auto injectedScript = m_injectedScriptManager.injectedScriptFor(&state);
-    ASSERT(!injectedScript.hasNoValue());
-
-    CanvasRenderingContext* context = inspectorCanvas->canvas().renderingContext();
-    JSC::JSValue value = contextAsScriptValue(state, context);
-    if (!value) {
-        ASSERT_NOT_REACHED();
-        errorString = ASCIILiteral("Unknown context type");
-        return;
-    }
-
-    String objectGroupName = objectGroup ? *objectGroup : String();
-    result = injectedScript.wrapObject(value, objectGroupName);
-}
-
-void InspectorCanvasAgent::startRecording(ErrorString& errorString, const String& canvasId, const bool* const singleFrame, const int* const memoryLimit)
-{
-    auto* inspectorCanvas = assertInspectorCanvas(errorString, canvasId);
-    if (!inspectorCanvas)
-        return;
-
-    if (inspectorCanvas->canvas().renderingContext()->callTracingActive()) {
-        errorString = ASCIILiteral("Already recording canvas");
-        return;
-    }
-
-    inspectorCanvas->resetRecordingData();
-    if (singleFrame)
-        inspectorCanvas->setSingleFrame(*singleFrame);
-    if (memoryLimit)
-        inspectorCanvas->setBufferLimit(*memoryLimit);
-
-    inspectorCanvas->canvas().renderingContext()->setCallTracingActive(true);
-}
-
-void InspectorCanvasAgent::stopRecording(ErrorString& errorString, const String& canvasId)
-{
-    auto* inspectorCanvas = assertInspectorCanvas(errorString, canvasId);
-    if (!inspectorCanvas)
-        return;
-
-    if (!inspectorCanvas->canvas().renderingContext()->callTracingActive()) {
-        errorString = ASCIILiteral("No active recording for canvas");
-        return;
-    }
-
-    didFinishRecordingCanvasFrame(inspectorCanvas->canvas(), true);
-}
-
-void InspectorCanvasAgent::requestShaderSource(ErrorString& errorString, const String& programId, const String& shaderType, String* content)
-{
-#if ENABLE(WEBGL)
-    auto* inspectorProgram = assertInspectorProgram(errorString, programId);
-    if (!inspectorProgram)
-        return;
-
-    auto* shader = inspectorProgram->shaderForType(shaderType);
-    if (!shader) {
-        errorString = ASCIILiteral("No shader for given type.");
-        return;
-    }
-
-    *content = shader->getSource();
-#else
-    UNUSED_PARAM(programId);
-    UNUSED_PARAM(shaderType);
-    UNUSED_PARAM(content);
-    errorString = ASCIILiteral("WebGL is not supported.");
-#endif
-}
-
-void InspectorCanvasAgent::updateShader(ErrorString& errorString, const String& programId, const String& shaderType, const String& source)
-{
-#if ENABLE(WEBGL)
-    auto* inspectorProgram = assertInspectorProgram(errorString, programId);
-    if (!inspectorProgram)
-        return;
-
-    auto* shader = inspectorProgram->shaderForType(shaderType);
-    if (!shader) {
-        errorString = ASCIILiteral("No shader for given type.");
-        return;
-    }
-
-    WebGLRenderingContextBase* contextWebGL = inspectorProgram->context();
-    contextWebGL->shaderSource(shader, source);
-    contextWebGL->compileShader(shader);
-
-    if (!shader->isValid()) {
-        errorString = ASCIILiteral("Shader compilation failed.");
-        return;
-    }
-
-    contextWebGL->linkProgramWithoutInvalidatingAttribLocations(&inspectorProgram->program());
-#else
-    UNUSED_PARAM(programId);
-    UNUSED_PARAM(shaderType);
-    UNUSED_PARAM(source);
-    errorString = ASCIILiteral("WebGL is not supported.");
-#endif
-}
-
-void InspectorCanvasAgent::setShaderProgramDisabled(ErrorString& errorString, const String& programId, bool disabled)
-{
-#if ENABLE(WEBGL)
-    auto* inspectorProgram = assertInspectorProgram(errorString, programId);
-    if (!inspectorProgram)
-        return;
-
-    inspectorProgram->setDisabled(disabled);
-#else
-    UNUSED_PARAM(programId);
-    UNUSED_PARAM(disabled);
-    errorString = ASCIILiteral("WebGL is not supported.");
-#endif
-}
-
-void InspectorCanvasAgent::frameNavigated(Frame& frame)
-{
-    if (frame.isMainFrame()) {
-        clearCanvasData();
-        return;
-    }
-
-    Vector<InspectorCanvas*> inspectorCanvases;
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values()) {
-        if (inspectorCanvas->canvas().document().frame() == &frame)
-            inspectorCanvases.append(inspectorCanvas.get());
-    }
-
-    for (auto* inspectorCanvas : inspectorCanvases) {
-        String identifier = unbindCanvas(*inspectorCanvas);
-        if (m_enabled)
-            m_frontendDispatcher->canvasRemoved(identifier);
-    }
-}
-
-void InspectorCanvasAgent::didCreateCSSCanvas(HTMLCanvasElement& canvasElement, const String& name)
-{
-    if (findInspectorCanvas(canvasElement)) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    ASSERT(!m_canvasToCSSCanvasName.contains(&canvasElement));
-    m_canvasToCSSCanvasName.set(&canvasElement, name);
-}
-
-void InspectorCanvasAgent::didChangeCSSCanvasClientNodes(HTMLCanvasElement& canvasElement)
-{
-    auto* inspectorCanvas = findInspectorCanvas(canvasElement);
-    if (!inspectorCanvas)
-        return;
-
-    m_frontendDispatcher->cssCanvasClientNodesChanged(inspectorCanvas->identifier());
-}
-
-void InspectorCanvasAgent::didCreateCanvasRenderingContext(HTMLCanvasElement& canvasElement)
-{
-    if (findInspectorCanvas(canvasElement)) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    canvasElement.addObserver(*this);
-
-    String cssCanvasName = m_canvasToCSSCanvasName.take(&canvasElement);
-    auto inspectorCanvas = InspectorCanvas::create(canvasElement, cssCanvasName);
-
-    if (m_enabled) {
-        const bool captureBacktrace = true;
-        m_frontendDispatcher->canvasAdded(inspectorCanvas->buildObjectForCanvas(m_instrumentingAgents, captureBacktrace));
-    }
-
-    m_identifierToInspectorCanvas.set(inspectorCanvas->identifier(), WTFMove(inspectorCanvas));
-}
-
-void InspectorCanvasAgent::didChangeCanvasMemory(HTMLCanvasElement& canvasElement)
-{
-    auto* inspectorCanvas = findInspectorCanvas(canvasElement);
-    if (!inspectorCanvas)
-        return;
-
-    m_frontendDispatcher->canvasMemoryChanged(inspectorCanvas->identifier(), canvasElement.memoryCost());
-}
-
-void InspectorCanvasAgent::recordCanvasAction(CanvasRenderingContext& canvasRenderingContext, const String& name, Vector<RecordCanvasActionVariant>&& parameters)
-{
-    HTMLCanvasElement& canvasElement = canvasRenderingContext.canvas();
-
-    auto* inspectorCanvas = findInspectorCanvas(canvasElement);
-    ASSERT(inspectorCanvas);
-    if (!inspectorCanvas)
-        return;
-
-    ASSERT(canvasRenderingContext.callTracingActive());
-    if (!canvasRenderingContext.callTracingActive())
-        return;
-
-    inspectorCanvas->recordAction(name, WTFMove(parameters));
-
-    if (!m_canvasRecordingTimer.isActive())
-        m_canvasRecordingTimer.startOneShot(0_s);
-
-    if (!inspectorCanvas->hasBufferSpace())
-        didFinishRecordingCanvasFrame(canvasElement, true);
-}
-
-void InspectorCanvasAgent::canvasDestroyed(HTMLCanvasElement& canvasElement)
-{
-    auto* inspectorCanvas = findInspectorCanvas(canvasElement);
-    ASSERT(inspectorCanvas);
-    if (!inspectorCanvas)
-        return;
-
-    String identifier = unbindCanvas(*inspectorCanvas);
-    if (!m_enabled)
-        return;
-
-    // WebCore::CanvasObserver::canvasDestroyed is called in response to the GC destroying the HTMLCanvasElement.
-    // Due to the single-process model used in WebKit1, the event must be dispatched from a timer to prevent
-    // the frontend from making JS allocations while the GC is still active.
-    m_removedCanvasIdentifiers.append(identifier);
-
-    if (!m_canvasDestroyedTimer.isActive())
-        m_canvasDestroyedTimer.startOneShot(0_s);
-}
-
-void InspectorCanvasAgent::didFinishRecordingCanvasFrame(HTMLCanvasElement& canvasElement, bool forceDispatch)
-{
-    auto* inspectorCanvas = findInspectorCanvas(canvasElement);
-    ASSERT(inspectorCanvas);
-    if (!inspectorCanvas)
-        return;
-
-    CanvasRenderingContext* canvasRenderingContext = inspectorCanvas->canvas().renderingContext();
-    ASSERT(canvasRenderingContext->callTracingActive());
-    if (!canvasRenderingContext->callTracingActive())
-        return;
-
-    if (!inspectorCanvas->hasRecordingData()) {
-        if (forceDispatch) {
-            m_frontendDispatcher->recordingFinished(inspectorCanvas->identifier(), nullptr);
-
-            inspectorCanvas->resetRecordingData();
-        }
-        return;
-    }
-
-    if (!forceDispatch && !inspectorCanvas->singleFrame()) {
-        inspectorCanvas->markNewFrame();
-        return;
-    }
-
-    if (forceDispatch)
-        inspectorCanvas->markCurrentFrameIncomplete();
-
-    // FIXME: <https://webkit.org/b/176008> Web Inspector: Record actions performed on WebGL2RenderingContext
-
-    Inspector::Protocol::Recording::Type type;
-    if (is<CanvasRenderingContext2D>(canvasRenderingContext))
-        type = Inspector::Protocol::Recording::Type::Canvas2D;
-#if ENABLE(WEBGL)
-    else if (is<WebGLRenderingContext>(canvasRenderingContext))
-        type = Inspector::Protocol::Recording::Type::CanvasWebGL;
-#endif
-    else {
-        ASSERT_NOT_REACHED();
-        type = Inspector::Protocol::Recording::Type::Canvas2D;
-    }
-
-    auto recording = Inspector::Protocol::Recording::Recording::create()
-        .setVersion(1)
-        .setType(type)
-        .setInitialState(inspectorCanvas->releaseInitialState())
-        .setFrames(inspectorCanvas->releaseFrames())
-        .setData(inspectorCanvas->releaseData())
-        .release();
-
-    m_frontendDispatcher->recordingFinished(inspectorCanvas->identifier(), WTFMove(recording));
-
-    inspectorCanvas->resetRecordingData();
-}
-
-#if ENABLE(WEBGL)
-void InspectorCanvasAgent::didCreateProgram(WebGLRenderingContextBase& context, WebGLProgram& program)
-{
-    auto* inspectorCanvas = findInspectorCanvas(context.canvas());
-    ASSERT(inspectorCanvas);
-    if (!inspectorCanvas)
-        return;
-
-    auto inspectorProgram = InspectorShaderProgram::create(program, *inspectorCanvas);
-    String programIdentifier = inspectorProgram->identifier();
-    m_identifierToInspectorProgram.set(programIdentifier, WTFMove(inspectorProgram));
-
-    if (m_enabled)
-        m_frontendDispatcher->programCreated(inspectorCanvas->identifier(), programIdentifier);
-}
-
-void InspectorCanvasAgent::willDeleteProgram(WebGLProgram& program)
-{
-    auto* inspectorProgram = findInspectorProgram(program);
-    if (!inspectorProgram)
-        return;
-
-    String identifier = unbindProgram(*inspectorProgram);
-    if (m_enabled)
-        m_frontendDispatcher->programDeleted(identifier);
-}
-
-bool InspectorCanvasAgent::isShaderProgramDisabled(WebGLProgram& program)
-{
-    auto* inspectorProgram = findInspectorProgram(program);
-    if (!inspectorProgram)
-        return false;
-
-    return inspectorProgram->disabled();
-}
-#endif
-
-void InspectorCanvasAgent::canvasDestroyedTimerFired()
-{
-    if (!m_removedCanvasIdentifiers.size())
-        return;
-
-    if (m_enabled) {
-        for (auto& identifier : m_removedCanvasIdentifiers)
-            m_frontendDispatcher->canvasRemoved(identifier);
-    }
-
-    m_removedCanvasIdentifiers.clear();
-}
-
-void InspectorCanvasAgent::canvasRecordingTimerFired()
-{
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values()) {
-        if (!inspectorCanvas->canvas().renderingContext()->callTracingActive())
-            continue;
-
-        didFinishRecordingCanvasFrame(inspectorCanvas->canvas());
-    }
-}
-
-void InspectorCanvasAgent::clearCanvasData()
-{
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values())
-        inspectorCanvas->canvas().removeObserver(*this);
-
-    m_identifierToInspectorCanvas.clear();
-    m_canvasToCSSCanvasName.clear();
-    m_removedCanvasIdentifiers.clear();
-#if ENABLE(WEBGL)
-    m_identifierToInspectorProgram.clear();
-#endif
-
-    if (m_canvasRecordingTimer.isActive())
-        m_canvasRecordingTimer.stop();
-
-    if (m_canvasDestroyedTimer.isActive())
-        m_canvasDestroyedTimer.stop();
-}
-
-String InspectorCanvasAgent::unbindCanvas(InspectorCanvas& inspectorCanvas)
-{
-    ASSERT(!m_canvasToCSSCanvasName.contains(&inspectorCanvas.canvas()));
-
-#if ENABLE(WEBGL)
-    Vector<InspectorShaderProgram*> programsToRemove;
-    for (auto& inspectorProgram : m_identifierToInspectorProgram.values()) {
-        if (&inspectorProgram->canvas() == &inspectorCanvas)
-            programsToRemove.append(inspectorProgram.get());
-    }
-
-    for (auto* inspectorProgram : programsToRemove)
-        unbindProgram(*inspectorProgram);
-#endif
-
-    String identifier = inspectorCanvas.identifier();
-    m_identifierToInspectorCanvas.remove(identifier);
-
-    return identifier;
-}
-
-InspectorCanvas* InspectorCanvasAgent::assertInspectorCanvas(ErrorString& errorString, const String& identifier)
-{
-    RefPtr<InspectorCanvas> inspectorCanvas = m_identifierToInspectorCanvas.get(identifier);
-    if (!inspectorCanvas) {
-        errorString = ASCIILiteral("No canvas for given identifier.");
-        return nullptr;
-    }
-
-    return inspectorCanvas.get();
-}
-
-InspectorCanvas* InspectorCanvasAgent::findInspectorCanvas(HTMLCanvasElement& canvasElement)
-{
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values()) {
-        if (&inspectorCanvas->canvas() == &canvasElement)
-            return inspectorCanvas.get();
-    }
-
-    return nullptr;
-}
-
-#if ENABLE(WEBGL)
-String InspectorCanvasAgent::unbindProgram(InspectorShaderProgram& inspectorProgram)
-{
-    ASSERT(inspectorProgram.context());
-
-    String identifier = inspectorProgram.identifier();
-    m_identifierToInspectorProgram.remove(identifier);
-
-    return identifier;
-}
-
-InspectorShaderProgram* InspectorCanvasAgent::assertInspectorProgram(ErrorString& errorString, const String& identifier)
-{
-    RefPtr<InspectorShaderProgram> inspectorProgram = m_identifierToInspectorProgram.get(identifier);
-    if (!inspectorProgram) {
-        errorString = ASCIILiteral("No shader program for given identifier.");
-        return nullptr;
-    }
-
-    return inspectorProgram.get();
-}
-
-InspectorShaderProgram* InspectorCanvasAgent::findInspectorProgram(WebGLProgram& program)
-{
-    for (auto& inspectorProgram : m_identifierToInspectorProgram.values()) {
-        if (&inspectorProgram->program() == &program)
-            return inspectorProgram.get();
-    }
-
-    return nullptr;
-}
-#endif
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCanvasAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorCanvasAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCanvasAgent.h    2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorCanvasAgent.h       2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,128 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 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. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "CallTracerTypes.h"
-#include "HTMLCanvasElement.h"
-#include "InspectorCanvas.h"
-#include "InspectorWebAgentBase.h"
-#include "Timer.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <wtf/HashMap.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(WEBGL)
-#include "InspectorShaderProgram.h"
-#endif
-
-namespace Inspector {
-class InjectedScriptManager;
-}
-
-namespace WebCore {
-
-class CanvasRenderingContext;
-#if ENABLE(WEBGL)
-class WebGLProgram;
-class WebGLRenderingContextBase;
-#endif
-
-typedef String ErrorString;
-
-class InspectorCanvasAgent final : public InspectorAgentBase, public CanvasObserver, public Inspector::CanvasBackendDispatcherHandler {
-    WTF_MAKE_NONCOPYABLE(InspectorCanvasAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit InspectorCanvasAgent(WebAgentContext&);
-    virtual ~InspectorCanvasAgent() = default;
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-    void discardAgent() override;
-
-    // CanvasBackendDispatcherHandler
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void requestNode(ErrorString&, const String& canvasId, int* nodeId) override;
-    void requestContent(ErrorString&, const String& canvasId, String* content) override;
-    void requestCSSCanvasClientNodes(ErrorString&, const String& canvasId, RefPtr<Inspector::Protocol::Array<int>>&) override;
-    void resolveCanvasContext(ErrorString&, const String& canvasId, const String* const objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>&) override;
-    void startRecording(ErrorString&, const String& canvasId, const bool* const singleFrame, const int* const memoryLimit) override;
-    void stopRecording(ErrorString&, const String& canvasId) override;
-    void requestShaderSource(ErrorString&, const String& programId, const String& shaderType, String*) override;
-    void updateShader(ErrorString&, const String& programId, const String& shaderType, const String& source) override;
-    void setShaderProgramDisabled(ErrorString&, const String& programId, bool disabled) override;
-
-    // InspectorInstrumentation
-    void frameNavigated(Frame&);
-    void didCreateCSSCanvas(HTMLCanvasElement&, const String&);
-    void didChangeCSSCanvasClientNodes(HTMLCanvasElement&);
-    void didCreateCanvasRenderingContext(HTMLCanvasElement&);
-    void didChangeCanvasMemory(HTMLCanvasElement&);
-    void recordCanvasAction(CanvasRenderingContext&, const String&, Vector<RecordCanvasActionVariant>&& = { });
-    void didFinishRecordingCanvasFrame(HTMLCanvasElement&, bool forceDispatch = false);
-#if ENABLE(WEBGL)
-    void didCreateProgram(WebGLRenderingContextBase&, WebGLProgram&);
-    void willDeleteProgram(WebGLProgram&);
-    bool isShaderProgramDisabled(WebGLProgram&);
-#endif
-
-    // CanvasObserver
-    void canvasChanged(HTMLCanvasElement&, const FloatRect&) override { }
-    void canvasResized(HTMLCanvasElement&) override { }
-    void canvasDestroyed(HTMLCanvasElement&) override;
-
-private:
-    void canvasDestroyedTimerFired();
-    void canvasRecordingTimerFired();
-    void clearCanvasData();
-    String unbindCanvas(InspectorCanvas&);
-    InspectorCanvas* assertInspectorCanvas(ErrorString&, const String& identifier);
-    InspectorCanvas* findInspectorCanvas(HTMLCanvasElement&);
-#if ENABLE(WEBGL)
-    String unbindProgram(InspectorShaderProgram&);
-    InspectorShaderProgram* assertInspectorProgram(ErrorString&, const String& identifier);
-    InspectorShaderProgram* findInspectorProgram(WebGLProgram&);
-
-    HashMap<String, RefPtr<InspectorShaderProgram>> m_identifierToInspectorProgram;
-#endif
-
-    std::unique_ptr<Inspector::CanvasFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::CanvasBackendDispatcher> m_backendDispatcher;
-    Inspector::InjectedScriptManager& m_injectedScriptManager;
-    HashMap<String, RefPtr<InspectorCanvas>> m_identifierToInspectorCanvas;
-    HashMap<HTMLCanvasElement*, String> m_canvasToCSSCanvasName;
-    Vector<String> m_removedCanvasIdentifiers;
-    Timer m_canvasDestroyedTimer;
-    Timer m_canvasRecordingTimer;
-
-    bool m_enabled { false };
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp     2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,2400 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009, 2015-2016 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorDOMAgent.h"
-
-#include "AXObjectCache.h"
-#include "AccessibilityNodeObject.h"
-#include "Attr.h"
-#include "CSSComputedStyleDeclaration.h"
-#include "CSSPropertyNames.h"
-#include "CSSPropertySourceData.h"
-#include "CSSRule.h"
-#include "CSSRuleList.h"
-#include "CSSStyleRule.h"
-#include "CSSStyleSheet.h"
-#include "CharacterData.h"
-#include "CommandLineAPIHost.h"
-#include "ContainerNode.h"
-#include "Cookie.h"
-#include "CookieJar.h"
-#include "DOMEditor.h"
-#include "DOMException.h"
-#include "DOMPatchSupport.h"
-#include "DOMWindow.h"
-#include "Document.h"
-#include "DocumentType.h"
-#include "Editing.h"
-#include "Element.h"
-#include "Event.h"
-#include "EventListener.h"
-#include "FrameTree.h"
-#include "HTMLElement.h"
-#include "HTMLFrameOwnerElement.h"
-#include "HTMLNames.h"
-#include "HTMLScriptElement.h"
-#include "HTMLStyleElement.h"
-#include "HTMLTemplateElement.h"
-#include "HitTestResult.h"
-#include "InspectorClient.h"
-#include "InspectorController.h"
-#include "InspectorHistory.h"
-#include "InspectorNodeFinder.h"
-#include "InspectorOverlay.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "IntRect.h"
-#include "JSDOMBindingSecurity.h"
-#include "JSEventListener.h"
-#include "JSNode.h"
-#include "MainFrame.h"
-#include "MutationEvent.h"
-#include "Node.h"
-#include "NodeList.h"
-#include "Page.h"
-#include "Pasteboard.h"
-#include "PseudoElement.h"
-#include "RenderStyle.h"
-#include "RenderStyleConstants.h"
-#include "ScriptState.h"
-#include "ShadowRoot.h"
-#include "StaticNodeList.h"
-#include "StyleProperties.h"
-#include "StyleResolver.h"
-#include "StyleSheetList.h"
-#include "Text.h"
-#include "TextNodeTraversal.h"
-#include "Timer.h"
-#include "WebInjectedScriptManager.h"
-#include "XPathResult.h"
-#include "markup.h"
-#include <inspector/IdentifiersFactory.h>
-#include <inspector/InjectedScript.h>
-#include <inspector/InjectedScriptManager.h>
-#include <pal/crypto/CryptoDigest.h>
-#include <runtime/JSCInlines.h>
-#include <wtf/text/Base64.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-
-namespace WebCore {
-using namespace Inspector;
-
-using namespace HTMLNames;
-
-static const size_t maxTextSize = 10000;
-static const UChar ellipsisUChar[] = { 0x2026, 0 };
-
-static Color parseColor(const InspectorObject* colorObject)
-{
-    if (!colorObject)
-        return Color::transparent;
-
-    int r = 0;
-    int g = 0;
-    int b = 0;
-    if (!colorObject->getInteger("r", r) || !colorObject->getInteger("g", g) || !colorObject->getInteger("b", b))
-        return Color::transparent;
-
-    double a = 1.0;
-    if (!colorObject->getDouble("a", a))
-        return Color(r, g, b);
-
-    // Clamp alpha to the [0..1] range.
-    if (a < 0)
-        a = 0;
-    else if (a > 1)
-        a = 1;
-
-    return Color(r, g, b, static_cast<int>(a * 255));
-}
-
-static Color parseConfigColor(const String& fieldName, const InspectorObject* configObject)
-{
-    RefPtr<InspectorObject> colorObject;
-    configObject->getObject(fieldName, colorObject);
-
-    return parseColor(colorObject.get());
-}
-
-static bool parseQuad(const InspectorArray& quadArray, FloatQuad* quad)
-{
-    const size_t coordinatesInQuad = 8;
-    double coordinates[coordinatesInQuad];
-    if (quadArray.length() != coordinatesInQuad)
-        return false;
-    for (size_t i = 0; i < coordinatesInQuad; ++i) {
-        if (!quadArray.get(i)->asDouble(*(coordinates + i)))
-            return false;
-    }
-    quad->setP1(FloatPoint(coordinates[0], coordinates[1]));
-    quad->setP2(FloatPoint(coordinates[2], coordinates[3]));
-    quad->setP3(FloatPoint(coordinates[4], coordinates[5]));
-    quad->setP4(FloatPoint(coordinates[6], coordinates[7]));
-
-    return true;
-}
-
-class RevalidateStyleAttributeTask {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    RevalidateStyleAttributeTask(InspectorDOMAgent*);
-    void scheduleFor(Element*);
-    void reset() { m_timer.stop(); }
-    void timerFired();
-
-private:
-    InspectorDOMAgent* m_domAgent;
-    Timer m_timer;
-    HashSet<RefPtr<Element>> m_elements;
-};
-
-RevalidateStyleAttributeTask::RevalidateStyleAttributeTask(InspectorDOMAgent* domAgent)
-    : m_domAgent(domAgent)
-    , m_timer(*this, &RevalidateStyleAttributeTask::timerFired)
-{
-}
-
-void RevalidateStyleAttributeTask::scheduleFor(Element* element)
-{
-    m_elements.add(element);
-    if (!m_timer.isActive())
-        m_timer.startOneShot(0_s);
-}
-
-void RevalidateStyleAttributeTask::timerFired()
-{
-    // The timer is stopped on m_domAgent destruction, so this method will never be called after m_domAgent has been destroyed.
-    Vector<Element*> elements;
-    for (auto& element : m_elements)
-        elements.append(element.get());
-    m_domAgent->styleAttributeInvalidated(elements);
-
-    m_elements.clear();
-}
-
-class InspectableNode final : public CommandLineAPIHost::InspectableObject {
-public:
-    explicit InspectableNode(Node* node)
-        : m_node(node)
-    {
-    }
-
-    JSC::JSValue get(JSC::ExecState& state) final
-    {
-        return InspectorDOMAgent::nodeAsScriptValue(state, m_node.get());
-    }
-private:
-    RefPtr<Node> m_node;
-};
-
-String InspectorDOMAgent::toErrorString(ExceptionCode ec)
-{
-    return ec ? String(DOMException::name(ec)) : emptyString();
-}
-
-String InspectorDOMAgent::toErrorString(Exception&& exception)
-{
-    return DOMException::name(exception.code());
-}
-
-InspectorDOMAgent::InspectorDOMAgent(WebAgentContext& context, InspectorPageAgent* pageAgent, InspectorOverlay* overlay)
-    : InspectorAgentBase(ASCIILiteral("DOM"), context)
-    , m_injectedScriptManager(context.injectedScriptManager)
-    , m_frontendDispatcher(std::make_unique<Inspector::DOMFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::DOMBackendDispatcher::create(context.backendDispatcher, this))
-    , m_pageAgent(pageAgent)
-    , m_overlay(overlay)
-{
-}
-
-InspectorDOMAgent::~InspectorDOMAgent()
-{
-    reset();
-    ASSERT(!m_searchingForNode);
-}
-
-void InspectorDOMAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-    m_history = std::make_unique<InspectorHistory>();
-    m_domEditor = std::make_unique<DOMEditor>(*m_history);
-
-    m_instrumentingAgents.setInspectorDOMAgent(this);
-    m_document = m_pageAgent->mainFrame().document();
-
-    if (m_nodeToFocus)
-        focusNode();
-}
-
-void InspectorDOMAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    m_history.reset();
-    m_domEditor.reset();
-    m_mousedOverNode = nullptr;
-
-    ErrorString unused;
-    setSearchingForNode(unused, false, nullptr);
-    hideHighlight(unused);
-
-    m_instrumentingAgents.setInspectorDOMAgent(nullptr);
-    m_documentRequested = false;
-    reset();
-}
-
-Vector<Document*> InspectorDOMAgent::documents()
-{
-    Vector<Document*> result;
-    for (Frame* frame = m_document->frame(); frame; frame = frame->tree().traverseNext()) {
-        Document* document = frame->document();
-        if (!document)
-            continue;
-        result.append(document);
-    }
-    return result;
-}
-
-void InspectorDOMAgent::reset()
-{
-    if (m_history)
-        m_history->reset();
-    m_searchResults.clear();
-    discardBindings();
-    if (m_revalidateStyleAttrTask)
-        m_revalidateStyleAttrTask->reset();
-    m_document = nullptr;
-}
-
-void InspectorDOMAgent::setDOMListener(DOMListener* listener)
-{
-    m_domListener = listener;
-}
-
-void InspectorDOMAgent::setDocument(Document* document)
-{
-    if (document == m_document.get())
-        return;
-
-    reset();
-
-    m_document = document;
-
-    if (!m_documentRequested)
-        return;
-
-    // Immediately communicate null document or document that has finished loading.
-    if (!document || !document->parsing())
-        m_frontendDispatcher->documentUpdated();
-}
-
-void InspectorDOMAgent::releaseDanglingNodes()
-{
-    m_danglingNodeToIdMaps.clear();
-}
-
-int InspectorDOMAgent::bind(Node* node, NodeToIdMap* nodesMap)
-{
-    int id = nodesMap->get(node);
-    if (id)
-        return id;
-    id = m_lastNodeId++;
-    nodesMap->set(node, id);
-    m_idToNode.set(id, node);
-    m_idToNodesMap.set(id, nodesMap);
-    return id;
-}
-
-void InspectorDOMAgent::unbind(Node* node, NodeToIdMap* nodesMap)
-{
-    int id = nodesMap->get(node);
-    if (!id)
-        return;
-
-    m_idToNode.remove(id);
-
-    if (node->isFrameOwnerElement()) {
-        const HTMLFrameOwnerElement* frameOwner = static_cast<const HTMLFrameOwnerElement*>(node);
-        if (Document* contentDocument = frameOwner->contentDocument())
-            unbind(contentDocument, nodesMap);
-    }
-
-    if (is<Element>(*node)) {
-        Element& element = downcast<Element>(*node);
-        if (ShadowRoot* root = element.shadowRoot())
-            unbind(root, nodesMap);
-        if (PseudoElement* beforeElement = element.beforePseudoElement())
-            unbind(beforeElement, nodesMap);
-        if (PseudoElement* afterElement = element.afterPseudoElement())
-            unbind(afterElement, nodesMap);
-    }
-
-    nodesMap->remove(node);
-    if (m_domListener)
-        m_domListener->didRemoveDOMNode(*node, id);
-
-    bool childrenRequested = m_childrenRequested.contains(id);
-    if (childrenRequested) {
-        // Unbind subtree known to client recursively.
-        m_childrenRequested.remove(id);
-        Node* child = innerFirstChild(node);
-        while (child) {
-            unbind(child, nodesMap);
-            child = innerNextSibling(child);
-        }
-    }
-}
-
-Node* InspectorDOMAgent::assertNode(ErrorString& errorString, int nodeId)
-{
-    Node* node = nodeForId(nodeId);
-    if (!node) {
-        errorString = ASCIILiteral("Could not find node with given id");
-        return nullptr;
-    }
-    return node;
-}
-
-Document* InspectorDOMAgent::assertDocument(ErrorString& errorString, int nodeId)
-{
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return nullptr;
-    if (!is<Document>(*node)) {
-        errorString = ASCIILiteral("Document is not available");
-        return nullptr;
-    }
-    return downcast<Document>(node);
-}
-
-Element* InspectorDOMAgent::assertElement(ErrorString& errorString, int nodeId)
-{
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return nullptr;
-    if (!is<Element>(*node)) {
-        errorString = ASCIILiteral("Node is not an Element");
-        return nullptr;
-    }
-    return downcast<Element>(node);
-}
-
-Node* InspectorDOMAgent::assertEditableNode(ErrorString& errorString, int nodeId)
-{
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return nullptr;
-    if (node->isInUserAgentShadowTree()) {
-        errorString = ASCIILiteral("Cannot edit nodes in user agent shadow trees");
-        return nullptr;
-    }
-    if (node->isPseudoElement()) {
-        errorString = ASCIILiteral("Cannot edit pseudo elements");
-        return nullptr;
-    }
-    return node;
-}
-
-Element* InspectorDOMAgent::assertEditableElement(ErrorString& errorString, int nodeId)
-{
-    Element* element = assertElement(errorString, nodeId);
-    if (!element)
-        return nullptr;
-    if (element->isInUserAgentShadowTree()) {
-        errorString = ASCIILiteral("Cannot edit elements in user agent shadow trees");
-        return nullptr;
-    }
-    if (element->isPseudoElement()) {
-        errorString = ASCIILiteral("Cannot edit pseudo elements");
-        return nullptr;
-    }
-    return element;
-}
-
-void InspectorDOMAgent::getDocument(ErrorString& errorString, RefPtr<Inspector::Protocol::DOM::Node>& root)
-{
-    m_documentRequested = true;
-
-    if (!m_document) {
-        errorString = ASCIILiteral("Document is not available");
-        return;
-    }
-
-    // Reset backend state.
-    RefPtr<Document> document = m_document;
-    reset();
-    m_document = document;
-
-    root = buildObjectForNode(m_document.get(), 2, &m_documentNodeToIdMap);
-}
-
-void InspectorDOMAgent::pushChildNodesToFrontend(int nodeId, int depth)
-{
-    Node* node = nodeForId(nodeId);
-    if (!node || (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE && node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE))
-        return;
-
-    NodeToIdMap* nodeMap = m_idToNodesMap.get(nodeId);
-
-    if (m_childrenRequested.contains(nodeId)) {
-        if (depth <= 1)
-            return;
-
-        depth--;
-
-        for (node = innerFirstChild(node); node; node = innerNextSibling(node)) {
-            int childNodeId = nodeMap->get(node);
-            ASSERT(childNodeId);
-            pushChildNodesToFrontend(childNodeId, depth);
-        }
-
-        return;
-    }
-
-    auto children = buildArrayForContainerChildren(node, depth, nodeMap);
-    m_frontendDispatcher->setChildNodes(nodeId, WTFMove(children));
-}
-
-void InspectorDOMAgent::discardBindings()
-{
-    m_documentNodeToIdMap.clear();
-    m_idToNode.clear();
-    m_eventListenerEntries.clear();
-    releaseDanglingNodes();
-    m_childrenRequested.clear();
-    m_backendIdToNode.clear();
-    m_nodeGroupToBackendIdMap.clear();
-}
-
-int InspectorDOMAgent::pushNodeToFrontend(ErrorString& errorString, int documentNodeId, Node* nodeToPush)
-{
-    Document* document = assertDocument(errorString, documentNodeId);
-    if (!document)
-        return 0;
-    if (&nodeToPush->document() != document) {
-        errorString = ASCIILiteral("Node is not part of the document with given id");
-        return 0;
-    }
-
-    return pushNodePathToFrontend(nodeToPush);
-}
-
-Node* InspectorDOMAgent::nodeForId(int id)
-{
-    if (!id)
-        return 0;
-
-    HashMap<int, Node*>::iterator it = m_idToNode.find(id);
-    if (it != m_idToNode.end())
-        return it->value;
-    return 0;
-}
-
-void InspectorDOMAgent::requestChildNodes(ErrorString& errorString, int nodeId, const int* depth)
-{
-    int sanitizedDepth;
-
-    if (!depth)
-        sanitizedDepth = 1;
-    else if (*depth == -1)
-        sanitizedDepth = INT_MAX;
-    else if (*depth > 0)
-        sanitizedDepth = *depth;
-    else {
-        errorString = ASCIILiteral("Please provide a positive integer as a depth or -1 for entire subtree");
-        return;
-    }
-
-    pushChildNodesToFrontend(nodeId, sanitizedDepth);
-}
-
-void InspectorDOMAgent::querySelector(ErrorString& errorString, int nodeId, const String& selectors, int* elementId)
-{
-    *elementId = 0;
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return;
-    if (!is<ContainerNode>(*node)) {
-        assertElement(errorString, nodeId);
-        return;
-    }
-
-    auto queryResult = downcast<ContainerNode>(*node).querySelector(selectors);
-    if (queryResult.hasException()) {
-        errorString = ASCIILiteral("DOM Error while querying");
-        return;
-    }
-
-    if (auto* element = queryResult.releaseReturnValue())
-        *elementId = pushNodePathToFrontend(element);
-}
-
-void InspectorDOMAgent::querySelectorAll(ErrorString& errorString, int nodeId, const String& selectors, RefPtr<Inspector::Protocol::Array<int>>& result)
-{
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return;
-    if (!is<ContainerNode>(*node)) {
-        assertElement(errorString, nodeId);
-        return;
-    }
-
-    auto queryResult = downcast<ContainerNode>(*node).querySelectorAll(selectors);
-    if (queryResult.hasException()) {
-        errorString = ASCIILiteral("DOM Error while querying");
-        return;
-    }
-
-    auto nodes = queryResult.releaseReturnValue();
-    result = Inspector::Protocol::Array<int>::create();
-    for (unsigned i = 0; i < nodes->length(); ++i)
-        result->addItem(pushNodePathToFrontend(nodes->item(i)));
-}
-
-int InspectorDOMAgent::pushNodePathToFrontend(Node* nodeToPush)
-{
-    ASSERT(nodeToPush);  // Invalid input
-
-    if (!m_document)
-        return 0;
-    if (!m_documentNodeToIdMap.contains(m_document))
-        return 0;
-
-    // Return id in case the node is known.
-    int result = m_documentNodeToIdMap.get(nodeToPush);
-    if (result)
-        return result;
-
-    Node* node = nodeToPush;
-    Vector<Node*> path;
-    NodeToIdMap* danglingMap = 0;
-
-    while (true) {
-        Node* parent = innerParentNode(node);
-        if (!parent) {
-            // Node being pushed is detached -> push subtree root.
-            auto newMap = std::make_unique<NodeToIdMap>();
-            danglingMap = newMap.get();
-            m_danglingNodeToIdMaps.append(newMap.release());
-            auto children = Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>::create();
-            children->addItem(buildObjectForNode(node, 0, danglingMap));
-            m_frontendDispatcher->setChildNodes(0, WTFMove(children));
-            break;
-        } else {
-            path.append(parent);
-            if (m_documentNodeToIdMap.get(parent))
-                break;
-            else
-                node = parent;
-        }
-    }
-
-    NodeToIdMap* map = danglingMap ? danglingMap : &m_documentNodeToIdMap;
-    for (int i = path.size() - 1; i >= 0; --i) {
-        int nodeId = map->get(path.at(i));
-        ASSERT(nodeId);
-        pushChildNodesToFrontend(nodeId);
-    }
-    return map->get(nodeToPush);
-}
-
-int InspectorDOMAgent::boundNodeId(const Node* node)
-{
-    return m_documentNodeToIdMap.get(const_cast<Node*>(node));
-}
-
-BackendNodeId InspectorDOMAgent::backendNodeIdForNode(Node* node, const String& nodeGroup)
-{
-    if (!node)
-        return 0;
-
-    if (!m_nodeGroupToBackendIdMap.contains(nodeGroup))
-        m_nodeGroupToBackendIdMap.set(nodeGroup, NodeToBackendIdMap());
-
-    NodeToBackendIdMap& map = m_nodeGroupToBackendIdMap.find(nodeGroup)->value;
-    BackendNodeId id = map.get(node);
-    if (!id) {
-        id = --m_lastBackendNodeId;
-        map.set(node, id);
-        m_backendIdToNode.set(id, std::make_pair(node, nodeGroup));
-    }
-
-    return id;
-}
-
-void InspectorDOMAgent::releaseBackendNodeIds(ErrorString& errorString, const String& nodeGroup)
-{
-    if (m_nodeGroupToBackendIdMap.contains(nodeGroup)) {
-        NodeToBackendIdMap& map = m_nodeGroupToBackendIdMap.find(nodeGroup)->value;
-        for (auto& backendId : map.values())
-            m_backendIdToNode.remove(backendId);
-        m_nodeGroupToBackendIdMap.remove(nodeGroup);
-        return;
-    }
-    errorString = ASCIILiteral("Group name not found");
-}
-
-void InspectorDOMAgent::setAttributeValue(ErrorString& errorString, int elementId, const String& name, const String& value)
-{
-    Element* element = assertEditableElement(errorString, elementId);
-    if (!element)
-        return;
-
-    m_domEditor->setAttribute(*element, name, value, errorString);
-}
-
-void InspectorDOMAgent::setAttributesAsText(ErrorString& errorString, int elementId, const String& text, const String* const name)
-{
-    Element* element = assertEditableElement(errorString, elementId);
-    if (!element)
-        return;
-
-    auto parsedElement = createHTMLElement(element->document(), spanTag);
-    auto result = parsedElement.get().setInnerHTML("<span " + text + "></span>");
-    if (result.hasException()) {
-        errorString = toErrorString(result.releaseException());
-        return;
-    }
-
-    Node* child = parsedElement->firstChild();
-    if (!child) {
-        errorString = ASCIILiteral("Could not parse value as attributes");
-        return;
-    }
-
-    Element* childElement = downcast<Element>(child);
-    if (!childElement->hasAttributes() && name) {
-        m_domEditor->removeAttribute(*element, *name, errorString);
-        return;
-    }
-
-    bool foundOriginalAttribute = false;
-    for (const Attribute& attribute : childElement->attributesIterator()) {
-        // Add attribute pair
-        foundOriginalAttribute = foundOriginalAttribute || (name && attribute.name().toString() == *name);
-        if (!m_domEditor->setAttribute(*element, attribute.name().toString(), attribute.value(), errorString))
-            return;
-    }
-
-    if (!foundOriginalAttribute && name && !name->stripWhiteSpace().isEmpty())
-        m_domEditor->removeAttribute(*element, *name, errorString);
-}
-
-void InspectorDOMAgent::removeAttribute(ErrorString& errorString, int elementId, const String& name)
-{
-    Element* element = assertEditableElement(errorString, elementId);
-    if (!element)
-        return;
-
-    m_domEditor->removeAttribute(*element, name, errorString);
-}
-
-void InspectorDOMAgent::removeNode(ErrorString& errorString, int nodeId)
-{
-    Node* node = assertEditableNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    ContainerNode* parentNode = node->parentNode();
-    if (!parentNode) {
-        errorString = ASCIILiteral("Cannot remove detached node");
-        return;
-    }
-
-    m_domEditor->removeChild(*parentNode, *node, errorString);
-}
-
-void InspectorDOMAgent::setNodeName(ErrorString& errorString, int nodeId, const String& tagName, int* newId)
-{
-    *newId = 0;
-
-    RefPtr<Node> oldNode = nodeForId(nodeId);
-    if (!is<Element>(oldNode))
-        return;
-
-    auto createElementResult = oldNode->document().createElementForBindings(tagName);
-    if (createElementResult.hasException())
-        return;
-    auto newElement = createElementResult.releaseReturnValue();
-
-    // Copy over the original node's attributes.
-    newElement->cloneAttributesFromElement(downcast<Element>(*oldNode));
-
-    // Copy over the original node's children.
-    RefPtr<Node> child;
-    while ((child = oldNode->firstChild())) {
-        if (!m_domEditor->insertBefore(newElement, *child, 0, errorString))
-            return;
-    }
-
-    // Replace the old node with the new node
-    RefPtr<ContainerNode> parent = oldNode->parentNode();
-    if (!m_domEditor->insertBefore(*parent, newElement.copyRef(), oldNode->nextSibling(), errorString))
-        return;
-    if (!m_domEditor->removeChild(*parent, *oldNode, errorString))
-        return;
-
-    *newId = pushNodePathToFrontend(newElement.ptr());
-    if (m_childrenRequested.contains(nodeId))
-        pushChildNodesToFrontend(*newId);
-}
-
-void InspectorDOMAgent::getOuterHTML(ErrorString& errorString, int nodeId, WTF::String* outerHTML)
-{
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    *outerHTML = createMarkup(*node);
-}
-
-void InspectorDOMAgent::setOuterHTML(ErrorString& errorString, int nodeId, const String& outerHTML)
-{
-    if (!nodeId) {
-        DOMPatchSupport { *m_domEditor, *m_document }.patchDocument(outerHTML);
-        return;
-    }
-
-    Node* node = assertEditableNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    Document& document = node->document();
-    if (!document.isHTMLDocument() && !document.isXMLDocument()) {
-        errorString = ASCIILiteral("Not an HTML/XML document");
-        return;
-    }
-
-    Node* newNode = nullptr;
-    if (!m_domEditor->setOuterHTML(*node, outerHTML, newNode, errorString))
-        return;
-
-    if (!newNode) {
-        // The only child node has been deleted.
-        return;
-    }
-
-    int newId = pushNodePathToFrontend(newNode);
-
-    bool childrenRequested = m_childrenRequested.contains(nodeId);
-    if (childrenRequested)
-        pushChildNodesToFrontend(newId);
-}
-
-void InspectorDOMAgent::setNodeValue(ErrorString& errorString, int nodeId, const String& value)
-{
-    Node* node = assertEditableNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    if (!is<Text>(*node)) {
-        errorString = ASCIILiteral("Can only set value of text nodes");
-        return;
-    }
-
-    m_domEditor->replaceWholeText(downcast<Text>(*node), value, errorString);
-}
-
-void InspectorDOMAgent::getEventListenersForNode(ErrorString& errorString, int nodeId, const String* objectGroup, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::EventListener>>& listenersArray)
-{
-    listenersArray = Inspector::Protocol::Array<Inspector::Protocol::DOM::EventListener>::create();
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return;
-    Vector<EventListenerInfo> eventInformation;
-    getEventListeners(node, eventInformation, true);
-
-    auto addListener = [&] (RegisteredEventListener& listener, const EventListenerInfo& info) {
-        int identifier = 0;
-        bool disabled = false;
-
-        auto it = m_eventListenerEntries.find(&listener.callback());
-        if (it == m_eventListenerEntries.end()) {
-            InspectorEventListener inspectorEventListener(m_lastEventListenerId++, *info.node, info.eventType, listener.useCapture());
-            m_eventListenerEntries.add(&listener.callback(), inspectorEventListener);
-
-            identifier = inspectorEventListener.identifier;
-            disabled = inspectorEventListener.disabled;
-        } else {
-            identifier = it->value.identifier;
-            disabled = it->value.disabled;
-        }
-
-        listenersArray->addItem(buildObjectForEventListener(listener, identifier, info.eventType, info.node, objectGroup, disabled));
-    };
-
-    // Get Capturing Listeners (in this order)
-    size_t eventInformationLength = eventInformation.size();
-    for (auto& info : eventInformation) {
-        for (auto& listener : info.eventListenerVector) {
-            if (listener->useCapture())
-                addListener(*listener, info);
-        }
-    }
-
-    // Get Bubbling Listeners (reverse order)
-    for (size_t i = eventInformationLength; i; --i) {
-        const EventListenerInfo& info = eventInformation[i - 1];
-        for (auto& listener : info.eventListenerVector) {
-            if (!listener->useCapture())
-                addListener(*listener, info);
-        }
-    }
-}
-
-void InspectorDOMAgent::getEventListeners(Node* node, Vector<EventListenerInfo>& eventInformation, bool includeAncestors)
-{
-    // The Node's Ancestors including self.
-    Vector<Node*> ancestors;
-    // Push this node as the firs element.
-    ancestors.append(node);
-    if (includeAncestors) {
-        for (ContainerNode* ancestor = node->parentOrShadowHostNode(); ancestor; ancestor = ancestor->parentOrShadowHostNode())
-            ancestors.append(ancestor);
-    }
-
-    // Nodes and their Listeners for the concerned event types (order is top to bottom)
-    for (size_t i = ancestors.size(); i; --i) {
-        Node* ancestor = ancestors[i - 1];
-        EventTargetData* d = ancestor->eventTargetData();
-        if (!d)
-            continue;
-        // Get the list of event types this Node is concerned with
-        for (auto& type : d->eventListenerMap.eventTypes()) {
-            auto& listeners = ancestor->eventListeners(type);
-            EventListenerVector filteredListeners;
-            filteredListeners.reserveInitialCapacity(listeners.size());
-            for (auto& listener : listeners) {
-                if (listener->callback().type() == EventListener::JSEventListenerType)
-                    filteredListeners.uncheckedAppend(listener);
-            }
-            if (!filteredListeners.isEmpty())
-                eventInformation.append(EventListenerInfo(ancestor, type, WTFMove(filteredListeners)));
-        }
-    }
-}
-
-void InspectorDOMAgent::setEventListenerDisabled(ErrorString& errorString, int eventListenerId, bool disabled)
-{
-    for (InspectorEventListener& inspectorEventListener : m_eventListenerEntries.values()) {
-        if (inspectorEventListener.identifier == eventListenerId) {
-            inspectorEventListener.disabled = disabled;
-            return;
-        }
-    }
-
-    errorString = ASCIILiteral("No event listener for given identifier.");
-}
-
-void InspectorDOMAgent::getAccessibilityPropertiesForNode(ErrorString& errorString, int nodeId, RefPtr<Inspector::Protocol::DOM::AccessibilityProperties>& axProperties)
-{
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    axProperties = buildObjectForAccessibilityProperties(node);
-}
-
-void InspectorDOMAgent::performSearch(ErrorString& errorString, const String& whitespaceTrimmedQuery, const InspectorArray* nodeIds, String* searchId, int* resultCount)
-{
-    // FIXME: Search works with node granularity - number of matches within node is not calculated.
-    InspectorNodeFinder finder(whitespaceTrimmedQuery);
-
-    if (nodeIds) {
-        for (auto& nodeValue : *nodeIds) {
-            if (!nodeValue) {
-                errorString = ASCIILiteral("Invalid nodeIds item.");
-                return;
-            }
-            int nodeId = 0;
-            if (!nodeValue->asInteger(nodeId)) {
-                errorString = ASCIILiteral("Invalid nodeIds item type. Expecting integer types.");
-                return;
-            }
-            Node* node = assertNode(errorString, nodeId);
-            if (!node) {
-                // assertNode should have filled the errorString for us.
-                ASSERT(errorString.length());
-                return;
-            }
-            finder.performSearch(node);
-        }
-    } else {
-        // There's no need to iterate the frames tree because
-        // the search helper will go inside the frame owner elements.
-        finder.performSearch(m_document.get());
-    }
-
-    *searchId = IdentifiersFactory::createIdentifier();
-
-    auto& resultsVector = m_searchResults.add(*searchId, Vector<RefPtr<Node>>()).iterator->value;
-    for (auto& result : finder.results())
-        resultsVector.append(result);
-
-    *resultCount = resultsVector.size();
-}
-
-void InspectorDOMAgent::getSearchResults(ErrorString& errorString, const String& searchId, int fromIndex, int toIndex, RefPtr<Inspector::Protocol::Array<int>>& nodeIds)
-{
-    SearchResults::iterator it = m_searchResults.find(searchId);
-    if (it == m_searchResults.end()) {
-        errorString = ASCIILiteral("No search session with given id found");
-        return;
-    }
-
-    int size = it->value.size();
-    if (fromIndex < 0 || toIndex > size || fromIndex >= toIndex) {
-        errorString = ASCIILiteral("Invalid search result range");
-        return;
-    }
-
-    nodeIds = Inspector::Protocol::Array<int>::create();
-    for (int i = fromIndex; i < toIndex; ++i)
-        nodeIds->addItem(pushNodePathToFrontend((it->value)[i].get()));
-}
-
-void InspectorDOMAgent::discardSearchResults(ErrorString&, const String& searchId)
-{
-    m_searchResults.remove(searchId);
-}
-
-bool InspectorDOMAgent::handleMousePress()
-{
-    if (!m_searchingForNode)
-        return false;
-
-    if (Node* node = m_overlay->highlightedNode()) {
-        inspect(node);
-        return true;
-    }
-    return false;
-}
-
-bool InspectorDOMAgent::handleTouchEvent(Node& node)
-{
-    if (!m_searchingForNode)
-        return false;
-    if (m_inspectModeHighlightConfig) {
-        m_overlay->highlightNode(&node, *m_inspectModeHighlightConfig);
-        inspect(&node);
-        return true;
-    }
-    return false;
-}
-
-void InspectorDOMAgent::inspect(Node* inspectedNode)
-{
-    ErrorString unused;
-    RefPtr<Node> node = inspectedNode;
-    setSearchingForNode(unused, false, nullptr);
-
-    if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE)
-        node = node->parentNode();
-    m_nodeToFocus = node;
-
-    if (!m_nodeToFocus)
-        return;
-
-    focusNode();
-}
-
-void InspectorDOMAgent::focusNode()
-{
-    if (!m_frontendDispatcher)
-        return;
-
-    ASSERT(m_nodeToFocus);
-
-    RefPtr<Node> node = m_nodeToFocus.get();
-    m_nodeToFocus = nullptr;
-
-    Frame* frame = node->document().frame();
-    if (!frame)
-        return;
-
-    JSC::ExecState* scriptState = mainWorldExecState(frame);
-    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState);
-    if (injectedScript.hasNoValue())
-        return;
-
-    injectedScript.inspectObject(nodeAsScriptValue(*scriptState, node.get()));
-}
-
-void InspectorDOMAgent::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
-{
-    m_mousedOverNode = result.innerNode();
-
-    if (!m_searchingForNode)
-        return;
-
-    highlightMousedOverNode();
-}
-
-void InspectorDOMAgent::highlightMousedOverNode()
-{
-    Node* node = m_mousedOverNode.get();
-    while (node && node->nodeType() == Node::TEXT_NODE)
-        node = node->parentNode();
-    if (node && m_inspectModeHighlightConfig)
-        m_overlay->highlightNode(node, *m_inspectModeHighlightConfig);
-}
-
-void InspectorDOMAgent::setSearchingForNode(ErrorString& errorString, bool enabled, const InspectorObject* highlightInspectorObject)
-{
-    if (m_searchingForNode == enabled)
-        return;
-
-    m_searchingForNode = enabled;
-
-    if (enabled) {
-        m_inspectModeHighlightConfig = highlightConfigFromInspectorObject(errorString, highlightInspectorObject);
-        if (!m_inspectModeHighlightConfig)
-            return;
-        highlightMousedOverNode();
-    } else
-        hideHighlight(errorString);
-
-    m_overlay->didSetSearchingForNode(m_searchingForNode);
-
-    if (InspectorClient* client = m_pageAgent->page().inspectorController().inspectorClient())
-        client->elementSelectionChanged(m_searchingForNode);
-}
-
-std::unique_ptr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString& errorString, const InspectorObject* highlightInspectorObject)
-{
-    if (!highlightInspectorObject) {
-        errorString = ASCIILiteral("Internal error: highlight configuration parameter is missing");
-        return nullptr;
-    }
-
-    auto highlightConfig = std::make_unique<HighlightConfig>();
-    bool showInfo = false; // Default: false (do not show a tooltip).
-    highlightInspectorObject->getBoolean("showInfo", showInfo);
-    highlightConfig->showInfo = showInfo;
-    highlightConfig->content = parseConfigColor("contentColor", highlightInspectorObject);
-    highlightConfig->contentOutline = parseConfigColor("contentOutlineColor", highlightInspectorObject);
-    highlightConfig->padding = parseConfigColor("paddingColor", highlightInspectorObject);
-    highlightConfig->border = parseConfigColor("borderColor", highlightInspectorObject);
-    highlightConfig->margin = parseConfigColor("marginColor", highlightInspectorObject);
-    return highlightConfig;
-}
-
-void InspectorDOMAgent::setInspectModeEnabled(ErrorString& errorString, bool enabled, const InspectorObject* highlightConfig)
-{
-    setSearchingForNode(errorString, enabled, highlightConfig ? highlightConfig : nullptr);
-}
-
-void InspectorDOMAgent::highlightRect(ErrorString&, int x, int y, int width, int height, const InspectorObject* color, const InspectorObject* outlineColor, const bool* usePageCoordinates)
-{
-    auto quad = std::make_unique<FloatQuad>(FloatRect(x, y, width, height));
-    innerHighlightQuad(WTFMove(quad), color, outlineColor, usePageCoordinates);
-}
-
-void InspectorDOMAgent::highlightQuad(ErrorString& errorString, const InspectorArray& quadArray, const InspectorObject* color, const InspectorObject* outlineColor, const bool* usePageCoordinates)
-{
-    auto quad = std::make_unique<FloatQuad>();
-    if (!parseQuad(quadArray, quad.get())) {
-        errorString = ASCIILiteral("Invalid Quad format");
-        return;
-    }
-    innerHighlightQuad(WTFMove(quad), color, outlineColor, usePageCoordinates);
-}
-
-void InspectorDOMAgent::innerHighlightQuad(std::unique_ptr<FloatQuad> quad, const InspectorObject* color, const InspectorObject* outlineColor, const bool* usePageCoordinates)
-{
-    auto highlightConfig = std::make_unique<HighlightConfig>();
-    highlightConfig->content = parseColor(color);
-    highlightConfig->contentOutline = parseColor(outlineColor);
-    highlightConfig->usePageCoordinates = usePageCoordinates ? *usePageCoordinates : false;
-    m_overlay->highlightQuad(WTFMove(quad), *highlightConfig);
-}
-
-void InspectorDOMAgent::highlightSelector(ErrorString& errorString, const InspectorObject& highlightInspectorObject, const String& selectorString, const String* frameId)
-{
-    RefPtr<Document> document;
-
-    if (frameId) {
-        Frame* frame = m_pageAgent->frameForId(*frameId);
-        if (!frame) {
-            errorString = ASCIILiteral("No frame for given id found");
-            return;
-        }
-
-        document = frame->document();
-    } else
-        document = m_document;
-
-    if (!document) {
-        errorString = ASCIILiteral("Document could not be found");
-        return;
-    }
-
-    auto queryResult = document->querySelectorAll(selectorString);
-    // FIXME: <https://webkit.org/b/146161> Web Inspector: DOM.highlightSelector should work for "a:visited"
-    if (queryResult.hasException()) {
-        errorString = ASCIILiteral("DOM Error while querying");
-        return;
-    }
-
-    auto highlightConfig = highlightConfigFromInspectorObject(errorString, &highlightInspectorObject);
-    if (!highlightConfig)
-        return;
-
-    m_overlay->highlightNodeList(queryResult.releaseReturnValue(), *highlightConfig);
-}
-
-void InspectorDOMAgent::highlightNode(ErrorString& errorString, const InspectorObject& highlightInspectorObject, const int* nodeId, const String* objectId)
-{
-    Node* node = nullptr;
-    if (nodeId)
-        node = assertNode(errorString, *nodeId);
-    else if (objectId) {
-        node = nodeForObjectId(*objectId);
-        if (!node)
-            errorString = ASCIILiteral("Node for given objectId not found");
-    } else
-        errorString = ASCIILiteral("Either nodeId or objectId must be specified");
-
-    if (!node)
-        return;
-
-    std::unique_ptr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, &highlightInspectorObject);
-    if (!highlightConfig)
-        return;
-
-    m_overlay->highlightNode(node, *highlightConfig);
-}
-
-void InspectorDOMAgent::highlightNodeList(ErrorString& errorString, const InspectorArray& nodeIds, const InspectorObject& highlightInspectorObject)
-{
-    Vector<Ref<Node>> nodes;
-    for (auto& nodeValue : nodeIds) {
-        if (!nodeValue) {
-            errorString = ASCIILiteral("Invalid nodeIds item.");
-            return;
-        }
-
-        int nodeId = 0;
-        if (!nodeValue->asInteger(nodeId)) {
-            errorString = ASCIILiteral("Invalid nodeIds item type. Expecting integer types.");
-            return;
-        }
-
-        // In the case that a node is removed in the time between when highlightNodeList is invoked
-        // by the frontend and it is executed by the backend, we should still attempt to highlight
-        // as many nodes as possible. As such, we should ignore any errors generated when attempting
-        // to get a Node from a given nodeId. 
-        ErrorString ignored;
-        Node* node = assertNode(ignored, nodeId);
-        if (!node)
-            continue;
-
-        nodes.append(*node);
-    }
-
-    std::unique_ptr<HighlightConfig> highlightConfig = highlightConfigFromInspectorObject(errorString, &highlightInspectorObject);
-    if (!highlightConfig)
-        return;
-
-    m_overlay->highlightNodeList(StaticNodeList::create(WTFMove(nodes)), *highlightConfig);
-}
-
-void InspectorDOMAgent::highlightFrame(ErrorString& errorString, const String& frameId, const InspectorObject* color, const InspectorObject* outlineColor)
-{
-    Frame* frame = m_pageAgent->assertFrame(errorString, frameId);
-    if (!frame)
-        return;
-
-    if (frame->ownerElement()) {
-        auto highlightConfig = std::make_unique<HighlightConfig>();
-        highlightConfig->showInfo = true; // Always show tooltips for frames.
-        highlightConfig->content = parseColor(color);
-        highlightConfig->contentOutline = parseColor(outlineColor);
-        m_overlay->highlightNode(frame->ownerElement(), *highlightConfig);
-    }
-}
-
-void InspectorDOMAgent::hideHighlight(ErrorString&)
-{
-    m_overlay->hideHighlight();
-}
-
-void InspectorDOMAgent::moveTo(ErrorString& errorString, int nodeId, int targetElementId, const int* const anchorNodeId, int* newNodeId)
-{
-    Node* node = assertEditableNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    Element* targetElement = assertEditableElement(errorString, targetElementId);
-    if (!targetElement)
-        return;
-
-    Node* anchorNode = 0;
-    if (anchorNodeId && *anchorNodeId) {
-        anchorNode = assertEditableNode(errorString, *anchorNodeId);
-        if (!anchorNode)
-            return;
-        if (anchorNode->parentNode() != targetElement) {
-            errorString = ASCIILiteral("Anchor node must be child of the target element");
-            return;
-        }
-    }
-
-    if (!m_domEditor->insertBefore(*targetElement, *node, anchorNode, errorString))
-        return;
-
-    *newNodeId = pushNodePathToFrontend(node);
-}
-
-void InspectorDOMAgent::undo(ErrorString& errorString)
-{
-    auto result = m_history->undo();
-    if (result.hasException())
-        errorString = toErrorString(result.releaseException());
-}
-
-void InspectorDOMAgent::redo(ErrorString& errorString)
-{
-    auto result = m_history->redo();
-    if (result.hasException())
-        errorString = toErrorString(result.releaseException());
-}
-
-void InspectorDOMAgent::markUndoableState(ErrorString&)
-{
-    m_history->markUndoableState();
-}
-
-void InspectorDOMAgent::focus(ErrorString& errorString, int nodeId)
-{
-    Element* element = assertElement(errorString, nodeId);
-    if (!element)
-        return;
-    if (!element->isFocusable()) {
-        errorString = ASCIILiteral("Element is not focusable");
-        return;
-    }
-    element->focus();
-}
-
-void InspectorDOMAgent::setInspectedNode(ErrorString& errorString, int nodeId)
-{
-    Node* node = nodeForId(nodeId);
-    if (!node || node->isInUserAgentShadowTree()) {
-        errorString = ASCIILiteral("No node with given id found");
-        return;
-    }
-
-    if (CommandLineAPIHost* commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost())
-        commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node));
-}
-
-void InspectorDOMAgent::resolveNode(ErrorString& errorString, int nodeId, const String* const objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result)
-{
-    String objectGroupName = objectGroup ? *objectGroup : emptyString();
-    Node* node = nodeForId(nodeId);
-    if (!node) {
-        errorString = ASCIILiteral("No node with given id found");
-        return;
-    }
-    RefPtr<Inspector::Protocol::Runtime::RemoteObject> object = resolveNode(node, objectGroupName);
-    if (!object) {
-        errorString = ASCIILiteral("Node with given id does not belong to the document");
-        return;
-    }
-    result = object;
-}
-
-void InspectorDOMAgent::getAttributes(ErrorString& errorString, int nodeId, RefPtr<Inspector::Protocol::Array<String>>& result)
-{
-    Element* element = assertElement(errorString, nodeId);
-    if (!element)
-        return;
-
-    result = buildArrayForElementAttributes(element);
-}
-
-void InspectorDOMAgent::requestNode(ErrorString&, const String& objectId, int* nodeId)
-{
-    Node* node = nodeForObjectId(objectId);
-    if (node)
-        *nodeId = pushNodePathToFrontend(node);
-    else
-        *nodeId = 0;
-}
-
-String InspectorDOMAgent::documentURLString(Document* document)
-{
-    if (!document || document->url().isNull())
-        return emptyString();
-    return document->url().string();
-}
-
-static String documentBaseURLString(Document* document)
-{
-    return document->completeURL(emptyString()).string();
-}
-
-static bool pseudoElementType(PseudoId pseudoId, Inspector::Protocol::DOM::PseudoType* type)
-{
-    switch (pseudoId) {
-    case BEFORE:
-        *type = Inspector::Protocol::DOM::PseudoType::Before;
-        return true;
-    case AFTER:
-        *type = Inspector::Protocol::DOM::PseudoType::After;
-        return true;
-    default:
-        return false;
-    }
-}
-
-static Inspector::Protocol::DOM::ShadowRootType shadowRootType(ShadowRootMode mode)
-{
-    switch (mode) {
-    case ShadowRootMode::UserAgent:
-        return Inspector::Protocol::DOM::ShadowRootType::UserAgent;
-    case ShadowRootMode::Closed:
-        return Inspector::Protocol::DOM::ShadowRootType::Closed;
-    case ShadowRootMode::Open:
-        return Inspector::Protocol::DOM::ShadowRootType::Open;
-    }
-
-    ASSERT_NOT_REACHED();
-    return Inspector::Protocol::DOM::ShadowRootType::UserAgent;
-}
-
-static Inspector::Protocol::DOM::CustomElementState customElementState(const Element& element)
-{
-    if (element.isDefinedCustomElement())
-        return Inspector::Protocol::DOM::CustomElementState::Custom;
-    if (element.isFailedCustomElement())
-        return Inspector::Protocol::DOM::CustomElementState::Failed;
-    if (element.isUndefinedCustomElement() || element.isCustomElementUpgradeCandidate())
-        return Inspector::Protocol::DOM::CustomElementState::Waiting;
-    return Inspector::Protocol::DOM::CustomElementState::Builtin;
-}
-
-static String computeContentSecurityPolicySHA256Hash(const Element& element)
-{
-    // FIXME: Compute the digest with respect to the raw bytes received from the page.
-    // See <https://bugs.webkit.org/show_bug.cgi?id=155184>.
-    TextEncoding documentEncoding = element.document().textEncoding();
-    const TextEncoding& encodingToUse = documentEncoding.isValid() ? documentEncoding : UTF8Encoding();
-    CString content = encodingToUse.encode(TextNodeTraversal::contentsAsString(element), EntitiesForUnencodables);
-    auto cryptoDigest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_256);
-    cryptoDigest->addBytes(content.data(), content.length());
-    Vector<uint8_t> digest = cryptoDigest->computeHash();
-    return makeString("sha256-", base64Encode(digest.data(), digest.size()));
-}
-
-Ref<Inspector::Protocol::DOM::Node> InspectorDOMAgent::buildObjectForNode(Node* node, int depth, NodeToIdMap* nodesMap)
-{
-    int id = bind(node, nodesMap);
-    String nodeName;
-    String localName;
-    String nodeValue;
-
-    switch (node->nodeType()) {
-    case Node::PROCESSING_INSTRUCTION_NODE:
-        nodeName = node->nodeName();
-        localName = node->localName();
-        FALLTHROUGH;
-    case Node::TEXT_NODE:
-    case Node::COMMENT_NODE:
-    case Node::CDATA_SECTION_NODE:
-        nodeValue = node->nodeValue();
-        if (nodeValue.length() > maxTextSize) {
-            nodeValue = nodeValue.left(maxTextSize);
-            nodeValue.append(ellipsisUChar);
-        }
-        break;
-    case Node::ATTRIBUTE_NODE:
-        localName = node->localName();
-        break;
-    case Node::DOCUMENT_FRAGMENT_NODE:
-    case Node::DOCUMENT_NODE:
-    case Node::ELEMENT_NODE:
-    default:
-        nodeName = node->nodeName();
-        localName = node->localName();
-        break;
-    }
-
-    auto value = Inspector::Protocol::DOM::Node::create()
-        .setNodeId(id)
-        .setNodeType(static_cast<int>(node->nodeType()))
-        .setNodeName(nodeName)
-        .setLocalName(localName)
-        .setNodeValue(nodeValue)
-        .release();
-
-    if (node->isContainerNode()) {
-        int nodeCount = innerChildNodeCount(node);
-        value->setChildNodeCount(nodeCount);
-        Ref<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> children = buildArrayForContainerChildren(node, depth, nodesMap);
-        if (children->length() > 0)
-            value->setChildren(WTFMove(children));
-    }
-
-    if (is<Element>(*node)) {
-        Element& element = downcast<Element>(*node);
-        value->setAttributes(buildArrayForElementAttributes(&element));
-        if (is<HTMLFrameOwnerElement>(element)) {
-            HTMLFrameOwnerElement& frameOwner = downcast<HTMLFrameOwnerElement>(element);
-            Frame* frame = frameOwner.contentFrame();
-            if (frame)
-                value->setFrameId(m_pageAgent->frameId(frame));
-            Document* document = frameOwner.contentDocument();
-            if (document)
-                value->setContentDocument(buildObjectForNode(document, 0, nodesMap));
-        }
-
-        if (ShadowRoot* root = element.shadowRoot()) {
-            auto shadowRoots = Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>::create();
-            shadowRoots->addItem(buildObjectForNode(root, 0, nodesMap));
-            value->setShadowRoots(WTFMove(shadowRoots));
-        }
-
-        if (is<HTMLTemplateElement>(element))
-            value->setTemplateContent(buildObjectForNode(&downcast<HTMLTemplateElement>(element).content(), 0, nodesMap));
-
-        if (is<HTMLStyleElement>(element) || (is<HTMLScriptElement>(element) && !element.hasAttributeWithoutSynchronization(HTMLNames::srcAttr)))
-            value->setContentSecurityPolicyHash(computeContentSecurityPolicySHA256Hash(element));
-
-        auto state = customElementState(element);
-        if (state != Inspector::Protocol::DOM::CustomElementState::Builtin)
-            value->setCustomElementState(state);
-
-        if (element.pseudoId()) {
-            Inspector::Protocol::DOM::PseudoType pseudoType;
-            if (pseudoElementType(element.pseudoId(), &pseudoType))
-                value->setPseudoType(pseudoType);
-        } else {
-            if (auto pseudoElements = buildArrayForPseudoElements(element, nodesMap))
-                value->setPseudoElements(WTFMove(pseudoElements));
-        }
-
-    } else if (is<Document>(*node)) {
-        Document& document = downcast<Document>(*node);
-        value->setFrameId(m_pageAgent->frameId(document.frame()));
-        value->setDocumentURL(documentURLString(&document));
-        value->setBaseURL(documentBaseURLString(&document));
-        value->setXmlVersion(document.xmlVersion());
-    } else if (is<DocumentType>(*node)) {
-        DocumentType& docType = downcast<DocumentType>(*node);
-        value->setPublicId(docType.publicId());
-        value->setSystemId(docType.systemId());
-    } else if (is<Attr>(*node)) {
-        Attr& attribute = downcast<Attr>(*node);
-        value->setName(attribute.name());
-        value->setValue(attribute.value());
-    } else if (is<ShadowRoot>(*node)) {
-        ShadowRoot& shadowRoot = downcast<ShadowRoot>(*node);
-        value->setShadowRootType(shadowRootType(shadowRoot.mode()));
-    }
-
-    // Need to enable AX to get the computed role.
-    if (!WebCore::AXObjectCache::accessibilityEnabled())
-        WebCore::AXObjectCache::enableAccessibility();
-
-    if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
-        if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node))
-            value->setRole(axObject->computedRoleString());
-    }
-
-    return value;
-}
-
-Ref<Inspector::Protocol::Array<String>> InspectorDOMAgent::buildArrayForElementAttributes(Element* element)
-{
-    auto attributesValue = Inspector::Protocol::Array<String>::create();
-    // Go through all attributes and serialize them.
-    if (!element->hasAttributes())
-        return attributesValue;
-    for (const Attribute& attribute : element->attributesIterator()) {
-        // Add attribute pair
-        attributesValue->addItem(attribute.name().toString());
-        attributesValue->addItem(attribute.value());
-    }
-    return attributesValue;
-}
-
-Ref<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> InspectorDOMAgent::buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap)
-{
-    auto children = Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>::create();
-    if (depth == 0) {
-        // Special-case the only text child - pretend that container's children have been requested.
-        Node* firstChild = container->firstChild();
-        if (firstChild && firstChild->nodeType() == Node::TEXT_NODE && !firstChild->nextSibling()) {
-            children->addItem(buildObjectForNode(firstChild, 0, nodesMap));
-            m_childrenRequested.add(bind(container, nodesMap));
-        }
-        return children;
-    }
-
-    Node* child = innerFirstChild(container);
-    depth--;
-    m_childrenRequested.add(bind(container, nodesMap));
-
-    while (child) {
-        children->addItem(buildObjectForNode(child, depth, nodesMap));
-        child = innerNextSibling(child);
-    }
-    return children;
-}
-
-RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> InspectorDOMAgent::buildArrayForPseudoElements(const Element& element, NodeToIdMap* nodesMap)
-{
-    PseudoElement* beforeElement = element.beforePseudoElement();
-    PseudoElement* afterElement = element.afterPseudoElement();
-    if (!beforeElement && !afterElement)
-        return nullptr;
-
-    auto pseudoElements = Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>::create();
-    if (beforeElement)
-        pseudoElements->addItem(buildObjectForNode(beforeElement, 0, nodesMap));
-    if (afterElement)
-        pseudoElements->addItem(buildObjectForNode(afterElement, 0, nodesMap));
-    return WTFMove(pseudoElements);
-}
-
-Ref<Inspector::Protocol::DOM::EventListener> InspectorDOMAgent::buildObjectForEventListener(const RegisteredEventListener& registeredEventListener, int identifier, const AtomicString& eventType, Node* node, const String* objectGroupId, bool disabled)
-{
-    Ref<EventListener> eventListener = registeredEventListener.callback();
-
-    JSC::ExecState* state = nullptr;
-    JSC::JSObject* handler = nullptr;
-    String body;
-    int lineNumber = 0;
-    int columnNumber = 0;
-    String scriptID;
-    String sourceName;
-    if (auto scriptListener = JSEventListener::cast(eventListener.ptr())) {
-        JSC::JSLockHolder lock(scriptListener->isolatedWorld().vm());
-        state = execStateFromNode(scriptListener->isolatedWorld(), &node->document());
-        handler = scriptListener->jsFunction(node->document());
-        if (handler && state) {
-            body = handler->toString(state)->value(state);
-            if (auto function = jsDynamicDowncast<JSC::JSFunction*>(state->vm(), handler)) {
-                if (!function->isHostOrBuiltinFunction()) {
-                    if (auto executable = function->jsExecutable()) {
-                        lineNumber = executable->firstLine() - 1;
-                        columnNumber = executable->startColumn() - 1;
-                        scriptID = executable->sourceID() == JSC::SourceProvider::nullID ? emptyString() : String::number(executable->sourceID());
-                        sourceName = executable->sourceURL();
-                    }
-                }
-            }
-        }
-    }
-
-    auto value = Inspector::Protocol::DOM::EventListener::create()
-        .setEventListenerId(identifier)
-        .setType(eventType)
-        .setUseCapture(registeredEventListener.useCapture())
-        .setIsAttribute(eventListener->isAttribute())
-        .setNodeId(pushNodePathToFrontend(node))
-        .setHandlerBody(body)
-        .release();
-    if (objectGroupId && handler && state) {
-        InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(state);
-        if (!injectedScript.hasNoValue())
-            value->setHandler(injectedScript.wrapObject(handler, *objectGroupId));
-    }
-    if (!scriptID.isNull()) {
-        auto location = Inspector::Protocol::Debugger::Location::create()
-            .setScriptId(scriptID)
-            .setLineNumber(lineNumber)
-            .release();
-        location->setColumnNumber(columnNumber);
-        value->setLocation(WTFMove(location));
-        if (!sourceName.isEmpty())
-            value->setSourceName(sourceName);
-    }
-    if (registeredEventListener.isPassive())
-        value->setPassive(true);
-    if (registeredEventListener.isOnce())
-        value->setOnce(true);
-    if (disabled)
-        value->setDisabled(disabled);
-    return value;
-}
-    
-void InspectorDOMAgent::processAccessibilityChildren(RefPtr<AccessibilityObject>&& axObject, RefPtr<Inspector::Protocol::Array<int>>&& childNodeIds)
-{
-    const auto& children = axObject->children();
-    if (!children.size())
-        return;
-    
-    if (!childNodeIds)
-        childNodeIds = Inspector::Protocol::Array<int>::create();
-    
-    for (const auto& childObject : children) {
-        if (Node* childNode = childObject->node())
-            childNodeIds->addItem(pushNodePathToFrontend(childNode));
-        else
-            processAccessibilityChildren(childObject.copyRef(), childNodeIds.copyRef());
-    }
-}
-    
-RefPtr<Inspector::Protocol::DOM::AccessibilityProperties> InspectorDOMAgent::buildObjectForAccessibilityProperties(Node* node)
-{
-    ASSERT(node);
-    if (!node)
-        return nullptr;
-
-    if (!WebCore::AXObjectCache::accessibilityEnabled())
-        WebCore::AXObjectCache::enableAccessibility();
-
-    Node* activeDescendantNode = nullptr;
-    bool busy = false;
-    auto checked = Inspector::Protocol::DOM::AccessibilityProperties::Checked::False;
-    RefPtr<Inspector::Protocol::Array<int>> childNodeIds;
-    RefPtr<Inspector::Protocol::Array<int>> controlledNodeIds;
-    auto currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::False;
-    bool exists = false;
-    bool expanded = false;
-    bool disabled = false;
-    RefPtr<Inspector::Protocol::Array<int>> flowedNodeIds;
-    bool focused = false;
-    bool ignored = true;
-    bool ignoredByDefault = false;
-    auto invalid = Inspector::Protocol::DOM::AccessibilityProperties::Invalid::False;
-    bool hidden = false;
-    String label;
-    bool liveRegionAtomic = false;
-    RefPtr<Inspector::Protocol::Array<String>> liveRegionRelevant;
-    auto liveRegionStatus = Inspector::Protocol::DOM::AccessibilityProperties::LiveRegionStatus::Off;
-    Node* mouseEventNode = nullptr;
-    RefPtr<Inspector::Protocol::Array<int>> ownedNodeIds;
-    Node* parentNode = nullptr;
-    bool pressed = false;
-    bool readonly = false;
-    bool required = false;
-    String role;
-    bool selected = false;
-    RefPtr<Inspector::Protocol::Array<int>> selectedChildNodeIds;
-    bool supportsChecked = false;
-    bool supportsExpanded = false;
-    bool supportsLiveRegion = false;
-    bool supportsPressed = false;
-    bool supportsRequired = false;
-    bool supportsFocused = false;
-    bool isPopupButton = false;
-    int headingLevel = 0;
-    unsigned hierarchicalLevel = 0;
-    unsigned level = 0;
-
-    if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
-        if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node)) {
-
-            if (AccessibilityObject* activeDescendant = axObject->activeDescendant())
-                activeDescendantNode = activeDescendant->node();
-
-            // An AX object is "busy" if it or any ancestor has aria-busy="true" set.
-            AccessibilityObject* current = axObject;
-            while (!busy && current) {
-                busy = current->isBusy();
-                current = current->parentObject();
-            }
-
-            supportsChecked = axObject->supportsChecked();
-            if (supportsChecked) {
-                AccessibilityButtonState checkValue = axObject->checkboxOrRadioValue(); // Element using aria-checked.
-                if (checkValue == AccessibilityButtonState::On)
-                    checked = Inspector::Protocol::DOM::AccessibilityProperties::Checked::True;
-                else if (checkValue == AccessibilityButtonState::Mixed)
-                    checked = Inspector::Protocol::DOM::AccessibilityProperties::Checked::Mixed;
-                else if (axObject->isChecked()) // Native checkbox.
-                    checked = Inspector::Protocol::DOM::AccessibilityProperties::Checked::True;
-            }
-            
-            processAccessibilityChildren(axObject, WTFMove(childNodeIds));
-            
-            Vector<Element*> controlledElements;
-            axObject->elementsFromAttribute(controlledElements, aria_controlsAttr);
-            if (controlledElements.size()) {
-                controlledNodeIds = Inspector::Protocol::Array<int>::create();
-                for (Element* controlledElement : controlledElements)
-                    controlledNodeIds->addItem(pushNodePathToFrontend(controlledElement));
-            }
-            
-            switch (axObject->ariaCurrentState()) {
-            case AccessibilityARIACurrentState::False:
-                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::False;
-                break;
-            case AccessibilityARIACurrentState::Page:
-                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Page;
-                break;
-            case AccessibilityARIACurrentState::Step:
-                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Step;
-                break;
-            case AccessibilityARIACurrentState::Location:
-                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Location;
-                break;
-            case AccessibilityARIACurrentState::Date:
-                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Date;
-                break;
-            case AccessibilityARIACurrentState::Time:
-                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Time;
-                break;
-            case AccessibilityARIACurrentState::True:
-                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::True;
-                break;
-            }
-
-            disabled = !axObject->isEnabled();
-            exists = true;
-            
-            supportsExpanded = axObject->supportsExpanded();
-            if (supportsExpanded)
-                expanded = axObject->isExpanded();
-
-            Vector<Element*> flowedElements;
-            axObject->elementsFromAttribute(flowedElements, aria_flowtoAttr);
-            if (flowedElements.size()) {
-                flowedNodeIds = Inspector::Protocol::Array<int>::create();
-                for (Element* flowedElement : flowedElements)
-                    flowedNodeIds->addItem(pushNodePathToFrontend(flowedElement));
-            }
-            
-            if (is<Element>(*node)) {
-                supportsFocused = axObject->canSetFocusAttribute();
-                if (supportsFocused)
-                    focused = axObject->isFocused();
-            }
-
-            ignored = axObject->accessibilityIsIgnored();
-            ignoredByDefault = axObject->accessibilityIsIgnoredByDefault();
-            
-            String invalidValue = axObject->invalidStatus();
-            if (invalidValue == "false")
-                invalid = Inspector::Protocol::DOM::AccessibilityProperties::Invalid::False;
-            else if (invalidValue == "grammar")
-                invalid = Inspector::Protocol::DOM::AccessibilityProperties::Invalid::Grammar;
-            else if (invalidValue == "spelling")
-                invalid = Inspector::Protocol::DOM::AccessibilityProperties::Invalid::Spelling;
-            else // Future versions of ARIA may allow additional truthy values. Ex. format, order, or size.
-                invalid = Inspector::Protocol::DOM::AccessibilityProperties::Invalid::True;
-            
-            if (axObject->isARIAHidden() || axObject->isDOMHidden())
-                hidden = true;
-            
-            label = axObject->computedLabel();
-
-            if (axObject->supportsARIALiveRegion()) {
-                supportsLiveRegion = true;
-                liveRegionAtomic = axObject->ariaLiveRegionAtomic();
-
-                String ariaRelevantAttrValue = axObject->ariaLiveRegionRelevant();
-                if (!ariaRelevantAttrValue.isEmpty()) {
-                    // FIXME: Pass enum values rather than strings once unblocked. http://webkit.org/b/133711
-                    String ariaRelevantAdditions = Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Additions);
-                    String ariaRelevantRemovals = Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Removals);
-                    String ariaRelevantText = Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Text);
-                    liveRegionRelevant = Inspector::Protocol::Array<String>::create();
-                    const SpaceSplitString& values = SpaceSplitString(ariaRelevantAttrValue, true);
-                    // @aria-relevant="all" is exposed as ["additions","removals","text"], in order.
-                    // This order is controlled in WebCore and expected in WebInspectorUI.
-                    if (values.contains("all")) {
-                        liveRegionRelevant->addItem(ariaRelevantAdditions);
-                        liveRegionRelevant->addItem(ariaRelevantRemovals);
-                        liveRegionRelevant->addItem(ariaRelevantText);
-                    } else {
-                        if (values.contains(ariaRelevantAdditions))
-                            liveRegionRelevant->addItem(ariaRelevantAdditions);
-                        if (values.contains(ariaRelevantRemovals))
-                            liveRegionRelevant->addItem(ariaRelevantRemovals);
-                        if (values.contains(ariaRelevantText))
-                            liveRegionRelevant->addItem(ariaRelevantText);
-                    }
-                }
-
-                String ariaLive = axObject->ariaLiveRegionStatus();
-                if (ariaLive == "assertive")
-                    liveRegionStatus = Inspector::Protocol::DOM::AccessibilityProperties::LiveRegionStatus::Assertive;
-                else if (ariaLive == "polite")
-                    liveRegionStatus = Inspector::Protocol::DOM::AccessibilityProperties::LiveRegionStatus::Polite;
-            }
-
-            if (is<AccessibilityNodeObject>(*axObject))
-                mouseEventNode = downcast<AccessibilityNodeObject>(*axObject).mouseButtonListener(MouseButtonListenerResultFilter::IncludeBodyElement);
-
-            if (axObject->supportsARIAOwns()) {
-                Vector<Element*> ownedElements;
-                axObject->elementsFromAttribute(ownedElements, aria_ownsAttr);
-                if (ownedElements.size()) {
-                    ownedNodeIds = Inspector::Protocol::Array<int>::create();
-                    for (Element* ownedElement : ownedElements)
-                        ownedNodeIds->addItem(pushNodePathToFrontend(ownedElement));
-                }
-            }
-
-            if (AccessibilityObject* parentObject = axObject->parentObjectUnignored())
-                parentNode = parentObject->node();
-
-            supportsPressed = axObject->ariaPressedIsPresent();
-            if (supportsPressed)
-                pressed = axObject->isPressed();
-            
-            if (axObject->isTextControl())
-                readonly = !axObject->canSetValueAttribute();
-
-            supportsRequired = axObject->supportsRequiredAttribute();
-            if (supportsRequired)
-                required = axObject->isRequired();
-            
-            role = axObject->computedRoleString();
-            selected = axObject->isSelected();
-
-            AccessibilityObject::AccessibilityChildrenVector selectedChildren;
-            axObject->selectedChildren(selectedChildren);
-            if (selectedChildren.size()) {
-                selectedChildNodeIds = Inspector::Protocol::Array<int>::create();
-                for (auto& selectedChildObject : selectedChildren) {
-                    if (Node* selectedChildNode = selectedChildObject->node())
-                        selectedChildNodeIds->addItem(pushNodePathToFrontend(selectedChildNode));
-                }
-            }
-            
-            headingLevel = axObject->headingLevel();
-            hierarchicalLevel = axObject->hierarchicalLevel();
-            
-            level = hierarchicalLevel ? hierarchicalLevel : headingLevel;
-            isPopupButton = axObject->isPopUpButton() || axObject->ariaHasPopup();
-        }
-    }
-    
-    Ref<Inspector::Protocol::DOM::AccessibilityProperties> value = Inspector::Protocol::DOM::AccessibilityProperties::create()
-        .setExists(exists)
-        .setLabel(label)
-        .setRole(role)
-        .setNodeId(pushNodePathToFrontend(node))
-        .release();
-
-    if (exists) {
-        if (activeDescendantNode)
-            value->setActiveDescendantNodeId(pushNodePathToFrontend(activeDescendantNode));
-        if (busy)
-            value->setBusy(busy);
-        if (supportsChecked)
-            value->setChecked(checked);
-        if (childNodeIds)
-            value->setChildNodeIds(childNodeIds);
-        if (controlledNodeIds)
-            value->setControlledNodeIds(controlledNodeIds);
-        if (currentState != Inspector::Protocol::DOM::AccessibilityProperties::Current::False)
-            value->setCurrent(currentState);
-        if (disabled)
-            value->setDisabled(disabled);
-        if (supportsExpanded)
-            value->setExpanded(expanded);
-        if (flowedNodeIds)
-            value->setFlowedNodeIds(flowedNodeIds);
-        if (supportsFocused)
-            value->setFocused(focused);
-        if (ignored)
-            value->setIgnored(ignored);
-        if (ignoredByDefault)
-            value->setIgnoredByDefault(ignoredByDefault);
-        if (invalid != Inspector::Protocol::DOM::AccessibilityProperties::Invalid::False)
-            value->setInvalid(invalid);
-        if (hidden)
-            value->setHidden(hidden);
-        if (supportsLiveRegion) {
-            value->setLiveRegionAtomic(liveRegionAtomic);
-            if (liveRegionRelevant->length())
-                value->setLiveRegionRelevant(liveRegionRelevant);
-            value->setLiveRegionStatus(liveRegionStatus);
-        }
-        if (mouseEventNode)
-            value->setMouseEventNodeId(pushNodePathToFrontend(mouseEventNode));
-        if (ownedNodeIds)
-            value->setOwnedNodeIds(ownedNodeIds);
-        if (parentNode)
-            value->setParentNodeId(pushNodePathToFrontend(parentNode));
-        if (supportsPressed)
-            value->setPressed(pressed);
-        if (readonly)
-            value->setReadonly(readonly);
-        if (supportsRequired)
-            value->setRequired(required);
-        if (selected)
-            value->setSelected(selected);
-        if (selectedChildNodeIds)
-            value->setSelectedChildNodeIds(selectedChildNodeIds);
-        
-        // H1 -- H6 always have a headingLevel property that can be complimented by a hierarchicalLevel
-        // property when aria-level is set on the element, in which case we want to remain calling
-        // this value the "Heading Level" in the inspector.
-        // Also, we do not want it to say Hierarchy Level: 0
-        if (headingLevel)
-            value->setHeadingLevel(level);
-        else if (level)
-            value->setHierarchyLevel(level);
-        if (isPopupButton)
-            value->setIsPopUpButton(isPopupButton);
-    }
-
-    return WTFMove(value);
-}
-
-Node* InspectorDOMAgent::innerFirstChild(Node* node)
-{
-    node = node->firstChild();
-    while (isWhitespace(node))
-        node = node->nextSibling();
-    return node;
-}
-
-Node* InspectorDOMAgent::innerNextSibling(Node* node)
-{
-    do {
-        node = node->nextSibling();
-    } while (isWhitespace(node));
-    return node;
-}
-
-Node* InspectorDOMAgent::innerPreviousSibling(Node* node)
-{
-    do {
-        node = node->previousSibling();
-    } while (isWhitespace(node));
-    return node;
-}
-
-unsigned InspectorDOMAgent::innerChildNodeCount(Node* node)
-{
-    unsigned count = 0;
-    Node* child = innerFirstChild(node);
-    while (child) {
-        count++;
-        child = innerNextSibling(child);
-    }
-    return count;
-}
-
-Node* InspectorDOMAgent::innerParentNode(Node* node)
-{
-    ASSERT(node);
-    if (is<Document>(*node))
-        return downcast<Document>(*node).ownerElement();
-    if (is<ShadowRoot>(*node))
-        return downcast<ShadowRoot>(*node).host();
-    return node->parentNode();
-}
-
-bool InspectorDOMAgent::isWhitespace(Node* node)
-{
-    //TODO: pull ignoreWhitespace setting from the frontend and use here.
-    return node && node->nodeType() == Node::TEXT_NODE && node->nodeValue().stripWhiteSpace().length() == 0;
-}
-
-void InspectorDOMAgent::mainFrameDOMContentLoaded()
-{
-    // Re-push document once it is loaded.
-    discardBindings();
-    if (m_documentRequested)
-        m_frontendDispatcher->documentUpdated();
-}
-
-void InspectorDOMAgent::didCommitLoad(Document* document)
-{
-    RefPtr<Element> frameOwner = document->ownerElement();
-    if (!frameOwner)
-        return;
-
-    int frameOwnerId = m_documentNodeToIdMap.get(frameOwner);
-    if (!frameOwnerId)
-        return;
-
-    // Re-add frame owner element together with its new children.
-    int parentId = m_documentNodeToIdMap.get(innerParentNode(frameOwner.get()));
-    m_frontendDispatcher->childNodeRemoved(parentId, frameOwnerId);
-    unbind(frameOwner.get(), &m_documentNodeToIdMap);
-
-    Ref<Inspector::Protocol::DOM::Node> value = buildObjectForNode(frameOwner.get(), 0, &m_documentNodeToIdMap);
-    Node* previousSibling = innerPreviousSibling(frameOwner.get());
-    int prevId = previousSibling ? m_documentNodeToIdMap.get(previousSibling) : 0;
-    m_frontendDispatcher->childNodeInserted(parentId, prevId, WTFMove(value));
-}
-
-void InspectorDOMAgent::didInsertDOMNode(Node& node)
-{
-    if (isWhitespace(&node))
-        return;
-
-    // We could be attaching existing subtree. Forget the bindings.
-    unbind(&node, &m_documentNodeToIdMap);
-
-    ContainerNode* parent = node.parentNode();
-    if (!parent)
-        return;
-
-    int parentId = m_documentNodeToIdMap.get(parent);
-    // Return if parent is not mapped yet.
-    if (!parentId)
-        return;
-
-    if (!m_childrenRequested.contains(parentId)) {
-        // No children are mapped yet -> only notify on changes of hasChildren.
-        m_frontendDispatcher->childNodeCountUpdated(parentId, innerChildNodeCount(parent));
-    } else {
-        // Children have been requested -> return value of a new child.
-        Node* prevSibling = innerPreviousSibling(&node);
-        int prevId = prevSibling ? m_documentNodeToIdMap.get(prevSibling) : 0;
-        Ref<Inspector::Protocol::DOM::Node> value = buildObjectForNode(&node, 0, &m_documentNodeToIdMap);
-        m_frontendDispatcher->childNodeInserted(parentId, prevId, WTFMove(value));
-    }
-}
-
-void InspectorDOMAgent::didRemoveDOMNode(Node& node)
-{
-    if (isWhitespace(&node))
-        return;
-
-    ContainerNode* parent = node.parentNode();
-
-    // If parent is not mapped yet -> ignore the event.
-    if (!m_documentNodeToIdMap.contains(parent))
-        return;
-
-    int parentId = m_documentNodeToIdMap.get(parent);
-
-    if (!m_childrenRequested.contains(parentId)) {
-        // No children are mapped yet -> only notify on changes of hasChildren.
-        if (innerChildNodeCount(parent) == 1)
-            m_frontendDispatcher->childNodeCountUpdated(parentId, 0);
-    } else
-        m_frontendDispatcher->childNodeRemoved(parentId, m_documentNodeToIdMap.get(&node));
-    unbind(&node, &m_documentNodeToIdMap);
-}
-
-void InspectorDOMAgent::willModifyDOMAttr(Element&, const AtomicString& oldValue, const AtomicString& newValue)
-{
-    m_suppressAttributeModifiedEvent = (oldValue == newValue);
-}
-
-void InspectorDOMAgent::didModifyDOMAttr(Element& element, const AtomicString& name, const AtomicString& value)
-{
-    bool shouldSuppressEvent = m_suppressAttributeModifiedEvent;
-    m_suppressAttributeModifiedEvent = false;
-    if (shouldSuppressEvent)
-        return;
-
-    int id = boundNodeId(&element);
-    // If node is not mapped yet -> ignore the event.
-    if (!id)
-        return;
-
-    if (m_domListener)
-        m_domListener->didModifyDOMAttr(element);
-
-    m_frontendDispatcher->attributeModified(id, name, value);
-}
-
-void InspectorDOMAgent::didRemoveDOMAttr(Element& element, const AtomicString& name)
-{
-    int id = boundNodeId(&element);
-    // If node is not mapped yet -> ignore the event.
-    if (!id)
-        return;
-
-    if (m_domListener)
-        m_domListener->didModifyDOMAttr(element);
-
-    m_frontendDispatcher->attributeRemoved(id, name);
-}
-
-void InspectorDOMAgent::styleAttributeInvalidated(const Vector<Element*>& elements)
-{
-    auto nodeIds = Inspector::Protocol::Array<int>::create();
-    for (auto& element : elements) {
-        int id = boundNodeId(element);
-        // If node is not mapped yet -> ignore the event.
-        if (!id)
-            continue;
-
-        if (m_domListener)
-            m_domListener->didModifyDOMAttr(*element);
-        nodeIds->addItem(id);
-    }
-    m_frontendDispatcher->inlineStyleInvalidated(WTFMove(nodeIds));
-}
-
-void InspectorDOMAgent::characterDataModified(CharacterData& characterData)
-{
-    int id = m_documentNodeToIdMap.get(&characterData);
-    if (!id) {
-        // Push text node if it is being created.
-        didInsertDOMNode(characterData);
-        return;
-    }
-    m_frontendDispatcher->characterDataModified(id, characterData.data());
-}
-
-void InspectorDOMAgent::didInvalidateStyleAttr(Node& node)
-{
-    int id = m_documentNodeToIdMap.get(&node);
-    // If node is not mapped yet -> ignore the event.
-    if (!id)
-        return;
-
-    if (!m_revalidateStyleAttrTask)
-        m_revalidateStyleAttrTask = std::make_unique<RevalidateStyleAttributeTask>(this);
-    m_revalidateStyleAttrTask->scheduleFor(downcast<Element>(&node));
-}
-
-void InspectorDOMAgent::didPushShadowRoot(Element& host, ShadowRoot& root)
-{
-    int hostId = m_documentNodeToIdMap.get(&host);
-    if (hostId)
-        m_frontendDispatcher->shadowRootPushed(hostId, buildObjectForNode(&root, 0, &m_documentNodeToIdMap));
-}
-
-void InspectorDOMAgent::willPopShadowRoot(Element& host, ShadowRoot& root)
-{
-    int hostId = m_documentNodeToIdMap.get(&host);
-    int rootId = m_documentNodeToIdMap.get(&root);
-    if (hostId && rootId)
-        m_frontendDispatcher->shadowRootPopped(hostId, rootId);
-}
-
-void InspectorDOMAgent::didChangeCustomElementState(Element& element)
-{
-    int elementId = m_documentNodeToIdMap.get(&element);
-    if (!elementId)
-        return;
-
-    m_frontendDispatcher->customElementStateChanged(elementId, customElementState(element));
-}
-
-void InspectorDOMAgent::frameDocumentUpdated(Frame& frame)
-{
-    Document* document = frame.document();
-    if (!document)
-        return;
-
-    if (!frame.isMainFrame())
-        return;
-
-    // Only update the main frame document, nested frame document updates are not required
-    // (will be handled by didCommitLoad()).
-    setDocument(document);
-}
-
-void InspectorDOMAgent::pseudoElementCreated(PseudoElement& pseudoElement)
-{
-    Element* parent = pseudoElement.hostElement();
-    if (!parent)
-        return;
-
-    int parentId = m_documentNodeToIdMap.get(parent);
-    if (!parentId)
-        return;
-
-    pushChildNodesToFrontend(parentId, 1);
-    m_frontendDispatcher->pseudoElementAdded(parentId, buildObjectForNode(&pseudoElement, 0, &m_documentNodeToIdMap));
-}
-
-void InspectorDOMAgent::pseudoElementDestroyed(PseudoElement& pseudoElement)
-{
-    int pseudoElementId = m_documentNodeToIdMap.get(&pseudoElement);
-    if (!pseudoElementId)
-        return;
-
-    // If a PseudoElement is bound, its parent element must have been bound.
-    Element* parent = pseudoElement.hostElement();
-    ASSERT(parent);
-    int parentId = m_documentNodeToIdMap.get(parent);
-    ASSERT(parentId);
-
-    unbind(&pseudoElement, &m_documentNodeToIdMap);
-    m_frontendDispatcher->pseudoElementRemoved(parentId, pseudoElementId);
-}
-
-void InspectorDOMAgent::didAddEventListener(EventTarget& target)
-{
-    auto node = target.toNode();
-    if (!node)
-        return;
-
-    int nodeId = boundNodeId(node.get());
-    if (!nodeId)
-        return;
-
-    m_frontendDispatcher->didAddEventListener(nodeId);
-}
-
-void InspectorDOMAgent::willRemoveEventListener(EventTarget& target, const AtomicString& eventType, EventListener& listener, bool capture)
-{
-    auto node = target.toNode();
-    if (!node)
-        return;
-
-    int nodeId = boundNodeId(node.get());
-    if (!nodeId)
-        return;
-
-    bool listenerExists = false;
-    for (const RefPtr<RegisteredEventListener>& item : node->eventListeners(eventType)) {
-        if (item->callback() == listener && item->useCapture() == capture) {
-            listenerExists = true;
-            break;
-        }
-    }
-
-    if (!listenerExists)
-        return;
-
-    m_eventListenerEntries.remove(&listener);
-
-    m_frontendDispatcher->willRemoveEventListener(nodeId);
-}
-
-bool InspectorDOMAgent::isEventListenerDisabled(EventTarget& target, const AtomicString& eventType, EventListener& listener, bool capture)
-{
-    auto it = m_eventListenerEntries.find(&listener);
-    if (it == m_eventListenerEntries.end())
-        return false;
-
-    if (!it->value.disabled)
-        return false;
-
-    return it->value.eventTarget.get() == &target && it->value.eventType == eventType && it->value.useCapture == capture;
-}
-
-Node* InspectorDOMAgent::nodeForPath(const String& path)
-{
-    // The path is of form "1,HTML,2,BODY,1,DIV"
-    if (!m_document)
-        return nullptr;
-
-    Node* node = m_document.get();
-    Vector<String> pathTokens;
-    path.split(',', false, pathTokens);
-    if (!pathTokens.size())
-        return nullptr;
-
-    for (size_t i = 0; i < pathTokens.size() - 1; i += 2) {
-        bool success = true;
-        unsigned childNumber = pathTokens[i].toUInt(&success);
-        if (!success)
-            return nullptr;
-
-        Node* child;
-        if (is<HTMLFrameOwnerElement>(*node)) {
-            ASSERT(!childNumber);
-            auto& frameOwner = downcast<HTMLFrameOwnerElement>(*node);
-            child = frameOwner.contentDocument();
-        } else {
-            if (childNumber >= innerChildNodeCount(node))
-                return nullptr;
-
-            child = innerFirstChild(node);
-            for (size_t j = 0; child && j < childNumber; ++j)
-                child = innerNextSibling(child);
-        }
-
-        const auto& childName = pathTokens[i + 1];
-        if (!child || child->nodeName() != childName)
-            return nullptr;
-        node = child;
-    }
-    return node;
-}
-
-Node* InspectorDOMAgent::nodeForObjectId(const String& objectId)
-{
-    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
-    if (injectedScript.hasNoValue())
-        return nullptr;
-
-    return scriptValueAsNode(injectedScript.findObjectById(objectId));
-}
-
-void InspectorDOMAgent::pushNodeByPathToFrontend(ErrorString& errorString, const String& path, int* nodeId)
-{
-    if (Node* node = nodeForPath(path))
-        *nodeId = pushNodePathToFrontend(node);
-    else
-        errorString = ASCIILiteral("No node with given path found");
-}
-
-void InspectorDOMAgent::pushNodeByBackendIdToFrontend(ErrorString& errorString, BackendNodeId backendNodeId, int* nodeId)
-{
-    auto iterator = m_backendIdToNode.find(backendNodeId);
-    if (iterator == m_backendIdToNode.end()) {
-        errorString = ASCIILiteral("No node with given backend id found");
-        return;
-    }
-
-    Node* node = iterator->value.first;
-    String nodeGroup = iterator->value.second;
-
-    *nodeId = pushNodePathToFrontend(node);
-
-    if (nodeGroup.isEmpty()) {
-        m_backendIdToNode.remove(iterator);
-        // FIXME: We really do the following only when nodeGroup is the empty string? Seems wrong.
-        ASSERT(m_nodeGroupToBackendIdMap.contains(nodeGroup));
-        m_nodeGroupToBackendIdMap.find(nodeGroup)->value.remove(node);
-    }
-}
-
-RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup)
-{
-    auto* frame = node->document().frame();
-    if (!frame)
-        return nullptr;
-
-    auto& state = *mainWorldExecState(frame);
-    auto injectedScript = m_injectedScriptManager.injectedScriptFor(&state);
-    if (injectedScript.hasNoValue())
-        return nullptr;
-
-    return injectedScript.wrapObject(nodeAsScriptValue(state, node), objectGroup);
-}
-
-Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value)
-{
-    if (!value || !value.isObject())
-        return nullptr;
-    return JSNode::toWrapped(*value.getObject()->vm(), value.getObject());
-}
-
-JSC::JSValue InspectorDOMAgent::nodeAsScriptValue(JSC::ExecState& state, Node* node)
-{
-    JSC::JSLockHolder lock(&state);
-    return toJS(&state, deprecatedGlobalObjectForPrototype(&state), BindingSecurity::checkSecurityForNode(state, node));
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDOMAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.h       2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.h  2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,301 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009, 2015-2016 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:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "EventTarget.h"
-#include "InspectorWebAgentBase.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorValues.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/AtomicString.h>
-
-namespace Inspector {
-class InjectedScriptManager;
-}
-
-namespace JSC {
-class ExecState;
-class JSValue;
-}
-
-namespace WebCore {
-    
-class AccessibilityObject;
-class CharacterData;
-class DOMEditor;
-class Document;
-class Element;
-class Event;
-class Exception;
-class FloatQuad;
-class Frame;
-class InspectorHistory;
-class InspectorOverlay;
-class InspectorPageAgent;
-class HitTestResult;
-class Node;
-class PseudoElement;
-class RevalidateStyleAttributeTask;
-class ShadowRoot;
-
-struct HighlightConfig;
-
-typedef String ErrorString;
-typedef int BackendNodeId;
-
-struct EventListenerInfo {
-    EventListenerInfo(Node* node, const AtomicString& eventType, EventListenerVector&& eventListenerVector)
-        : node(node)
-        , eventType(eventType)
-        , eventListenerVector(WTFMove(eventListenerVector))
-    {
-    }
-
-    Node* node;
-    const AtomicString eventType;
-    const EventListenerVector eventListenerVector;
-};
-
-class InspectorDOMAgent final : public InspectorAgentBase, public Inspector::DOMBackendDispatcherHandler {
-    WTF_MAKE_NONCOPYABLE(InspectorDOMAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    struct DOMListener {
-        virtual ~DOMListener() = default;
-        virtual void didRemoveDOMNode(Node&, int nodeId) = 0;
-        virtual void didModifyDOMAttr(Element&) = 0;
-    };
-
-    InspectorDOMAgent(WebAgentContext&, InspectorPageAgent*, InspectorOverlay*);
-    virtual ~InspectorDOMAgent();
-
-    static String toErrorString(ExceptionCode);
-    static String toErrorString(Exception&&);
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    Vector<Document*> documents();
-    void reset();
-
-    // Methods called from the frontend for DOM nodes inspection.
-    void querySelector(ErrorString&, int nodeId, const String& selectors, int* elementId) override;
-    void querySelectorAll(ErrorString&, int nodeId, const String& selectors, RefPtr<Inspector::Protocol::Array<int>>& result) override;
-    void getDocument(ErrorString&, RefPtr<Inspector::Protocol::DOM::Node>& root) override;
-    void requestChildNodes(ErrorString&, int nodeId, const int* const depth) override;
-    void setAttributeValue(ErrorString&, int elementId, const String& name, const String& value) override;
-    void setAttributesAsText(ErrorString&, int elementId, const String& text, const String* const name) override;
-    void removeAttribute(ErrorString&, int elementId, const String& name) override;
-    void removeNode(ErrorString&, int nodeId) override;
-    void setNodeName(ErrorString&, int nodeId, const String& name, int* newId) override;
-    void getOuterHTML(ErrorString&, int nodeId, WTF::String* outerHTML) override;
-    void setOuterHTML(ErrorString&, int nodeId, const String& outerHTML) override;
-    void setNodeValue(ErrorString&, int nodeId, const String& value) override;
-    void getEventListenersForNode(ErrorString&, int nodeId, const WTF::String* const objectGroup, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::EventListener>>& listenersArray) override;
-    void setEventListenerDisabled(ErrorString&, int eventListenerId, bool disabled) override;
-    void getAccessibilityPropertiesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::DOM::AccessibilityProperties>& axProperties) override;
-    void performSearch(ErrorString&, const String& whitespaceTrimmedQuery, const Inspector::InspectorArray* nodeIds, String* searchId, int* resultCount) override;
-    void getSearchResults(ErrorString&, const String& searchId, int fromIndex, int toIndex, RefPtr<Inspector::Protocol::Array<int>>&) override;
-    void discardSearchResults(ErrorString&, const String& searchId) override;
-    void resolveNode(ErrorString&, int nodeId, const String* const objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result) override;
-    void getAttributes(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::Array<String>>& result) override;
-    void setInspectModeEnabled(ErrorString&, bool enabled, const Inspector::InspectorObject* highlightConfig) override;
-    void requestNode(ErrorString&, const String& objectId, int* nodeId) override;
-    void pushNodeByPathToFrontend(ErrorString&, const String& path, int* nodeId) override;
-    void pushNodeByBackendIdToFrontend(ErrorString&, BackendNodeId, int* nodeId) override;
-    void releaseBackendNodeIds(ErrorString&, const String& nodeGroup) override;
-    void hideHighlight(ErrorString&) override;
-    void highlightRect(ErrorString&, int x, int y, int width, int height, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* const usePageCoordinates) override;
-    void highlightQuad(ErrorString&, const Inspector::InspectorArray& quad, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* const usePageCoordinates) override;
-    void highlightSelector(ErrorString&, const Inspector::InspectorObject& highlightConfig, const String& selectorString, const String* const frameId) override;
-    void highlightNode(ErrorString&, const Inspector::InspectorObject& highlightConfig, const int* const nodeId, const String* const objectId) override;
-    void highlightNodeList(ErrorString&, const Inspector::InspectorArray& nodeIds, const Inspector::InspectorObject& highlightConfig) override;
-    void highlightFrame(ErrorString&, const String& frameId, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor) override;
-    void moveTo(ErrorString&, int nodeId, int targetNodeId, const int* const anchorNodeId, int* newNodeId) override;
-    void undo(ErrorString&) override;
-    void redo(ErrorString&) override;
-    void markUndoableState(ErrorString&) override;
-    void focus(ErrorString&, int nodeId) override;
-    void setInspectedNode(ErrorString&, int nodeId) override;
-
-    void getEventListeners(Node*, Vector<EventListenerInfo>& listenersArray, bool includeAncestors);
-
-
-    // InspectorInstrumentation
-    void didInsertDOMNode(Node&);
-    void didRemoveDOMNode(Node&);
-    void willModifyDOMAttr(Element&, const AtomicString& oldValue, const AtomicString& newValue);
-    void didModifyDOMAttr(Element&, const AtomicString& name, const AtomicString& value);
-    void didRemoveDOMAttr(Element&, const AtomicString& name);
-    void characterDataModified(CharacterData&);
-    void didInvalidateStyleAttr(Node&);
-    void didPushShadowRoot(Element& host, ShadowRoot&);
-    void willPopShadowRoot(Element& host, ShadowRoot&);
-    void didChangeCustomElementState(Element&);
-    bool handleTouchEvent(Node&);
-    void didCommitLoad(Document*);
-    void frameDocumentUpdated(Frame&);
-    void pseudoElementCreated(PseudoElement&);
-    void pseudoElementDestroyed(PseudoElement&);
-    void didAddEventListener(EventTarget&);
-    void willRemoveEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture);
-    bool isEventListenerDisabled(EventTarget&, const AtomicString& eventType, EventListener&, bool capture);
-
-    // Callbacks that don't directly correspond to an instrumentation entry point.
-    void setDocument(Document*);
-    void releaseDanglingNodes();
-    void mainFrameDOMContentLoaded();
-
-    void styleAttributeInvalidated(const Vector<Element*>& elements);
-
-    int pushNodeToFrontend(ErrorString&, int documentNodeId, Node*);
-    Node* nodeForId(int nodeId);
-    int boundNodeId(const Node*);
-    void setDOMListener(DOMListener*);
-    BackendNodeId backendNodeIdForNode(Node*, const String& nodeGroup);
-
-    static String documentURLString(Document*);
-
-    RefPtr<Inspector::Protocol::Runtime::RemoteObject> resolveNode(Node*, const String& objectGroup);
-    bool handleMousePress();
-    void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
-    void inspect(Node*);
-    void focusNode();
-
-    InspectorHistory* history() { return m_history.get(); }
-
-    // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
-    // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
-    static Node* innerFirstChild(Node*);
-    static Node* innerNextSibling(Node*);
-    static Node* innerPreviousSibling(Node*);
-    static unsigned innerChildNodeCount(Node*);
-    static Node* innerParentNode(Node*);
-    static bool isWhitespace(Node*);
-
-    Node* assertNode(ErrorString&, int nodeId);
-    Element* assertElement(ErrorString&, int nodeId);
-    Document* assertDocument(ErrorString&, int nodeId);
-
-    static Node* scriptValueAsNode(JSC::JSValue);
-    static JSC::JSValue nodeAsScriptValue(JSC::ExecState&, Node*);
-
-    // Methods called from other agents.
-    InspectorPageAgent* pageAgent() { return m_pageAgent; }
-
-private:
-    void highlightMousedOverNode();
-    void setSearchingForNode(ErrorString&, bool enabled, const Inspector::InspectorObject* highlightConfig);
-    std::unique_ptr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString&, const Inspector::InspectorObject* highlightInspectorObject);
-
-    // Node-related methods.
-    typedef HashMap<RefPtr<Node>, int> NodeToIdMap;
-    int bind(Node*, NodeToIdMap*);
-    void unbind(Node*, NodeToIdMap*);
-
-    Node* assertEditableNode(ErrorString&, int nodeId);
-    Element* assertEditableElement(ErrorString&, int nodeId);
-
-    int pushNodePathToFrontend(Node*);
-    void pushChildNodesToFrontend(int nodeId, int depth = 1);
-
-    Ref<Inspector::Protocol::DOM::Node> buildObjectForNode(Node*, int depth, NodeToIdMap*);
-    Ref<Inspector::Protocol::Array<String>> buildArrayForElementAttributes(Element*);
-    Ref<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap);
-    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> buildArrayForPseudoElements(const Element&, NodeToIdMap* nodesMap);
-    Ref<Inspector::Protocol::DOM::EventListener> buildObjectForEventListener(const RegisteredEventListener&, int identifier, const AtomicString& eventType, Node*, const String* objectGroupId, bool disabled = false);
-    RefPtr<Inspector::Protocol::DOM::AccessibilityProperties> buildObjectForAccessibilityProperties(Node*);
-    void processAccessibilityChildren(RefPtr<AccessibilityObject>&&, RefPtr<Inspector::Protocol::Array<int>>&&);
-    
-    Node* nodeForPath(const String& path);
-    Node* nodeForObjectId(const String& objectId);
-
-    void discardBindings();
-
-    void innerHighlightQuad(std::unique_ptr<FloatQuad>, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* usePageCoordinates);
-
-    Inspector::InjectedScriptManager& m_injectedScriptManager;
-    std::unique_ptr<Inspector::DOMFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::DOMBackendDispatcher> m_backendDispatcher;
-    InspectorPageAgent* m_pageAgent { nullptr };
-
-    InspectorOverlay* m_overlay { nullptr };
-    DOMListener* m_domListener { nullptr };
-    NodeToIdMap m_documentNodeToIdMap;
-    typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap;
-    HashMap<String, NodeToBackendIdMap> m_nodeGroupToBackendIdMap;
-    // Owns node mappings for dangling nodes.
-    Vector<std::unique_ptr<NodeToIdMap>> m_danglingNodeToIdMaps;
-    HashMap<int, Node*> m_idToNode;
-    HashMap<int, NodeToIdMap*> m_idToNodesMap;
-    HashSet<int> m_childrenRequested;
-    HashMap<BackendNodeId, std::pair<Node*, String>> m_backendIdToNode;
-    int m_lastNodeId { 1 };
-    BackendNodeId m_lastBackendNodeId { -1 };
-    RefPtr<Document> m_document;
-    typedef HashMap<String, Vector<RefPtr<Node>>> SearchResults;
-    SearchResults m_searchResults;
-    std::unique_ptr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask;
-    RefPtr<Node> m_nodeToFocus;
-    RefPtr<Node> m_mousedOverNode;
-    std::unique_ptr<HighlightConfig> m_inspectModeHighlightConfig;
-    std::unique_ptr<InspectorHistory> m_history;
-    std::unique_ptr<DOMEditor> m_domEditor;
-    bool m_searchingForNode { false };
-    bool m_suppressAttributeModifiedEvent { false };
-    bool m_documentRequested { false };
-
-    struct InspectorEventListener {
-        int identifier { 1 };
-        RefPtr<EventTarget> eventTarget;
-        AtomicString eventType;
-        bool useCapture { false };
-        bool disabled { false };
-
-        InspectorEventListener() { }
-
-        InspectorEventListener(int identifier, EventTarget& eventTarget, const AtomicString& eventType, bool useCapture)
-            : identifier(identifier)
-            , eventTarget(&eventTarget)
-            , eventType(eventType)
-            , useCapture(useCapture)
-        {
-        }
-    };
-
-    HashMap<EventListener*, InspectorEventListener> m_eventListenerEntries;
-    int m_lastEventListenerId { 1 };
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp     2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp        2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,427 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2015 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:
- *
- *     * 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 "InspectorDOMDebuggerAgent.h"
-
-#include "HTMLElement.h"
-#include "InspectorDOMAgent.h"
-#include "InstrumentingAgents.h"
-#include <inspector/ContentSearchUtilities.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorValues.h>
-#include <yarr/RegularExpression.h>
-
-namespace {
-
-enum DOMBreakpointType {
-    SubtreeModified = 0,
-    AttributeModified,
-    NodeRemoved,
-    DOMBreakpointTypesCount
-};
-
-static const char* const listenerEventCategoryType = "listener:";
-static const char* const instrumentationEventCategoryType = "instrumentation:";
-
-const uint32_t inheritableDOMBreakpointTypesMask = (1 << SubtreeModified);
-const int domBreakpointDerivedTypeShift = 16;
-
-}
-
-
-namespace WebCore {
-using namespace Inspector;
-
-InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent(WebAgentContext& context, InspectorDOMAgent* domAgent, InspectorDebuggerAgent* debuggerAgent)
-    : InspectorAgentBase(ASCIILiteral("DOMDebugger"), context)
-    , m_backendDispatcher(Inspector::DOMDebuggerBackendDispatcher::create(context.backendDispatcher, this))
-    , m_domAgent(domAgent)
-    , m_debuggerAgent(debuggerAgent)
-{
-    m_debuggerAgent->setListener(this);
-}
-
-InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent()
-{
-    ASSERT(!m_debuggerAgent);
-    ASSERT(!m_instrumentingAgents.inspectorDOMDebuggerAgent());
-}
-
-// Browser debugger agent enabled only when JS debugger is enabled.
-void InspectorDOMDebuggerAgent::debuggerWasEnabled()
-{
-    m_instrumentingAgents.setInspectorDOMDebuggerAgent(this);
-}
-
-void InspectorDOMDebuggerAgent::debuggerWasDisabled()
-{
-    disable();
-}
-
-void InspectorDOMDebuggerAgent::disable()
-{
-    m_instrumentingAgents.setInspectorDOMDebuggerAgent(nullptr);
-    discardBindings();
-}
-
-void InspectorDOMDebuggerAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    disable();
-}
-
-void InspectorDOMDebuggerAgent::discardAgent()
-{
-    m_debuggerAgent->setListener(nullptr);
-    m_debuggerAgent = nullptr;
-}
-
-void InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded()
-{
-    discardBindings();
-}
-
-void InspectorDOMDebuggerAgent::discardBindings()
-{
-    m_domBreakpoints.clear();
-    m_xhrBreakpoints.clear();
-}
-
-void InspectorDOMDebuggerAgent::setEventListenerBreakpoint(ErrorString& error, const String& eventName)
-{
-    setBreakpoint(error, String(listenerEventCategoryType) + eventName);
-}
-
-void InspectorDOMDebuggerAgent::setInstrumentationBreakpoint(ErrorString& error, const String& eventName)
-{
-    setBreakpoint(error, String(instrumentationEventCategoryType) + eventName);
-}
-
-void InspectorDOMDebuggerAgent::setBreakpoint(ErrorString& error, const String& eventName)
-{
-    if (eventName.isEmpty()) {
-        error = ASCIILiteral("Event name is empty");
-        return;
-    }
-
-    m_eventListenerBreakpoints.add(eventName);
-}
-
-void InspectorDOMDebuggerAgent::removeEventListenerBreakpoint(ErrorString& error, const String& eventName)
-{
-    removeBreakpoint(error, String(listenerEventCategoryType) + eventName);
-}
-
-void InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint(ErrorString& error, const String& eventName)
-{
-    removeBreakpoint(error, String(instrumentationEventCategoryType) + eventName);
-}
-
-void InspectorDOMDebuggerAgent::removeBreakpoint(ErrorString& error, const String& eventName)
-{
-    if (eventName.isEmpty()) {
-        error = ASCIILiteral("Event name is empty");
-        return;
-    }
-
-    m_eventListenerBreakpoints.remove(eventName);
-}
-
-void InspectorDOMDebuggerAgent::didInvalidateStyleAttr(Node& node)
-{
-    if (hasBreakpoint(&node, AttributeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(node, AttributeModified, false, eventData.get());
-        m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
-    }
-}
-
-void InspectorDOMDebuggerAgent::didInsertDOMNode(Node& node)
-{
-    if (m_domBreakpoints.size()) {
-        uint32_t mask = m_domBreakpoints.get(InspectorDOMAgent::innerParentNode(&node));
-        uint32_t inheritableTypesMask = (mask | (mask >> domBreakpointDerivedTypeShift)) & inheritableDOMBreakpointTypesMask;
-        if (inheritableTypesMask)
-            updateSubtreeBreakpoints(&node, inheritableTypesMask, true);
-    }
-}
-
-void InspectorDOMDebuggerAgent::didRemoveDOMNode(Node& node)
-{
-    if (m_domBreakpoints.size()) {
-        // Remove subtree breakpoints.
-        m_domBreakpoints.remove(&node);
-        Vector<Node*> stack(1, InspectorDOMAgent::innerFirstChild(&node));
-        do {
-            Node* node = stack.last();
-            stack.removeLast();
-            if (!node)
-                continue;
-            m_domBreakpoints.remove(node);
-            stack.append(InspectorDOMAgent::innerFirstChild(node));
-            stack.append(InspectorDOMAgent::innerNextSibling(node));
-        } while (!stack.isEmpty());
-    }
-}
-
-static int domTypeForName(ErrorString& errorString, const String& typeString)
-{
-    if (typeString == "subtree-modified")
-        return SubtreeModified;
-    if (typeString == "attribute-modified")
-        return AttributeModified;
-    if (typeString == "node-removed")
-        return NodeRemoved;
-    errorString = makeString("Unknown DOM breakpoint type: ", typeString);
-    return -1;
-}
-
-static String domTypeName(int type)
-{
-    switch (type) {
-    case SubtreeModified: return ASCIILiteral("subtree-modified");
-    case AttributeModified: return ASCIILiteral("attribute-modified");
-    case NodeRemoved: return ASCIILiteral("node-removed");
-    default: break;
-    }
-    return emptyString();
-}
-
-void InspectorDOMDebuggerAgent::setDOMBreakpoint(ErrorString& errorString, int nodeId, const String& typeString)
-{
-    Node* node = m_domAgent->assertNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    int type = domTypeForName(errorString, typeString);
-    if (type == -1)
-        return;
-
-    uint32_t rootBit = 1 << type;
-    m_domBreakpoints.set(node, m_domBreakpoints.get(node) | rootBit);
-    if (rootBit & inheritableDOMBreakpointTypesMask) {
-        for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child = InspectorDOMAgent::innerNextSibling(child))
-            updateSubtreeBreakpoints(child, rootBit, true);
-    }
-}
-
-void InspectorDOMDebuggerAgent::removeDOMBreakpoint(ErrorString& errorString, int nodeId, const String& typeString)
-{
-    Node* node = m_domAgent->assertNode(errorString, nodeId);
-    if (!node)
-        return;
-    int type = domTypeForName(errorString, typeString);
-    if (type == -1)
-        return;
-
-    uint32_t rootBit = 1 << type;
-    uint32_t mask = m_domBreakpoints.get(node) & ~rootBit;
-    if (mask)
-        m_domBreakpoints.set(node, mask);
-    else
-        m_domBreakpoints.remove(node);
-
-    if ((rootBit & inheritableDOMBreakpointTypesMask) && !(mask & (rootBit << domBreakpointDerivedTypeShift))) {
-        for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child = InspectorDOMAgent::innerNextSibling(child))
-            updateSubtreeBreakpoints(child, rootBit, false);
-    }
-}
-
-void InspectorDOMDebuggerAgent::willInsertDOMNode(Node& parent)
-{
-    if (!m_debuggerAgent->breakpointsActive())
-        return;
-
-    if (hasBreakpoint(&parent, SubtreeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(parent, SubtreeModified, true, eventData.get());
-        m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
-    }
-}
-
-void InspectorDOMDebuggerAgent::willRemoveDOMNode(Node& node)
-{
-    if (!m_debuggerAgent->breakpointsActive())
-        return;
-
-    Node* parentNode = InspectorDOMAgent::innerParentNode(&node);
-    if (hasBreakpoint(&node, NodeRemoved)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(node, NodeRemoved, false, eventData.get());
-        m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
-    } else if (parentNode && hasBreakpoint(parentNode, SubtreeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(node, SubtreeModified, false, eventData.get());
-        m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
-    }
-}
-
-void InspectorDOMDebuggerAgent::willModifyDOMAttr(Element& element)
-{
-    if (!m_debuggerAgent->breakpointsActive())
-        return;
-
-    if (hasBreakpoint(&element, AttributeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(element, AttributeModified, false, eventData.get());
-        m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
-    }
-}
-
-void InspectorDOMDebuggerAgent::descriptionForDOMEvent(Node& target, int breakpointType, bool insertion, InspectorObject& description)
-{
-    ASSERT(hasBreakpoint(&target, breakpointType));
-
-    Node* breakpointOwner = &target;
-    if ((1 << breakpointType) & inheritableDOMBreakpointTypesMask) {
-        // For inheritable breakpoint types, target node isn't always the same as the node that owns a breakpoint.
-        // Target node may be unknown to frontend, so we need to push it first.
-        RefPtr<Inspector::Protocol::Runtime::RemoteObject> targetNodeObject = m_domAgent->resolveNode(&target, InspectorDebuggerAgent::backtraceObjectGroup);
-        description.setValue("targetNode", targetNodeObject);
-
-        // Find breakpoint owner node.
-        if (!insertion)
-            breakpointOwner = InspectorDOMAgent::innerParentNode(&target);
-        ASSERT(breakpointOwner);
-        while (!(m_domBreakpoints.get(breakpointOwner) & (1 << breakpointType))) {
-            Node* parentNode = InspectorDOMAgent::innerParentNode(breakpointOwner);
-            if (!parentNode)
-                break;
-            breakpointOwner = parentNode;
-        }
-
-        if (breakpointType == SubtreeModified)
-            description.setBoolean("insertion", insertion);
-    }
-
-    int breakpointOwnerNodeId = m_domAgent->boundNodeId(breakpointOwner);
-    ASSERT(breakpointOwnerNodeId);
-    description.setInteger("nodeId", breakpointOwnerNodeId);
-    description.setString("type", domTypeName(breakpointType));
-}
-
-bool InspectorDOMDebuggerAgent::hasBreakpoint(Node* node, int type)
-{
-    uint32_t rootBit = 1 << type;
-    uint32_t derivedBit = rootBit << domBreakpointDerivedTypeShift;
-    return m_domBreakpoints.get(node) & (rootBit | derivedBit);
-}
-
-void InspectorDOMDebuggerAgent::updateSubtreeBreakpoints(Node* node, uint32_t rootMask, bool set)
-{
-    uint32_t oldMask = m_domBreakpoints.get(node);
-    uint32_t derivedMask = rootMask << domBreakpointDerivedTypeShift;
-    uint32_t newMask = set ? oldMask | derivedMask : oldMask & ~derivedMask;
-    if (newMask)
-        m_domBreakpoints.set(node, newMask);
-    else
-        m_domBreakpoints.remove(node);
-
-    uint32_t newRootMask = rootMask & ~newMask;
-    if (!newRootMask)
-        return;
-
-    for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child = InspectorDOMAgent::innerNextSibling(child))
-        updateSubtreeBreakpoints(child, newRootMask, set);
-}
-
-void InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded(bool isDOMEvent, const String& eventName, bool synchronous)
-{
-    String fullEventName = (isDOMEvent ? listenerEventCategoryType : instrumentationEventCategoryType) + eventName;
-
-    bool shouldPause = m_debuggerAgent->pauseOnNextStatementEnabled() || m_eventListenerBreakpoints.contains(fullEventName);
-    if (!shouldPause)
-        return;
-
-    Ref<InspectorObject> eventData = InspectorObject::create();
-    eventData->setString(ASCIILiteral("eventName"), fullEventName);
-
-    if (synchronous)
-        m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::EventListener, WTFMove(eventData));
-    else
-        m_debuggerAgent->schedulePauseOnNextStatement(Inspector::DebuggerFrontendDispatcher::Reason::EventListener, WTFMove(eventData));
-}
-
-void InspectorDOMDebuggerAgent::setXHRBreakpoint(ErrorString&, const String& url, const bool* const optionalIsRegex)
-{
-    if (url.isEmpty()) {
-        m_pauseOnAllXHRsEnabled = true;
-        return;
-    }
-
-    bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
-    m_xhrBreakpoints.set(url, isRegex ? XHRBreakpointType::RegularExpression : XHRBreakpointType::Text);
-}
-
-void InspectorDOMDebuggerAgent::removeXHRBreakpoint(ErrorString&, const String& url)
-{
-    if (url.isEmpty()) {
-        m_pauseOnAllXHRsEnabled = false;
-        return;
-    }
-
-    m_xhrBreakpoints.remove(url);
-}
-
-void InspectorDOMDebuggerAgent::willSendXMLHttpRequest(const String& url)
-{
-    if (!m_debuggerAgent->breakpointsActive())
-        return;
-
-    String breakpointURL;
-    if (m_pauseOnAllXHRsEnabled)
-        breakpointURL = emptyString();
-    else {
-        for (auto& entry : m_xhrBreakpoints) {
-            const auto& query = entry.key;
-            bool isRegex = entry.value == XHRBreakpointType::RegularExpression;
-            auto regex = ContentSearchUtilities::createSearchRegex(query, false, isRegex);
-            if (regex.match(url) != -1) {
-                breakpointURL = query;
-                break;
-            }
-        }
-    }
-
-    if (breakpointURL.isNull())
-        return;
-
-    Ref<InspectorObject> eventData = InspectorObject::create();
-    eventData->setString("breakpointURL", breakpointURL);
-    eventData->setString("url", url);
-    m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::XHR, WTFMove(eventData));
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMDebuggerAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h       2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h  2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,110 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2015 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:
- *
- *     * 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.
- */
-
-#pragma once
-
-#include "InspectorWebAgentBase.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/agents/InspectorDebuggerAgent.h>
-#include <wtf/HashMap.h>
-#include <wtf/text/WTFString.h>
-
-namespace Inspector {
-class InspectorObject;
-}
-
-namespace WebCore {
-
-class Element;
-class InspectorDOMAgent;
-class Node;
-
-typedef String ErrorString;
-
-class InspectorDOMDebuggerAgent final : public InspectorAgentBase, public Inspector::InspectorDebuggerAgent::Listener, public Inspector::DOMDebuggerBackendDispatcherHandler {
-    WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorDOMDebuggerAgent(WebAgentContext&, InspectorDOMAgent*, Inspector::InspectorDebuggerAgent*);
-    virtual ~InspectorDOMDebuggerAgent();
-
-    // DOMDebugger API
-    void setXHRBreakpoint(ErrorString&, const String& url, const bool* const optionalIsRegex) override;
-    void removeXHRBreakpoint(ErrorString&, const String& url) override;
-    void setEventListenerBreakpoint(ErrorString&, const String& eventName) override;
-    void removeEventListenerBreakpoint(ErrorString&, const String& eventName) override;
-    void setInstrumentationBreakpoint(ErrorString&, const String& eventName) override;
-    void removeInstrumentationBreakpoint(ErrorString&, const String& eventName) override;
-    void setDOMBreakpoint(ErrorString&, int nodeId, const String& type) override;
-    void removeDOMBreakpoint(ErrorString&, int nodeId, const String& type) override;
-
-    // InspectorInstrumentation
-    void willInsertDOMNode(Node& parent);
-    void didInvalidateStyleAttr(Node&);
-    void didInsertDOMNode(Node&);
-    void willRemoveDOMNode(Node&);
-    void didRemoveDOMNode(Node&);
-    void willModifyDOMAttr(Element&);
-    void willSendXMLHttpRequest(const String& url);
-    void pauseOnNativeEventIfNeeded(bool isDOMEvent, const String& eventName, bool synchronous);
-    void mainFrameDOMContentLoaded();
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-    void discardAgent() override;
-
-private:
-    // Inspector::InspectorDebuggerAgent::Listener implementation.
-    void debuggerWasEnabled() override;
-    void debuggerWasDisabled() override;
-    void disable();
-
-    void descriptionForDOMEvent(Node& target, int breakpointType, bool insertion, Inspector::InspectorObject& description);
-    void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set);
-    bool hasBreakpoint(Node*, int type);
-    void discardBindings();
-    void setBreakpoint(ErrorString&, const String& eventName);
-    void removeBreakpoint(ErrorString&, const String& eventName);
-
-    RefPtr<Inspector::DOMDebuggerBackendDispatcher> m_backendDispatcher;
-    InspectorDOMAgent* m_domAgent { nullptr };
-    Inspector::InspectorDebuggerAgent* m_debuggerAgent { nullptr };
-
-    HashMap<Node*, uint32_t> m_domBreakpoints;
-    HashSet<String> m_eventListenerBreakpoints;
-
-    enum class XHRBreakpointType { Text, RegularExpression };
-
-    HashMap<String, XHRBreakpointType> m_xhrBreakpoints;
-    bool m_pauseOnAllXHRsEnabled { false };
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMStorageAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp      2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp 2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,201 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Samsung Electronics. All rights reserved.
- * Copyright (C) 2015 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.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorDOMStorageAgent.h"
-
-#include "DOMException.h"
-#include "DOMWindow.h"
-#include "Database.h"
-#include "Document.h"
-#include "Frame.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "Page.h"
-#include "SecurityOrigin.h"
-#include "SecurityOriginData.h"
-#include "Storage.h"
-#include "StorageNamespace.h"
-#include "StorageNamespaceProvider.h"
-#include "StorageType.h"
-#include "VoidCallback.h"
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorValues.h>
-
-
-namespace WebCore {
-using namespace Inspector;
-
-InspectorDOMStorageAgent::InspectorDOMStorageAgent(WebAgentContext& context, InspectorPageAgent* pageAgent)
-    : InspectorAgentBase(ASCIILiteral("DOMStorage"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::DOMStorageFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::DOMStorageBackendDispatcher::create(context.backendDispatcher, this))
-    , m_pageAgent(pageAgent)
-{
-    m_instrumentingAgents.setInspectorDOMStorageAgent(this);
-}
-
-InspectorDOMStorageAgent::~InspectorDOMStorageAgent()
-{
-    m_instrumentingAgents.setInspectorDOMStorageAgent(nullptr);
-}
-
-void InspectorDOMStorageAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorDOMStorageAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString unused;
-    disable(unused);
-}
-
-void InspectorDOMStorageAgent::enable(ErrorString&)
-{
-    m_enabled = true;
-}
-
-void InspectorDOMStorageAgent::disable(ErrorString&)
-{
-    m_enabled = false;
-}
-
-void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString& errorString, const InspectorObject& storageId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Array<String>>>& items)
-{
-    Frame* frame;
-    RefPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, frame);
-    if (!storageArea) {
-        errorString = ASCIILiteral("No StorageArea for given storageId");
-        return;
-    }
-
-    auto storageItems = Inspector::Protocol::Array<Inspector::Protocol::Array<String>>::create();
-
-    for (unsigned i = 0; i < storageArea->length(); ++i) {
-        String key = storageArea->key(i);
-        String value = storageArea->item(key);
-
-        auto entry = Inspector::Protocol::Array<String>::create();
-        entry->addItem(key);
-        entry->addItem(value);
-        storageItems->addItem(WTFMove(entry));
-    }
-
-    items = WTFMove(storageItems);
-}
-
-void InspectorDOMStorageAgent::setDOMStorageItem(ErrorString& errorString, const InspectorObject& storageId, const String& key, const String& value)
-{
-    Frame* frame;
-    RefPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, frame);
-    if (!storageArea) {
-        errorString = ASCIILiteral("Storage not found");
-        return;
-    }
-
-    bool quotaException = false;
-    storageArea->setItem(frame, key, value, quotaException);
-    if (quotaException)
-        errorString = DOMException::name(QuotaExceededError);
-}
-
-void InspectorDOMStorageAgent::removeDOMStorageItem(ErrorString& errorString, const InspectorObject& storageId, const String& key)
-{
-    Frame* frame;
-    RefPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, frame);
-    if (!storageArea) {
-        errorString = ASCIILiteral("Storage not found");
-        return;
-    }
-
-    storageArea->removeItem(frame, key);
-}
-
-String InspectorDOMStorageAgent::storageId(Storage& storage)
-{
-    Document* document = storage.frame()->document();
-    ASSERT(document);
-    DOMWindow* window = document->domWindow();
-    ASSERT(window);
-    Ref<SecurityOrigin> securityOrigin = document->securityOrigin();
-    bool isLocalStorage = window->optionalLocalStorage() == &storage;
-    return storageId(securityOrigin.ptr(), isLocalStorage)->toJSONString();
-}
-
-RefPtr<Inspector::Protocol::DOMStorage::StorageId> InspectorDOMStorageAgent::storageId(SecurityOrigin* securityOrigin, bool isLocalStorage)
-{
-    return Inspector::Protocol::DOMStorage::StorageId::create()
-        .setSecurityOrigin(securityOrigin->toRawString())
-        .setIsLocalStorage(isLocalStorage)
-        .release();
-}
-
-void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin)
-{
-    if (!m_enabled)
-        return;
-
-    RefPtr<Inspector::Protocol::DOMStorage::StorageId> id = storageId(securityOrigin, storageType == StorageType::Local);
-
-    if (key.isNull())
-        m_frontendDispatcher->domStorageItemsCleared(id);
-    else if (newValue.isNull())
-        m_frontendDispatcher->domStorageItemRemoved(id, key);
-    else if (oldValue.isNull())
-        m_frontendDispatcher->domStorageItemAdded(id, key, newValue);
-    else
-        m_frontendDispatcher->domStorageItemUpdated(id, key, oldValue, newValue);
-}
-
-RefPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(ErrorString& errorString, const InspectorObject& storageId, Frame*& targetFrame)
-{
-    String securityOrigin;
-    bool isLocalStorage = false;
-    bool success = storageId.getString(ASCIILiteral("securityOrigin"), securityOrigin);
-    if (success)
-        success = storageId.getBoolean(ASCIILiteral("isLocalStorage"), isLocalStorage);
-    if (!success) {
-        errorString = ASCIILiteral("Invalid storageId format");
-        targetFrame = nullptr;
-        return nullptr;
-    }
-
-    targetFrame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin);
-    if (!targetFrame) {
-        errorString = ASCIILiteral("Frame not found for the given security origin");
-        return nullptr;
-    }
-
-    if (!isLocalStorage)
-        return m_pageAgent->page().sessionStorage()->storageArea(SecurityOriginData::fromSecurityOrigin(targetFrame->document()->securityOrigin()));
-    return m_pageAgent->page().storageNamespaceProvider().localStorageArea(*targetFrame->document());
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMStorageAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h        2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h   2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2015 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.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "InspectorWebAgentBase.h"
-#include "StorageArea.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <wtf/text/WTFString.h>
-
-namespace Inspector {
-class DOMStorageFrontendDispatcher;
-}
-
-namespace WebCore {
-
-class Frame;
-class InspectorPageAgent;
-class Page;
-class SecurityOrigin;
-class Storage;
-
-typedef String ErrorString;
-
-class InspectorDOMStorageAgent final : public InspectorAgentBase, public Inspector::DOMStorageBackendDispatcherHandler {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorDOMStorageAgent(WebAgentContext&, InspectorPageAgent*);
-    virtual ~InspectorDOMStorageAgent();
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    // Called from the front-end.
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void getDOMStorageItems(ErrorString&, const Inspector::InspectorObject& storageId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Array<String>>>& items) override;
-    void setDOMStorageItem(ErrorString&, const Inspector::InspectorObject& storageId, const String& key, const String& value) override;
-    void removeDOMStorageItem(ErrorString&, const Inspector::InspectorObject& storageId, const String& key) override;
-
-    // Called from the injected script.
-    String storageId(Storage&);
-    RefPtr<Inspector::Protocol::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage);
-
-    // InspectorInstrumentation
-    void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
-
-private:
-    RefPtr<StorageArea> findStorageArea(ErrorString&, const Inspector::InspectorObject&, Frame*&);
-
-    std::unique_ptr<Inspector::DOMStorageFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::DOMStorageBackendDispatcher> m_backendDispatcher;
-    InspectorPageAgent* m_pageAgent { nullptr };
-
-    bool m_enabled { false };
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDatabaseAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp        2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp   2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,317 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2015 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.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorDatabaseAgent.h"
-
-#include "Database.h"
-#include "InspectorDatabaseResource.h"
-#include "InstrumentingAgents.h"
-#include "SQLError.h"
-#include "SQLResultSet.h"
-#include "SQLResultSetRowList.h"
-#include "SQLStatementCallback.h"
-#include "SQLStatementErrorCallback.h"
-#include "SQLTransaction.h"
-#include "SQLTransactionCallback.h"
-#include "SQLTransactionErrorCallback.h"
-#include "SQLValue.h"
-#include "VoidCallback.h"
-#include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
-#include <wtf/Vector.h>
-
-
-namespace WebCore {
-using namespace Inspector;
-
-using ExecuteSQLCallback = Inspector::DatabaseBackendDispatcherHandler::ExecuteSQLCallback;
-
-namespace {
-
-void reportTransactionFailed(ExecuteSQLCallback& requestCallback, SQLError& error)
-{
-    auto errorObject = Inspector::Protocol::Database::Error::create()
-        .setMessage(error.message())
-        .setCode(error.code())
-        .release();
-    requestCallback.sendSuccess(nullptr, nullptr, WTFMove(errorObject));
-}
-
-class StatementCallback final : public SQLStatementCallback {
-public:
-    static Ref<StatementCallback> create(ScriptExecutionContext* context, Ref<ExecuteSQLCallback>&& requestCallback)
-    {
-        return adoptRef(*new StatementCallback(context, WTFMove(requestCallback)));
-    }
-
-private:
-    StatementCallback(ScriptExecutionContext* context, Ref<ExecuteSQLCallback>&& requestCallback)
-        : SQLStatementCallback(context)
-        , m_requestCallback(WTFMove(requestCallback))
-    {
-    }
-
-    CallbackResult<void> handleEvent(SQLTransaction&, SQLResultSet& resultSet) final
-    {
-        auto& rowList = resultSet.rows();
-
-        auto columnNames = Inspector::Protocol::Array<String>::create();
-        for (auto& column : rowList.columnNames())
-            columnNames->addItem(column);
-
-        auto values = Inspector::Protocol::Array<InspectorValue>::create();
-        for (auto& value : rowList.values()) {
-            auto inspectorValue = WTF::switchOn(value,
-                [] (const std::nullptr_t&) { return InspectorValue::null(); },
-                [] (const String& string) { return InspectorValue::create(string); },
-                [] (double number) { return InspectorValue::create(number); }
-            );
-            values->addItem(WTFMove(inspectorValue));
-        }
-        m_requestCallback->sendSuccess(WTFMove(columnNames), WTFMove(values), nullptr);
-        return { };
-    }
-
-    Ref<ExecuteSQLCallback> m_requestCallback;
-};
-
-class StatementErrorCallback final : public SQLStatementErrorCallback {
-public:
-    static Ref<StatementErrorCallback> create(ScriptExecutionContext* context, Ref<ExecuteSQLCallback>&& requestCallback)
-    {
-        return adoptRef(*new StatementErrorCallback(context, WTFMove(requestCallback)));
-    }
-
-private:
-    StatementErrorCallback(ScriptExecutionContext* context, Ref<ExecuteSQLCallback>&& requestCallback)
-        : SQLStatementErrorCallback(context)
-        , m_requestCallback(WTFMove(requestCallback))
-    {
-    }
-
-    CallbackResult<bool> handleEvent(SQLTransaction&, SQLError& error) final
-    {
-        reportTransactionFailed(m_requestCallback.copyRef(), error);
-        return true;
-    }
-
-    Ref<ExecuteSQLCallback> m_requestCallback;
-};
-
-class TransactionCallback final : public SQLTransactionCallback {
-public:
-    static Ref<TransactionCallback> create(ScriptExecutionContext* context, const String& sqlStatement, Ref<ExecuteSQLCallback>&& requestCallback)
-    {
-        return adoptRef(*new TransactionCallback(context, sqlStatement, WTFMove(requestCallback)));
-    }
-
-private:
-    TransactionCallback(ScriptExecutionContext* context, const String& sqlStatement, Ref<ExecuteSQLCallback>&& requestCallback)
-        : SQLTransactionCallback(context)
-        , m_sqlStatement(sqlStatement)
-        , m_requestCallback(WTFMove(requestCallback))
-    {
-    }
-
-    CallbackResult<void> handleEvent(SQLTransaction& transaction) final
-    {
-        if (!m_requestCallback->isActive())
-            return { };
-
-        Ref<SQLStatementCallback> callback(StatementCallback::create(scriptExecutionContext(), m_requestCallback.copyRef()));
-        Ref<SQLStatementErrorCallback> errorCallback(StatementErrorCallback::create(scriptExecutionContext(), m_requestCallback.copyRef()));
-        transaction.executeSql(m_sqlStatement, { }, WTFMove(callback), WTFMove(errorCallback));
-        return { };
-    }
-
-    String m_sqlStatement;
-    Ref<ExecuteSQLCallback> m_requestCallback;
-};
-
-class TransactionErrorCallback final : public SQLTransactionErrorCallback {
-public:
-    static Ref<TransactionErrorCallback> create(ScriptExecutionContext* context, Ref<ExecuteSQLCallback>&& requestCallback)
-    {
-        return adoptRef(*new TransactionErrorCallback(context, WTFMove(requestCallback)));
-    }
-
-private:
-    TransactionErrorCallback(ScriptExecutionContext* context, Ref<ExecuteSQLCallback>&& requestCallback)
-        : SQLTransactionErrorCallback(context)
-        , m_requestCallback(WTFMove(requestCallback))
-    {
-    }
-
-    CallbackResult<void> handleEvent(SQLError& error) final
-    {
-        reportTransactionFailed(m_requestCallback.get(), error);
-        return { };
-    }
-
-    Ref<ExecuteSQLCallback> m_requestCallback;
-};
-
-class TransactionSuccessCallback final : public VoidCallback {
-public:
-    static Ref<TransactionSuccessCallback> create(ScriptExecutionContext* context)
-    {
-        return adoptRef(*new TransactionSuccessCallback(context));
-    }
-
-    CallbackResult<void> handleEvent() final { return { }; }
-
-private:
-    TransactionSuccessCallback(ScriptExecutionContext* context)
-        : VoidCallback(context)
-    {
-    }
-};
-
-} // namespace
-
-void InspectorDatabaseAgent::didOpenDatabase(RefPtr<Database>&& database, const String& domain, const String& name, const String& version)
-{
-    if (auto* resource = findByFileName(database->fileName())) {
-        resource->setDatabase(WTFMove(database));
-        return;
-    }
-
-    auto resource = InspectorDatabaseResource::create(WTFMove(database), domain, name, version);
-    m_resources.add(resource->id(), resource.ptr());
-    // Resources are only bound while visible.
-    if (m_enabled)
-        resource->bind(m_frontendDispatcher.get());
-}
-
-void InspectorDatabaseAgent::clearResources()
-{
-    m_resources.clear();
-}
-
-InspectorDatabaseAgent::InspectorDatabaseAgent(WebAgentContext& context)
-    : InspectorAgentBase(ASCIILiteral("Database"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::DatabaseFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::DatabaseBackendDispatcher::create(context.backendDispatcher, this))
-{
-    m_instrumentingAgents.setInspectorDatabaseAgent(this);
-}
-
-InspectorDatabaseAgent::~InspectorDatabaseAgent()
-{
-    m_instrumentingAgents.setInspectorDatabaseAgent(nullptr);
-}
-
-void InspectorDatabaseAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorDatabaseAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString unused;
-    disable(unused);
-}
-
-void InspectorDatabaseAgent::enable(ErrorString&)
-{
-    if (m_enabled)
-        return;
-    m_enabled = true;
-
-    for (auto& resource : m_resources.values())
-        resource->bind(m_frontendDispatcher.get());
-}
-
-void InspectorDatabaseAgent::disable(ErrorString&)
-{
-    if (!m_enabled)
-        return;
-    m_enabled = false;
-}
-
-void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString& error, const String& databaseId, RefPtr<Inspector::Protocol::Array<String>>& names)
-{
-    if (!m_enabled) {
-        error = ASCIILiteral("Database agent is not enabled");
-        return;
-    }
-
-    names = Inspector::Protocol::Array<String>::create();
-
-    if (auto* database = databaseForId(databaseId)) {
-        for (auto& tableName : database->tableNames())
-            names->addItem(tableName);
-    }
-}
-
-void InspectorDatabaseAgent::executeSQL(ErrorString&, const String& databaseId, const String& query, Ref<ExecuteSQLCallback>&& requestCallback)
-{
-    if (!m_enabled) {
-        requestCallback->sendFailure("Database agent is not enabled");
-        return;
-    }
-
-    auto* database = databaseForId(databaseId);
-    if (!database) {
-        requestCallback->sendFailure("Database not found");
-        return;
-    }
-
-    database->transaction(TransactionCallback::create(&database->scriptExecutionContext(), query, requestCallback.copyRef()),
-        TransactionErrorCallback::create(&database->scriptExecutionContext(), requestCallback.copyRef()),
-        TransactionSuccessCallback::create(&database->scriptExecutionContext()));
-}
-
-String InspectorDatabaseAgent::databaseId(Database& database)
-{
-    for (auto& resource : m_resources) {
-        if (resource.value->database() == &database)
-            return resource.key;
-    }
-    return String();
-}
-
-InspectorDatabaseResource* InspectorDatabaseAgent::findByFileName(const String& fileName)
-{
-    for (auto& resource : m_resources.values()) {
-        if (resource->database()->fileName() == fileName)
-            return resource.get();
-    }
-    return nullptr;
-}
-
-Database* InspectorDatabaseAgent::databaseForId(const String& databaseId)
-{
-    auto* resource = m_resources.get(databaseId);
-    if (!resource)
-        return nullptr;
-    return resource->database();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDatabaseAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h  2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h     2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,78 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2015 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.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "InspectorWebAgentBase.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <wtf/HashMap.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class Database;
-class InspectorDatabaseResource;
-
-typedef String ErrorString;
-
-class InspectorDatabaseAgent final : public InspectorAgentBase, public Inspector::DatabaseBackendDispatcherHandler {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit InspectorDatabaseAgent(WebAgentContext&);
-    virtual ~InspectorDatabaseAgent();
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    void clearResources();
-
-    // Called from the front-end.
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void getDatabaseTableNames(ErrorString&, const String& databaseId, RefPtr<Inspector::Protocol::Array<String>>& names) override;
-    void executeSQL(ErrorString&, const String& databaseId, const String& query, Ref<ExecuteSQLCallback>&&) override;
-
-    // Called from the injected script.
-    String databaseId(Database&);
-
-    void didOpenDatabase(RefPtr<Database>&&, const String& domain, const String& name, const String& version);
-private:
-    Database* databaseForId(const String& databaseId);
-    InspectorDatabaseResource* findByFileName(const String& fileName);
-
-    std::unique_ptr<Inspector::DatabaseFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::DatabaseBackendDispatcher> m_backendDispatcher;
-
-    typedef HashMap<String, RefPtr<InspectorDatabaseResource>> DatabaseResourcesMap;
-    DatabaseResourcesMap m_resources;
-    bool m_enabled { false };
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp       2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp  2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,735 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2015-2017 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:
- *
- *     * 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 "InspectorIndexedDBAgent.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "DOMStringList.h"
-#include "DOMWindow.h"
-#include "DOMWindowIndexedDatabase.h"
-#include "Document.h"
-#include "Event.h"
-#include "EventListener.h"
-#include "EventNames.h"
-#include "EventTarget.h"
-#include "Frame.h"
-#include "IDBBindingUtilities.h"
-#include "IDBCursor.h"
-#include "IDBCursorWithValue.h"
-#include "IDBDatabase.h"
-#include "IDBFactory.h"
-#include "IDBIndex.h"
-#include "IDBKey.h"
-#include "IDBKeyPath.h"
-#include "IDBKeyRange.h"
-#include "IDBObjectStore.h"
-#include "IDBOpenDBRequest.h"
-#include "IDBRequest.h"
-#include "IDBTransaction.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "ScriptState.h"
-#include "SecurityOrigin.h"
-#include <heap/HeapInlines.h>
-#include <inspector/InjectedScript.h>
-#include <inspector/InjectedScriptManager.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/Vector.h>
-
-using Inspector::Protocol::Array;
-using Inspector::Protocol::IndexedDB::DatabaseWithObjectStores;
-using Inspector::Protocol::IndexedDB::DataEntry;
-using Inspector::Protocol::IndexedDB::Key;
-using Inspector::Protocol::IndexedDB::KeyPath;
-using Inspector::Protocol::IndexedDB::KeyRange;
-using Inspector::Protocol::IndexedDB::ObjectStore;
-using Inspector::Protocol::IndexedDB::ObjectStoreIndex;
-
-typedef Inspector::BackendDispatcher::CallbackBase RequestCallback;
-typedef Inspector::IndexedDBBackendDispatcherHandler::RequestDatabaseNamesCallback RequestDatabaseNamesCallback;
-typedef Inspector::IndexedDBBackendDispatcherHandler::RequestDatabaseCallback RequestDatabaseCallback;
-typedef Inspector::IndexedDBBackendDispatcherHandler::RequestDataCallback RequestDataCallback;
-typedef Inspector::IndexedDBBackendDispatcherHandler::ClearObjectStoreCallback ClearObjectStoreCallback;
-
-
-namespace WebCore {
-using namespace Inspector;
-
-namespace {
-
-class ExecutableWithDatabase : public RefCounted<ExecutableWithDatabase> {
-public:
-    ExecutableWithDatabase(ScriptExecutionContext* context)
-        : m_context(context) { }
-    virtual ~ExecutableWithDatabase() = default;
-    void start(IDBFactory*, SecurityOrigin*, const String& databaseName);
-    virtual void execute(IDBDatabase&) = 0;
-    virtual RequestCallback& requestCallback() = 0;
-    ScriptExecutionContext* context() const { return m_context; }
-private:
-    ScriptExecutionContext* m_context;
-};
-
-class OpenDatabaseCallback final : public EventListener {
-public:
-    static Ref<OpenDatabaseCallback> create(ExecutableWithDatabase& executableWithDatabase)
-    {
-        return adoptRef(*new OpenDatabaseCallback(executableWithDatabase));
-    }
-
-    bool operator==(const EventListener& other) const final
-    {
-        return this == &other;
-    }
-
-    void handleEvent(ScriptExecutionContext&, Event& event) final
-    {
-        if (event.type() != eventNames().successEvent) {
-            m_executableWithDatabase->requestCallback().sendFailure("Unexpected event type.");
-            return;
-        }
-
-        auto& request = static_cast<IDBOpenDBRequest&>(*event.target());
-
-        auto result = request.result();
-        if (result.hasException()) {
-            m_executableWithDatabase->requestCallback().sendFailure("Could not get result in callback.");
-            return;
-        }
-
-        auto resultValue = result.releaseReturnValue();
-        if (!resultValue || !WTF::holds_alternative<RefPtr<IDBDatabase>>(resultValue.value())) {
-            m_executableWithDatabase->requestCallback().sendFailure("Unexpected result type.");
-            return;
-        }
-
-        auto databaseResult = WTF::get<RefPtr<IDBDatabase>>(resultValue.value());
-        m_executableWithDatabase->execute(*databaseResult);
-        databaseResult->close();
-    }
-
-private:
-    OpenDatabaseCallback(ExecutableWithDatabase& executableWithDatabase)
-        : EventListener(EventListener::CPPEventListenerType)
-        , m_executableWithDatabase(executableWithDatabase) { }
-    Ref<ExecutableWithDatabase> m_executableWithDatabase;
-};
-
-void ExecutableWithDatabase::start(IDBFactory* idbFactory, SecurityOrigin*, const String& databaseName)
-{
-    if (!context()) {
-        requestCallback().sendFailure("Could not open database.");
-        return;
-    }
-
-    auto result = idbFactory->open(*context(), databaseName, std::nullopt);
-    if (result.hasException()) {
-        requestCallback().sendFailure("Could not open database.");
-        return;
-    }
-
-    result.releaseReturnValue()->addEventListener(eventNames().successEvent, OpenDatabaseCallback::create(*this), false);
-}
-
-
-static RefPtr<KeyPath> keyPathFromIDBKeyPath(const std::optional<IDBKeyPath>& idbKeyPath)
-{
-    if (!idbKeyPath)
-        return KeyPath::create().setType(KeyPath::Type::Null).release();
-
-    auto visitor = WTF::makeVisitor([](const String& string) {
-        RefPtr<KeyPath> keyPath = KeyPath::create().setType(KeyPath::Type::String).release();
-        keyPath->setString(string);
-        return keyPath;
-    }, [](const Vector<String>& vector) {
-        auto array = Inspector::Protocol::Array<String>::create();
-        for (auto& string : vector)
-            array->addItem(string);
-        RefPtr<KeyPath> keyPath = KeyPath::create().setType(KeyPath::Type::Array).release();
-        keyPath->setArray(WTFMove(array));
-        return keyPath;
-    });
-    return WTF::visit(visitor, idbKeyPath.value());
-}
-
-static RefPtr<IDBTransaction> transactionForDatabase(IDBDatabase* idbDatabase, const String& objectStoreName, IDBTransactionMode mode = IDBTransactionMode::Readonly)
-{
-    auto result = idbDatabase->transaction(objectStoreName, mode);
-    if (result.hasException())
-        return nullptr;
-    return result.releaseReturnValue();
-}
-
-static RefPtr<IDBObjectStore> objectStoreForTransaction(IDBTransaction* idbTransaction, const String& objectStoreName)
-{
-    auto result = idbTransaction->objectStore(objectStoreName);
-    if (result.hasException())
-        return nullptr;
-    return result.releaseReturnValue();
-}
-
-static RefPtr<IDBIndex> indexForObjectStore(IDBObjectStore* idbObjectStore, const String& indexName)
-{
-    auto index = idbObjectStore->index(indexName);
-    if (index.hasException())
-        return nullptr;
-    return index.releaseReturnValue();
-}
-
-class DatabaseLoader final : public ExecutableWithDatabase {
-public:
-    static Ref<DatabaseLoader> create(ScriptExecutionContext* context, Ref<RequestDatabaseCallback>&& requestCallback)
-    {
-        return adoptRef(*new DatabaseLoader(context, WTFMove(requestCallback)));
-    }
-
-    virtual ~DatabaseLoader() = default;
-
-    void execute(IDBDatabase& database) override
-    {
-        if (!requestCallback().isActive())
-            return;
-    
-        auto& databaseInfo = database.info();
-        auto objectStores = Inspector::Protocol::Array<Inspector::Protocol::IndexedDB::ObjectStore>::create();
-        auto objectStoreNames = databaseInfo.objectStoreNames();
-        for (auto& name : objectStoreNames) {
-            auto* objectStoreInfo = databaseInfo.infoForExistingObjectStore(name);
-            if (!objectStoreInfo)
-                continue;
-
-            auto indexes = Inspector::Protocol::Array<Inspector::Protocol::IndexedDB::ObjectStoreIndex>::create();
-    
-            for (auto& indexInfo : objectStoreInfo->indexMap().values()) {
-                auto objectStoreIndex = ObjectStoreIndex::create()
-                    .setName(indexInfo.name())
-                    .setKeyPath(keyPathFromIDBKeyPath(indexInfo.keyPath()))
-                    .setUnique(indexInfo.unique())
-                    .setMultiEntry(indexInfo.multiEntry())
-                    .release();
-                indexes->addItem(WTFMove(objectStoreIndex));
-            }
-    
-            auto objectStore = ObjectStore::create()
-                .setName(objectStoreInfo->name())
-                .setKeyPath(keyPathFromIDBKeyPath(objectStoreInfo->keyPath()))
-                .setAutoIncrement(objectStoreInfo->autoIncrement())
-                .setIndexes(WTFMove(indexes))
-                .release();
-            objectStores->addItem(WTFMove(objectStore));
-        }
-    
-        auto result = DatabaseWithObjectStores::create()
-            .setName(databaseInfo.name())
-            .setVersion(databaseInfo.version())
-            .setObjectStores(WTFMove(objectStores))
-            .release();
-        m_requestCallback->sendSuccess(WTFMove(result));
-    }
-
-    RequestCallback& requestCallback() override { return m_requestCallback.get(); }
-private:
-    DatabaseLoader(ScriptExecutionContext* context, Ref<RequestDatabaseCallback>&& requestCallback)
-        : ExecutableWithDatabase(context)
-        , m_requestCallback(WTFMove(requestCallback)) { }
-    Ref<RequestDatabaseCallback> m_requestCallback;
-};
-
-static RefPtr<IDBKey> idbKeyFromInspectorObject(InspectorObject* key)
-{
-    String type;
-    if (!key->getString("type", type))
-        return nullptr;
-
-    static NeverDestroyed<const String> numberType(MAKE_STATIC_STRING_IMPL("number"));
-    static NeverDestroyed<const String> stringType(MAKE_STATIC_STRING_IMPL("string"));
-    static NeverDestroyed<const String> dateType(MAKE_STATIC_STRING_IMPL("date"));
-    static NeverDestroyed<const String> arrayType(MAKE_STATIC_STRING_IMPL("array"));
-
-    RefPtr<IDBKey> idbKey;
-    if (type == numberType) {
-        double number;
-        if (!key->getDouble("number", number))
-            return nullptr;
-        idbKey = IDBKey::createNumber(number);
-    } else if (type == stringType) {
-        String string;
-        if (!key->getString("string", string))
-            return nullptr;
-        idbKey = IDBKey::createString(string);
-    } else if (type == dateType) {
-        double date;
-        if (!key->getDouble("date", date))
-            return nullptr;
-        idbKey = IDBKey::createDate(date);
-    } else if (type == arrayType) {
-        Vector<RefPtr<IDBKey>> keyArray;
-        RefPtr<InspectorArray> array;
-        if (!key->getArray("array", array))
-            return nullptr;
-        for (size_t i = 0; i < array->length(); ++i) {
-            RefPtr<InspectorValue> value = array->get(i);
-            RefPtr<InspectorObject> object;
-            if (!value->asObject(object))
-                return nullptr;
-            keyArray.append(idbKeyFromInspectorObject(object.get()));
-        }
-        idbKey = IDBKey::createArray(keyArray);
-    } else
-        return nullptr;
-
-    return idbKey;
-}
-
-static RefPtr<IDBKeyRange> idbKeyRangeFromKeyRange(const InspectorObject* keyRange)
-{
-    RefPtr<IDBKey> idbLower;
-    RefPtr<InspectorObject> lower;
-    if (keyRange->getObject(ASCIILiteral("lower"), lower)) {
-        idbLower = idbKeyFromInspectorObject(lower.get());
-        if (!idbLower)
-            return nullptr;
-    }
-
-    RefPtr<IDBKey> idbUpper;
-    RefPtr<InspectorObject> upper;
-    if (keyRange->getObject(ASCIILiteral("upper"), upper)) {
-        idbUpper = idbKeyFromInspectorObject(upper.get());
-        if (!idbUpper)
-            return nullptr;
-    }
-
-    bool lowerOpen;
-    if (!keyRange->getBoolean(ASCIILiteral("lowerOpen"), lowerOpen))
-        return nullptr;
-
-    bool upperOpen;
-    if (!keyRange->getBoolean(ASCIILiteral("upperOpen"), upperOpen))
-        return nullptr;
-
-    return IDBKeyRange::create(WTFMove(idbLower), WTFMove(idbUpper), lowerOpen, upperOpen);
-}
-
-class OpenCursorCallback final : public EventListener {
-public:
-    static Ref<OpenCursorCallback> create(InjectedScript injectedScript, Ref<RequestDataCallback>&& requestCallback, int skipCount, unsigned pageSize)
-    {
-        return adoptRef(*new OpenCursorCallback(injectedScript, WTFMove(requestCallback), skipCount, pageSize));
-    }
-
-    virtual ~OpenCursorCallback() = default;
-
-    bool operator==(const EventListener& other) const override
-    {
-        return this == &other;
-    }
-
-    void handleEvent(ScriptExecutionContext&, Event& event) override
-    {
-        if (event.type() != eventNames().successEvent) {
-            m_requestCallback->sendFailure("Unexpected event type.");
-            return;
-        }
-
-        auto& request = static_cast<IDBRequest&>(*event.target());
-
-        auto result = request.result();
-        if (result.hasException()) {
-            m_requestCallback->sendFailure("Could not get result in callback.");
-            return;
-        }
-        
-        auto resultValue = result.releaseReturnValue();
-        if (!resultValue || !WTF::holds_alternative<RefPtr<IDBCursor>>(resultValue.value())) {
-            end(false);
-            return;
-        }
-
-        auto cursor = WTF::get<RefPtr<IDBCursor>>(resultValue.value());
-
-        if (m_skipCount) {
-            if (cursor->advance(m_skipCount).hasException())
-                m_requestCallback->sendFailure("Could not advance cursor.");
-            m_skipCount = 0;
-            return;
-        }
-
-        if (m_result->length() == m_pageSize) {
-            end(true);
-            return;
-        }
-
-        // Continue cursor before making injected script calls, otherwise transaction might be finished.
-        if (cursor->continueFunction(nullptr).hasException()) {
-            m_requestCallback->sendFailure("Could not continue cursor.");
-            return;
-        }
-
-        auto dataEntry = DataEntry::create()
-            .setKey(m_injectedScript.wrapObject(cursor->key(), String(), true))
-            .setPrimaryKey(m_injectedScript.wrapObject(cursor->primaryKey(), String(), true))
-            .setValue(m_injectedScript.wrapObject(cursor->value(), String(), true))
-            .release();
-        m_result->addItem(WTFMove(dataEntry));
-    }
-
-    void end(bool hasMore)
-    {
-        if (!m_requestCallback->isActive())
-            return;
-        m_requestCallback->sendSuccess(WTFMove(m_result), hasMore);
-    }
-
-private:
-    OpenCursorCallback(InjectedScript injectedScript, Ref<RequestDataCallback>&& requestCallback, int skipCount, unsigned pageSize)
-        : EventListener(EventListener::CPPEventListenerType)
-        , m_injectedScript(injectedScript)
-        , m_requestCallback(WTFMove(requestCallback))
-        , m_result(Array<DataEntry>::create())
-        , m_skipCount(skipCount)
-        , m_pageSize(pageSize)
-    {
-    }
-    InjectedScript m_injectedScript;
-    Ref<RequestDataCallback> m_requestCallback;
-    Ref<Array<DataEntry>> m_result;
-    int m_skipCount;
-    unsigned m_pageSize;
-};
-
-class DataLoader final : public ExecutableWithDatabase {
-public:
-    static Ref<DataLoader> create(ScriptExecutionContext* context, Ref<RequestDataCallback>&& requestCallback, const InjectedScript& injectedScript, const String& objectStoreName, const String& indexName, RefPtr<IDBKeyRange>&& idbKeyRange, int skipCount, unsigned pageSize)
-    {
-        return adoptRef(*new DataLoader(context, WTFMove(requestCallback), injectedScript, objectStoreName, indexName, WTFMove(idbKeyRange), skipCount, pageSize));
-    }
-
-    virtual ~DataLoader() = default;
-
-    void execute(IDBDatabase& database) override
-    {
-        if (!requestCallback().isActive())
-            return;
-
-        auto idbTransaction = transactionForDatabase(&database, m_objectStoreName);
-        if (!idbTransaction) {
-            m_requestCallback->sendFailure("Could not get transaction");
-            return;
-        }
-
-        auto idbObjectStore = objectStoreForTransaction(idbTransaction.get(), m_objectStoreName);
-        if (!idbObjectStore) {
-            m_requestCallback->sendFailure("Could not get object store");
-            return;
-        }
-
-        TransactionActivator activator(idbTransaction.get());
-        RefPtr<IDBRequest> idbRequest;
-        auto* exec = context() ? context()->execState() : nullptr;
-        if (!m_indexName.isEmpty()) {
-            auto idbIndex = indexForObjectStore(idbObjectStore.get(), m_indexName);
-            if (!idbIndex) {
-                m_requestCallback->sendFailure("Could not get index");
-                return;
-            }
-
-            if (exec) {
-                auto result = idbIndex->openCursor(*exec, m_idbKeyRange.get(), IDBCursorDirection::Next);
-                if (!result.hasException())
-                    idbRequest = result.releaseReturnValue();
-            }
-        } else {
-            if (exec) {
-                auto result = idbObjectStore->openCursor(*exec, m_idbKeyRange.get(), IDBCursorDirection::Next);
-                if (!result.hasException())
-                    idbRequest = result.releaseReturnValue();
-            }
-        }
-
-        if (!idbRequest) {
-            m_requestCallback->sendFailure("Could not open cursor to populate database data");
-            return;
-        }
-
-        auto openCursorCallback = OpenCursorCallback::create(m_injectedScript, m_requestCallback.copyRef(), m_skipCount, m_pageSize);
-        idbRequest->addEventListener(eventNames().successEvent, WTFMove(openCursorCallback), false);
-    }
-
-    RequestCallback& requestCallback() override { return m_requestCallback.get(); }
-    DataLoader(ScriptExecutionContext* scriptExecutionContext, Ref<RequestDataCallback>&& requestCallback, const InjectedScript& injectedScript, const String& objectStoreName, const String& indexName, RefPtr<IDBKeyRange> idbKeyRange, int skipCount, unsigned pageSize)
-        : ExecutableWithDatabase(scriptExecutionContext)
-        , m_requestCallback(WTFMove(requestCallback))
-        , m_injectedScript(injectedScript)
-        , m_objectStoreName(objectStoreName)
-        , m_indexName(indexName)
-        , m_idbKeyRange(WTFMove(idbKeyRange))
-        , m_skipCount(skipCount)
-        , m_pageSize(pageSize) { }
-    Ref<RequestDataCallback> m_requestCallback;
-    InjectedScript m_injectedScript;
-    String m_objectStoreName;
-    String m_indexName;
-    RefPtr<IDBKeyRange> m_idbKeyRange;
-    int m_skipCount;
-    unsigned m_pageSize;
-};
-
-} // namespace
-
-InspectorIndexedDBAgent::InspectorIndexedDBAgent(WebAgentContext& context, InspectorPageAgent* pageAgent)
-    : InspectorAgentBase(ASCIILiteral("IndexedDB"), context)
-    , m_injectedScriptManager(context.injectedScriptManager)
-    , m_backendDispatcher(Inspector::IndexedDBBackendDispatcher::create(context.backendDispatcher, this))
-    , m_pageAgent(pageAgent)
-{
-}
-
-InspectorIndexedDBAgent::~InspectorIndexedDBAgent() = default;
-
-void InspectorIndexedDBAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorIndexedDBAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString unused;
-    disable(unused);
-}
-
-void InspectorIndexedDBAgent::enable(ErrorString&)
-{
-}
-
-void InspectorIndexedDBAgent::disable(ErrorString&)
-{
-}
-
-static Document* assertDocument(ErrorString& errorString, Frame* frame)
-{
-    Document* document = frame ? frame->document() : nullptr;
-    if (!document)
-        errorString = ASCIILiteral("No document for given frame found");
-    return document;
-}
-
-static IDBFactory* assertIDBFactory(ErrorString& errorString, Document* document)
-{
-    DOMWindow* domWindow = document->domWindow();
-    if (!domWindow) {
-        errorString = ASCIILiteral("No IndexedDB factory for given frame found");
-        return nullptr;
-    }
-
-    IDBFactory* idbFactory = DOMWindowIndexedDatabase::indexedDB(*domWindow);
-    if (!idbFactory)
-        errorString = ASCIILiteral("No IndexedDB factory for given frame found");
-
-    return idbFactory;
-}
-
-void InspectorIndexedDBAgent::requestDatabaseNames(ErrorString& errorString, const String& securityOrigin, Ref<RequestDatabaseNamesCallback>&& requestCallback)
-{
-    Frame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin);
-    Document* document = assertDocument(errorString, frame);
-    if (!document)
-        return;
-
-    auto& openingOrigin = document->securityOrigin();
-
-    auto& topOrigin = document->topOrigin();
-
-    IDBFactory* idbFactory = assertIDBFactory(errorString, document);
-    if (!idbFactory)
-        return;
-
-    idbFactory->getAllDatabaseNames(topOrigin, openingOrigin, [callback = WTFMove(requestCallback)](auto& databaseNames) {
-        if (!callback->isActive())
-            return;
-
-        Ref<Inspector::Protocol::Array<String>> databaseNameArray = Inspector::Protocol::Array<String>::create();
-        for (auto& databaseName : databaseNames)
-            databaseNameArray->addItem(databaseName);
-
-        callback->sendSuccess(WTFMove(databaseNameArray));
-    });
-}
-
-void InspectorIndexedDBAgent::requestDatabase(ErrorString& errorString, const String& securityOrigin, const String& databaseName, Ref<RequestDatabaseCallback>&& requestCallback)
-{
-    Frame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin);
-    Document* document = assertDocument(errorString, frame);
-    if (!document)
-        return;
-
-    IDBFactory* idbFactory = assertIDBFactory(errorString, document);
-    if (!idbFactory)
-        return;
-
-    Ref<DatabaseLoader> databaseLoader = DatabaseLoader::create(document, WTFMove(requestCallback));
-    databaseLoader->start(idbFactory, &document->securityOrigin(), databaseName);
-}
-
-void InspectorIndexedDBAgent::requestData(ErrorString& errorString, const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const InspectorObject* keyRange, Ref<RequestDataCallback>&& requestCallback)
-{
-    Frame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin);
-    Document* document = assertDocument(errorString, frame);
-    if (!document)
-        return;
-
-    IDBFactory* idbFactory = assertIDBFactory(errorString, document);
-    if (!idbFactory)
-        return;
-
-    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(mainWorldExecState(frame));
-
-    RefPtr<IDBKeyRange> idbKeyRange = keyRange ? idbKeyRangeFromKeyRange(keyRange) : nullptr;
-    if (keyRange && !idbKeyRange) {
-        errorString = ASCIILiteral("Can not parse key range.");
-        return;
-    }
-
-    Ref<DataLoader> dataLoader = DataLoader::create(document, WTFMove(requestCallback), injectedScript, objectStoreName, indexName, WTFMove(idbKeyRange), skipCount, pageSize);
-    dataLoader->start(idbFactory, &document->securityOrigin(), databaseName);
-}
-
-namespace {
-
-class ClearObjectStoreListener final : public EventListener {
-    WTF_MAKE_NONCOPYABLE(ClearObjectStoreListener);
-public:
-    static Ref<ClearObjectStoreListener> create(Ref<ClearObjectStoreCallback> requestCallback)
-    {
-        return adoptRef(*new ClearObjectStoreListener(WTFMove(requestCallback)));
-    }
-
-    virtual ~ClearObjectStoreListener() = default;
-
-    bool operator==(const EventListener& other) const override
-    {
-        return this == &other;
-    }
-
-    void handleEvent(ScriptExecutionContext&, Event& event) override
-    {
-        if (!m_requestCallback->isActive())
-            return;
-        if (event.type() != eventNames().completeEvent) {
-            m_requestCallback->sendFailure("Unexpected event type.");
-            return;
-        }
-
-        m_requestCallback->sendSuccess();
-    }
-private:
-    ClearObjectStoreListener(Ref<ClearObjectStoreCallback>&& requestCallback)
-        : EventListener(EventListener::CPPEventListenerType)
-        , m_requestCallback(WTFMove(requestCallback))
-    {
-    }
-
-    Ref<ClearObjectStoreCallback> m_requestCallback;
-};
-
-class ClearObjectStore final : public ExecutableWithDatabase {
-public:
-    static Ref<ClearObjectStore> create(ScriptExecutionContext* context, const String& objectStoreName, Ref<ClearObjectStoreCallback>&& requestCallback)
-    {
-        return adoptRef(*new ClearObjectStore(context, objectStoreName, WTFMove(requestCallback)));
-    }
-
-    ClearObjectStore(ScriptExecutionContext* context, const String& objectStoreName, Ref<ClearObjectStoreCallback>&& requestCallback)
-        : ExecutableWithDatabase(context)
-        , m_objectStoreName(objectStoreName)
-        , m_requestCallback(WTFMove(requestCallback))
-    {
-    }
-
-    void execute(IDBDatabase& database) override
-    {
-        if (!requestCallback().isActive())
-            return;
-
-        auto idbTransaction = transactionForDatabase(&database, m_objectStoreName, IDBTransactionMode::Readwrite);
-        if (!idbTransaction) {
-            m_requestCallback->sendFailure("Could not get transaction");
-            return;
-        }
-
-        auto idbObjectStore = objectStoreForTransaction(idbTransaction.get(), m_objectStoreName);
-        if (!idbObjectStore) {
-            m_requestCallback->sendFailure("Could not get object store");
-            return;
-        }
-
-        TransactionActivator activator(idbTransaction.get());
-        RefPtr<IDBRequest> idbRequest;
-        if (auto* exec = context() ? context()->execState() : nullptr) {
-            auto result = idbObjectStore->clear(*exec);
-            ASSERT(!result.hasException());
-            if (result.hasException()) {
-                m_requestCallback->sendFailure(String::format("Could not clear object store '%s': %d", m_objectStoreName.utf8().data(), result.releaseException().code()));
-                return;
-            }
-            idbRequest = result.releaseReturnValue();
-        }
-
-        idbTransaction->addEventListener(eventNames().completeEvent, ClearObjectStoreListener::create(m_requestCallback.copyRef()), false);
-    }
-
-    RequestCallback& requestCallback() override { return m_requestCallback.get(); }
-private:
-    const String m_objectStoreName;
-    Ref<ClearObjectStoreCallback> m_requestCallback;
-};
-
-} // anonymous namespace
-
-void InspectorIndexedDBAgent::clearObjectStore(ErrorString& errorString, const String& securityOrigin, const String& databaseName, const String& objectStoreName, Ref<ClearObjectStoreCallback>&& requestCallback)
-{
-    Frame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin);
-    Document* document = assertDocument(errorString, frame);
-    if (!document)
-        return;
-    IDBFactory* idbFactory = assertIDBFactory(errorString, document);
-    if (!idbFactory)
-        return;
-
-    Ref<ClearObjectStore> clearObjectStore = ClearObjectStore::create(document, objectStoreName, WTFMove(requestCallback));
-    clearObjectStore->start(idbFactory, &document->securityOrigin(), databaseName);
-}
-
-} // namespace WebCore
-#endif // ENABLE(INDEXED_DATABASE)
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorIndexedDBAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h 2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h    2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2015 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:
- *
- *     * 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.
- */
-
-#pragma once
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "InspectorWebAgentBase.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <wtf/text/WTFString.h>
-
-namespace Inspector {
-class InjectedScriptManager;
-}
-
-namespace WebCore {
-
-class InspectorPageAgent;
-
-typedef String ErrorString;
-
-class InspectorIndexedDBAgent final : public InspectorAgentBase, public Inspector::IndexedDBBackendDispatcherHandler {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorIndexedDBAgent(WebAgentContext&, InspectorPageAgent*);
-    virtual ~InspectorIndexedDBAgent();
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    // Called from the front-end.
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void requestDatabaseNames(ErrorString&, const String& securityOrigin, Ref<RequestDatabaseNamesCallback>&&) override;
-    void requestDatabase(ErrorString&, const String& securityOrigin, const String& databaseName, Ref<RequestDatabaseCallback>&&) override;
-    void requestData(ErrorString&, const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const Inspector::InspectorObject* keyRange, Ref<RequestDataCallback>&&) override;
-    void clearObjectStore(ErrorString&, const String& in_securityOrigin, const String& in_databaseName, const String& in_objectStoreName, Ref<ClearObjectStoreCallback>&&) override;
-
-private:
-    Inspector::InjectedScriptManager& m_injectedScriptManager;
-    RefPtr<Inspector::IndexedDBBackendDispatcher> m_backendDispatcher;
-    InspectorPageAgent* m_pageAgent { nullptr };
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorLayerTreeAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp       2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp  2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,361 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012, 2015 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:
- *
- *     * 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 "InspectorLayerTreeAgent.h"
-
-#include "InspectorDOMAgent.h"
-#include "InstrumentingAgents.h"
-#include "IntRect.h"
-#include "PseudoElement.h"
-#include "RenderChildIterator.h"
-#include "RenderLayer.h"
-#include "RenderLayerBacking.h"
-#include "RenderLayerCompositor.h"
-#include "RenderView.h"
-#include <inspector/IdentifiersFactory.h>
-
-
-namespace WebCore {
-using namespace Inspector;
-
-InspectorLayerTreeAgent::InspectorLayerTreeAgent(WebAgentContext& context)
-    : InspectorAgentBase(ASCIILiteral("LayerTree"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::LayerTreeFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::LayerTreeBackendDispatcher::create(context.backendDispatcher, this))
-{
-}
-
-InspectorLayerTreeAgent::~InspectorLayerTreeAgent()
-{
-    reset();
-}
-
-void InspectorLayerTreeAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorLayerTreeAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString unused;
-    disable(unused);
-}
-
-void InspectorLayerTreeAgent::reset()
-{
-    m_documentLayerToIdMap.clear();
-    m_idToLayer.clear();
-    m_pseudoElementToIdMap.clear();
-    m_idToPseudoElement.clear();
-}
-
-void InspectorLayerTreeAgent::enable(ErrorString&)
-{
-    m_instrumentingAgents.setInspectorLayerTreeAgent(this);
-}
-
-void InspectorLayerTreeAgent::disable(ErrorString&)
-{
-    m_instrumentingAgents.setInspectorLayerTreeAgent(nullptr);
-}
-
-void InspectorLayerTreeAgent::layerTreeDidChange()
-{
-    m_frontendDispatcher->layerTreeDidChange();
-}
-
-void InspectorLayerTreeAgent::renderLayerDestroyed(const RenderLayer& renderLayer)
-{
-    unbind(&renderLayer);
-}
-
-void InspectorLayerTreeAgent::pseudoElementDestroyed(PseudoElement& pseudoElement)
-{
-    unbindPseudoElement(&pseudoElement);
-}
-
-void InspectorLayerTreeAgent::layersForNode(ErrorString& errorString, int nodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
-{
-    layers = Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>::create();
-
-    auto* node = m_instrumentingAgents.inspectorDOMAgent()->nodeForId(nodeId);
-    if (!node) {
-        errorString = ASCIILiteral("Provided node id doesn't match any known node");
-        return;
-    }
-
-    auto* renderer = node->renderer();
-    if (!renderer) {
-        errorString = ASCIILiteral("Node for provided node id doesn't have a renderer");
-        return;
-    }
-
-    if (is<RenderElement>(*renderer))
-        gatherLayersUsingRenderObjectHierarchy(errorString, downcast<RenderElement>(*renderer), layers);
-}
-
-void InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy(ErrorString& errorString, RenderElement& renderer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
-{
-    if (renderer.hasLayer()) {
-        gatherLayersUsingRenderLayerHierarchy(errorString, downcast<RenderLayerModelObject>(renderer).layer(), layers);
-        return;
-    }
-
-    for (auto& child : childrenOfType<RenderElement>(renderer))
-        gatherLayersUsingRenderObjectHierarchy(errorString, child, layers);
-}
-
-void InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy(ErrorString& errorString, RenderLayer* renderLayer, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>& layers)
-{
-    if (renderLayer->isComposited())
-        layers->addItem(buildObjectForLayer(errorString, renderLayer));
-
-    for (renderLayer = renderLayer->firstChild(); renderLayer; renderLayer = renderLayer->nextSibling())
-        gatherLayersUsingRenderLayerHierarchy(errorString, renderLayer, layers);
-}
-
-Ref<Inspector::Protocol::LayerTree::Layer> InspectorLayerTreeAgent::buildObjectForLayer(ErrorString& errorString, RenderLayer* renderLayer)
-{
-    RenderObject* renderer = &renderLayer->renderer();
-    RenderLayerBacking* backing = renderLayer->backing();
-    Node* node = renderer->node();
-
-    bool isReflection = renderLayer->isReflection();
-    bool isGenerated = (isReflection ? renderer->parent() : renderer)->isBeforeOrAfterContent();
-    bool isAnonymous = renderer->isAnonymous();
-
-    if (renderer->isRenderView())
-        node = &renderer->document();
-    else if (isReflection && isGenerated)
-        node = renderer->parent()->generatingElement();
-    else if (isGenerated)
-        node = renderer->generatingNode();
-    else if (isReflection || isAnonymous)
-        node = renderer->parent()->element();
-
-    // Basic set of properties.
-    auto layerObject = Inspector::Protocol::LayerTree::Layer::create()
-        .setLayerId(bind(renderLayer))
-        .setNodeId(idForNode(errorString, node))
-        .setBounds(buildObjectForIntRect(renderer->absoluteBoundingBoxRect()))
-        .setMemory(backing->backingStoreMemoryEstimate())
-        .setCompositedBounds(buildObjectForIntRect(enclosingIntRect(backing->compositedBounds())))
-        .setPaintCount(backing->graphicsLayer()->repaintCount())
-        .release();
-
-    if (node && node->shadowHost())
-        layerObject->setIsInShadowTree(true);
-
-    if (isReflection)
-        layerObject->setIsReflection(true);
-
-    if (isGenerated) {
-        if (isReflection)
-            renderer = renderer->parent();
-        layerObject->setIsGeneratedContent(true);
-        layerObject->setPseudoElementId(bindPseudoElement(downcast<PseudoElement>(renderer->node())));
-        if (renderer->isBeforeContent())
-            layerObject->setPseudoElement("before");
-        else if (renderer->isAfterContent())
-            layerObject->setPseudoElement("after");
-    }
-
-    // FIXME: RenderView is now really anonymous but don't tell about it to the frontend before making sure it can handle it.
-    if (isAnonymous && !renderer->isRenderView()) {
-        layerObject->setIsAnonymous(true);
-        const RenderStyle& style = renderer->style();
-        if (style.styleType() == FIRST_LETTER)
-            layerObject->setPseudoElement("first-letter");
-        else if (style.styleType() == FIRST_LINE)
-            layerObject->setPseudoElement("first-line");
-    }
-
-    return layerObject;
-}
-
-int InspectorLayerTreeAgent::idForNode(ErrorString& errorString, Node* node)
-{
-    if (!node)
-        return 0;
-
-    InspectorDOMAgent* domAgent = m_instrumentingAgents.inspectorDOMAgent();
-    
-    int nodeId = domAgent->boundNodeId(node);
-    if (!nodeId)
-        nodeId = domAgent->pushNodeToFrontend(errorString, domAgent->boundNodeId(&node->document()), node);
-
-    return nodeId;
-}
-
-Ref<Inspector::Protocol::LayerTree::IntRect> InspectorLayerTreeAgent::buildObjectForIntRect(const IntRect& rect)
-{
-    return Inspector::Protocol::LayerTree::IntRect::create()
-        .setX(rect.x())
-        .setY(rect.y())
-        .setWidth(rect.width())
-        .setHeight(rect.height())
-        .release();
-}
-
-void InspectorLayerTreeAgent::reasonsForCompositingLayer(ErrorString& errorString, const String& layerId, RefPtr<Inspector::Protocol::LayerTree::CompositingReasons>& compositingReasonsResult)
-{
-    const RenderLayer* renderLayer = m_idToLayer.get(layerId);
-
-    if (!renderLayer) {
-        errorString = ASCIILiteral("Could not find a bound layer for the provided id");
-        return;
-    }
-
-    OptionSet<CompositingReason> reasons = renderLayer->compositor().reasonsForCompositing(*renderLayer);
-    auto compositingReasons = Inspector::Protocol::LayerTree::CompositingReasons::create().release();
-
-    if (reasons.contains(CompositingReason::Transform3D))
-        compositingReasons->setTransform3D(true);
-
-    if (reasons.contains(CompositingReason::Video))
-        compositingReasons->setVideo(true);
-    else if (reasons.contains(CompositingReason::Canvas))
-        compositingReasons->setCanvas(true);
-    else if (reasons.contains(CompositingReason::Plugin))
-        compositingReasons->setPlugin(true);
-    else if (reasons.contains(CompositingReason::IFrame))
-        compositingReasons->setIFrame(true);
-
-    if (reasons.contains(CompositingReason::BackfaceVisibilityHidden))
-        compositingReasons->setBackfaceVisibilityHidden(true);
-
-    if (reasons.contains(CompositingReason::ClipsCompositingDescendants))
-        compositingReasons->setClipsCompositingDescendants(true);
-
-    if (reasons.contains(CompositingReason::Animation))
-        compositingReasons->setAnimation(true);
-
-    if (reasons.contains(CompositingReason::Filters))
-        compositingReasons->setFilters(true);
-
-    if (reasons.contains(CompositingReason::PositionFixed))
-        compositingReasons->setPositionFixed(true);
-
-    if (reasons.contains(CompositingReason::PositionSticky))
-        compositingReasons->setPositionSticky(true);
-
-    if (reasons.contains(CompositingReason::OverflowScrollingTouch))
-        compositingReasons->setOverflowScrollingTouch(true);
-
-    if (reasons.contains(CompositingReason::Stacking))
-        compositingReasons->setStacking(true);
-
-    if (reasons.contains(CompositingReason::Overlap))
-        compositingReasons->setOverlap(true);
-
-    if (reasons.contains(CompositingReason::NegativeZIndexChildren))
-        compositingReasons->setNegativeZIndexChildren(true);
-
-    if (reasons.contains(CompositingReason::TransformWithCompositedDescendants))
-        compositingReasons->setTransformWithCompositedDescendants(true);
-
-    if (reasons.contains(CompositingReason::OpacityWithCompositedDescendants))
-        compositingReasons->setOpacityWithCompositedDescendants(true);
-
-    if (reasons.contains(CompositingReason::MaskWithCompositedDescendants))
-        compositingReasons->setMaskWithCompositedDescendants(true);
-
-    if (reasons.contains(CompositingReason::ReflectionWithCompositedDescendants))
-        compositingReasons->setReflectionWithCompositedDescendants(true);
-
-    if (reasons.contains(CompositingReason::FilterWithCompositedDescendants))
-        compositingReasons->setFilterWithCompositedDescendants(true);
-
-    if (reasons.contains(CompositingReason::BlendingWithCompositedDescendants))
-        compositingReasons->setBlendingWithCompositedDescendants(true);
-
-    if (reasons.contains(CompositingReason::IsolatesCompositedBlendingDescendants))
-        compositingReasons->setIsolatesCompositedBlendingDescendants(true);
-
-    if (reasons.contains(CompositingReason::Perspective))
-        compositingReasons->setPerspective(true);
-
-    if (reasons.contains(CompositingReason::Preserve3D))
-        compositingReasons->setPreserve3D(true);
-
-    if (reasons.contains(CompositingReason::WillChange))
-        compositingReasons->setWillChange(true);
-
-    if (reasons.contains(CompositingReason::Root))
-        compositingReasons->setRoot(true);
-
-    compositingReasonsResult = WTFMove(compositingReasons);
-}
-
-String InspectorLayerTreeAgent::bind(const RenderLayer* layer)
-{
-    if (!layer)
-        return emptyString();
-    String identifier = m_documentLayerToIdMap.get(layer);
-    if (identifier.isNull()) {
-        identifier = IdentifiersFactory::createIdentifier();
-        m_documentLayerToIdMap.set(layer, identifier);
-        m_idToLayer.set(identifier, layer);
-    }
-    return identifier;
-}
-
-void InspectorLayerTreeAgent::unbind(const RenderLayer* layer)
-{
-    HashMap<const RenderLayer*, String>::iterator iterator = m_documentLayerToIdMap.find(layer);
-    if (iterator == m_documentLayerToIdMap.end())
-        return;
-    m_idToLayer.remove(iterator->value);
-    m_documentLayerToIdMap.remove(iterator);
-}
-
-String InspectorLayerTreeAgent::bindPseudoElement(PseudoElement* pseudoElement)
-{
-    if (!pseudoElement)
-        return emptyString();
-    String identifier = m_pseudoElementToIdMap.get(pseudoElement);
-    if (identifier.isNull()) {
-        identifier = IdentifiersFactory::createIdentifier();
-        m_pseudoElementToIdMap.set(pseudoElement, identifier);
-        m_idToPseudoElement.set(identifier, pseudoElement);
-    }
-    return identifier;
-}
-
-void InspectorLayerTreeAgent::unbindPseudoElement(PseudoElement* pseudoElement)
-{
-    HashMap<PseudoElement*, String>::iterator iterator = m_pseudoElementToIdMap.find(pseudoElement);
-    if (iterator == m_pseudoElementToIdMap.end())
-        return;
-    m_idToPseudoElement.remove(iterator->value);
-    m_pseudoElementToIdMap.remove(iterator);
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorLayerTreeAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h 2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h    2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,94 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012, 2015 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.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "InspectorWebAgentBase.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorProtocolObjects.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class IntRect;
-class Node;
-class PseudoElement;
-class RenderElement;
-class RenderLayer;
-
-typedef String ErrorString;
-
-class InspectorLayerTreeAgent final : public InspectorAgentBase, public Inspector::LayerTreeBackendDispatcherHandler {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit InspectorLayerTreeAgent(WebAgentContext&);
-    virtual ~InspectorLayerTreeAgent();
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-    void reset();
-
-    // InspectorInstrumentation
-    void layerTreeDidChange();
-    void renderLayerDestroyed(const RenderLayer&);
-    void pseudoElementDestroyed(PseudoElement&);
-
-    // Called from the front-end.
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void layersForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&) override;
-    void reasonsForCompositingLayer(ErrorString&, const String& layerId, RefPtr<Inspector::Protocol::LayerTree::CompositingReasons>&) override;
-
-private:
-    // RenderLayer-related methods.
-    String bind(const RenderLayer*);
-    void unbind(const RenderLayer*);
-
-    void gatherLayersUsingRenderObjectHierarchy(ErrorString&, RenderElement&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
-    void gatherLayersUsingRenderLayerHierarchy(ErrorString&, RenderLayer*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>>&);
-
-    Ref<Inspector::Protocol::LayerTree::Layer> buildObjectForLayer(ErrorString&, RenderLayer*);
-    Ref<Inspector::Protocol::LayerTree::IntRect> buildObjectForIntRect(const IntRect&);
-
-    int idForNode(ErrorString&, Node*);
-
-    String bindPseudoElement(PseudoElement*);
-    void unbindPseudoElement(PseudoElement*);
-
-    std::unique_ptr<Inspector::LayerTreeFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::LayerTreeBackendDispatcher> m_backendDispatcher;
-
-    HashMap<const RenderLayer*, String> m_documentLayerToIdMap;
-    HashMap<String, const RenderLayer*> m_idToLayer;
-
-    HashMap<PseudoElement*, String> m_pseudoElementToIdMap;
-    HashMap<String, PseudoElement*> m_idToPseudoElement;
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorMemoryAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp  2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp     2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,156 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 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. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorMemoryAgent.h"
-
-#if ENABLE(RESOURCE_USAGE)
-
-#include "InstrumentingAgents.h"
-#include "ResourceUsageThread.h"
-#include <inspector/InspectorEnvironment.h>
-#include <wtf/Stopwatch.h>
-
-
-namespace WebCore {
-using namespace Inspector;
-
-InspectorMemoryAgent::InspectorMemoryAgent(PageAgentContext& context)
-    : InspectorAgentBase(ASCIILiteral("Memory"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::MemoryFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::MemoryBackendDispatcher::create(context.backendDispatcher, this))
-{
-}
-
-void InspectorMemoryAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
-{
-    m_instrumentingAgents.setInspectorMemoryAgent(this);
-}
-
-void InspectorMemoryAgent::willDestroyFrontendAndBackend(DisconnectReason)
-{
-    m_instrumentingAgents.setInspectorMemoryAgent(nullptr);
-
-    ErrorString ignored;
-    stopTracking(ignored);
-    disable(ignored);
-}
-
-void InspectorMemoryAgent::enable(ErrorString&)
-{
-    m_enabled = true;
-}
-
-void InspectorMemoryAgent::disable(ErrorString&)
-{
-    m_enabled = false;
-}
-
-void InspectorMemoryAgent::startTracking(ErrorString&)
-{
-    if (m_tracking)
-        return;
-
-    ResourceUsageThread::addObserver(this, [this] (const ResourceUsageData& data) {
-        collectSample(data);
-    });
-
-    m_tracking = true;
-
-    m_frontendDispatcher->trackingStart(m_environment.executionStopwatch()->elapsedTime());
-}
-
-void InspectorMemoryAgent::stopTracking(ErrorString&)
-{
-    if (!m_tracking)
-        return;
-
-    ResourceUsageThread::removeObserver(this);
-
-    m_tracking = false;
-
-    m_frontendDispatcher->trackingComplete();
-}
-
-void InspectorMemoryAgent::didHandleMemoryPressure(Critical critical)
-{
-    if (!m_enabled)
-        return;
-
-    MemoryFrontendDispatcher::Severity severity = critical == Critical::Yes ? MemoryFrontendDispatcher::Severity::Critical : MemoryFrontendDispatcher::Severity::NonCritical;
-    m_frontendDispatcher->memoryPressure(m_environment.executionStopwatch()->elapsedTime(), severity);
-}
-
-void InspectorMemoryAgent::collectSample(const ResourceUsageData& data)
-{
-    auto javascriptCategory = Protocol::Memory::CategoryData::create()
-        .setType(Protocol::Memory::CategoryData::Type::Javascript)
-        .setSize(data.categories[MemoryCategory::GCHeap].totalSize() + data.categories[MemoryCategory::GCOwned].totalSize())
-        .release();
-
-    auto jitCategory = Protocol::Memory::CategoryData::create()
-        .setType(Protocol::Memory::CategoryData::Type::JIT)
-        .setSize(data.categories[MemoryCategory::JSJIT].totalSize())
-        .release();
-
-    auto imagesCategory = Protocol::Memory::CategoryData::create()
-        .setType(Protocol::Memory::CategoryData::Type::Images)
-        .setSize(data.categories[MemoryCategory::Images].totalSize())
-        .release();
-
-    auto layersCategory = Protocol::Memory::CategoryData::create()
-        .setType(Protocol::Memory::CategoryData::Type::Layers)
-        .setSize(data.categories[MemoryCategory::Layers].totalSize())
-        .release();
-
-    auto pageCategory = Protocol::Memory::CategoryData::create()
-        .setType(Protocol::Memory::CategoryData::Type::Page)
-        .setSize(data.categories[MemoryCategory::bmalloc].totalSize() + data.categories[MemoryCategory::LibcMalloc].totalSize())
-        .release();
-
-    auto otherCategory = Protocol::Memory::CategoryData::create()
-        .setType(Protocol::Memory::CategoryData::Type::Other)
-        .setSize(data.categories[MemoryCategory::Other].totalSize())
-        .release();
-
-    auto categories = Protocol::Array<Protocol::Memory::CategoryData>::create();
-    categories->addItem(WTFMove(javascriptCategory));
-    categories->addItem(WTFMove(jitCategory));
-    categories->addItem(WTFMove(imagesCategory));
-    categories->addItem(WTFMove(layersCategory));
-    categories->addItem(WTFMove(pageCategory));
-    categories->addItem(WTFMove(otherCategory));
-
-    auto event = Protocol::Memory::Event::create()
-        .setTimestamp(m_environment.executionStopwatch()->elapsedTime())
-        .setCategories(WTFMove(categories))
-        .release();
-
-    m_frontendDispatcher->trackingUpdate(WTFMove(event));
-}
-
-} // namespace Inspector
-
-#endif // ENABLE(RESOURCE_USAGE)
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorMemoryAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorMemoryAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.h    2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.h       2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,70 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 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. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(RESOURCE_USAGE)
-
-#include "InspectorWebAgentBase.h"
-#include "ResourceUsageData.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <wtf/MemoryPressureHandler.h>
-
-namespace WebCore {
-
-typedef String ErrorString;
-
-class InspectorMemoryAgent final : public InspectorAgentBase, public Inspector::MemoryBackendDispatcherHandler {
-    WTF_MAKE_NONCOPYABLE(InspectorMemoryAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorMemoryAgent(PageAgentContext&);
-    virtual ~InspectorMemoryAgent() = default;
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    // MemoryBackendDispatcherHandler
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void startTracking(ErrorString&) override;
-    void stopTracking(ErrorString&) override;
-
-    // InspectorInstrumentation
-    void didHandleMemoryPressure(Critical);
-
-private:
-    void collectSample(const ResourceUsageData&);
-
-    std::unique_ptr<Inspector::MemoryFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::MemoryBackendDispatcher> m_backendDispatcher;
-    bool m_enabled { false };
-    bool m_tracking { false };
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(RESOURCE_USAGE)
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorNetworkAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp 2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp    2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,925 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2015 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:
- *
- *     * 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 "InspectorNetworkAgent.h"
-
-#include "CachedRawResource.h"
-#include "CachedResource.h"
-#include "CachedResourceLoader.h"
-#include "CachedResourceRequestInitiators.h"
-#include "Document.h"
-#include "DocumentLoader.h"
-#include "DocumentThreadableLoader.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "HTTPHeaderMap.h"
-#include "HTTPHeaderNames.h"
-#include "InspectorTimelineAgent.h"
-#include "InstrumentingAgents.h"
-#include "JSMainThreadExecState.h"
-#include "JSWebSocket.h"
-#include "MemoryCache.h"
-#include "NetworkResourcesData.h"
-#include "Page.h"
-#include "ProgressTracker.h"
-#include "ResourceError.h"
-#include "ResourceLoader.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
-#include "ScriptState.h"
-#include "ScriptableDocumentParser.h"
-#include "SubresourceLoader.h"
-#include "ThreadableLoaderClient.h"
-#include "URL.h"
-#include "WebSocket.h"
-#include "WebSocketChannel.h"
-#include "WebSocketFrame.h"
-#include <inspector/ContentSearchUtilities.h>
-#include <inspector/IdentifiersFactory.h>
-#include <inspector/InjectedScript.h>
-#include <inspector/InjectedScriptManager.h>
-#include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
-#include <inspector/ScriptCallStack.h>
-#include <inspector/ScriptCallStackFactory.h>
-#include <runtime/JSCInlines.h>
-#include <wtf/Lock.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Stopwatch.h>
-#include <wtf/text/StringBuilder.h>
-
-
-typedef Inspector::NetworkBackendDispatcherHandler::LoadResourceCallback LoadResourceCallback;
-
-namespace WebCore {
-using namespace Inspector;
-
-namespace {
-
-class InspectorThreadableLoaderClient final : public ThreadableLoaderClient {
-    WTF_MAKE_NONCOPYABLE(InspectorThreadableLoaderClient);
-public:
-    InspectorThreadableLoaderClient(RefPtr<LoadResourceCallback>&& callback)
-        : m_callback(WTFMove(callback)) { }
-
-    virtual ~InspectorThreadableLoaderClient() = default;
-
-    void didReceiveResponse(unsigned long, const ResourceResponse& response) override
-    {
-        m_mimeType = response.mimeType();
-        m_statusCode = response.httpStatusCode();
-
-        // FIXME: This assumes text only responses. We should support non-text responses as well.
-        TextEncoding textEncoding(response.textEncodingName());
-        bool useDetector = false;
-        if (!textEncoding.isValid()) {
-            textEncoding = UTF8Encoding();
-            useDetector = true;
-        }
-
-        m_decoder = TextResourceDecoder::create(ASCIILiteral("text/plain"), textEncoding, useDetector);
-    }
-
-    void didReceiveData(const char* data, int dataLength) override
-    {
-        if (!dataLength)
-            return;
-
-        if (dataLength == -1)
-            dataLength = strlen(data);
-
-        m_responseText.append(m_decoder->decode(data, dataLength));
-    }
-
-    void didFinishLoading(unsigned long) override
-    {
-        if (m_decoder)
-            m_responseText.append(m_decoder->flush());
-
-        m_callback->sendSuccess(m_responseText.toString(), m_mimeType, m_statusCode);
-        dispose();
-    }
-
-    void didFail(const ResourceError& error) override
-    {
-        m_callback->sendFailure(error.isAccessControl() ? ASCIILiteral("Loading resource for inspector failed access control check") : ASCIILiteral("Loading resource for inspector failed"));
-        dispose();
-    }
-
-    void setLoader(RefPtr<ThreadableLoader>&& loader)
-    {
-        m_loader = WTFMove(loader);
-    }
-
-private:
-    void dispose()
-    {
-        m_loader = nullptr;
-        delete this;
-    }
-
-    RefPtr<LoadResourceCallback> m_callback;
-    RefPtr<ThreadableLoader> m_loader;
-    RefPtr<TextResourceDecoder> m_decoder;
-    String m_mimeType;
-    StringBuilder m_responseText;
-    int m_statusCode;
-};
-
-} // namespace
-
-InspectorNetworkAgent::InspectorNetworkAgent(WebAgentContext& context, InspectorPageAgent* pageAgent)
-    : InspectorAgentBase(ASCIILiteral("Network"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::NetworkFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::NetworkBackendDispatcher::create(context.backendDispatcher, this))
-    , m_injectedScriptManager(context.injectedScriptManager)
-    , m_pageAgent(pageAgent)
-    , m_resourcesData(std::make_unique<NetworkResourcesData>())
-{
-}
-
-void InspectorNetworkAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorNetworkAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString unused;
-    disable(unused);
-}
-
-static Ref<InspectorObject> buildObjectForHeaders(const HTTPHeaderMap& headers)
-{
-    Ref<InspectorObject> headersObject = InspectorObject::create();
-
-    for (const auto& header : headers)
-        headersObject->setString(header.key, header.value);
-    return headersObject;
-}
-
-Ref<Inspector::Protocol::Network::ResourceTiming> InspectorNetworkAgent::buildObjectForTiming(const NetworkLoadMetrics& timing, ResourceLoader& resourceLoader)
-{
-    MonotonicTime startTime = resourceLoader.loadTiming().startTime();
-    double startTimeInInspector = m_environment.executionStopwatch()->elapsedTimeSince(startTime);
-
-    return Inspector::Protocol::Network::ResourceTiming::create()
-        .setStartTime(startTimeInInspector)
-        .setDomainLookupStart(timing.domainLookupStart.milliseconds())
-        .setDomainLookupEnd(timing.domainLookupEnd.milliseconds())
-        .setConnectStart(timing.connectStart.milliseconds())
-        .setConnectEnd(timing.connectEnd.milliseconds())
-        .setSecureConnectionStart(timing.secureConnectionStart.milliseconds())
-        .setRequestStart(timing.requestStart.milliseconds())
-        .setResponseStart(timing.responseStart.milliseconds())
-        .release();
-}
-
-static Inspector::Protocol::Network::Metrics::Priority toProtocol(NetworkLoadPriority priority)
-{
-    switch (priority) {
-    case NetworkLoadPriority::Low:
-        return Inspector::Protocol::Network::Metrics::Priority::Low;
-    case NetworkLoadPriority::Medium:
-        return Inspector::Protocol::Network::Metrics::Priority::Medium;
-    case NetworkLoadPriority::High:
-        return Inspector::Protocol::Network::Metrics::Priority::High;
-    }
-
-    ASSERT_NOT_REACHED();
-    return Inspector::Protocol::Network::Metrics::Priority::Medium;
-}
-
-Ref<Inspector::Protocol::Network::Metrics> InspectorNetworkAgent::buildObjectForMetrics(const NetworkLoadMetrics& networkLoadMetrics)
-{
-    auto metrics = Inspector::Protocol::Network::Metrics::create().release();
-
-    if (!networkLoadMetrics.protocol.isNull())
-        metrics->setProtocol(networkLoadMetrics.protocol);
-    if (networkLoadMetrics.priority)
-        metrics->setPriority(toProtocol(*networkLoadMetrics.priority));
-    if (networkLoadMetrics.remoteAddress)
-        metrics->setRemoteAddress(*networkLoadMetrics.remoteAddress);
-    if (networkLoadMetrics.connectionIdentifier)
-        metrics->setConnectionIdentifier(*networkLoadMetrics.connectionIdentifier);
-    if (networkLoadMetrics.requestHeaders)
-        metrics->setRequestHeaders(buildObjectForHeaders(*networkLoadMetrics.requestHeaders));
-
-    if (networkLoadMetrics.requestHeaderBytesSent)
-        metrics->setRequestHeaderBytesSent(*networkLoadMetrics.requestHeaderBytesSent);
-    if (networkLoadMetrics.requestBodyBytesSent)
-        metrics->setRequestBodyBytesSent(*networkLoadMetrics.requestBodyBytesSent);
-    if (networkLoadMetrics.responseHeaderBytesReceived)
-        metrics->setResponseHeaderBytesReceived(*networkLoadMetrics.responseHeaderBytesReceived);
-    if (networkLoadMetrics.responseBodyBytesReceived)
-        metrics->setResponseBodyBytesReceived(*networkLoadMetrics.responseBodyBytesReceived);
-    if (networkLoadMetrics.responseBodyDecodedSize)
-        metrics->setResponseBodyDecodedSize(*networkLoadMetrics.responseBodyDecodedSize);
-
-    return metrics;
-}
-
-static Ref<Inspector::Protocol::Network::Request> buildObjectForResourceRequest(const ResourceRequest& request)
-{
-    auto requestObject = Inspector::Protocol::Network::Request::create()
-        .setUrl(request.url().string())
-        .setMethod(request.httpMethod())
-        .setHeaders(buildObjectForHeaders(request.httpHeaderFields()))
-        .release();
-    if (request.httpBody() && !request.httpBody()->isEmpty()) {
-        auto bytes = request.httpBody()->flatten();
-        requestObject->setPostData(String::fromUTF8WithLatin1Fallback(bytes.data(), bytes.size()));
-    }
-    return requestObject;
-}
-
-static Inspector::Protocol::Network::Response::Source responseSource(ResourceResponse::Source source)
-{
-    switch (source) {
-    case ResourceResponse::Source::Unknown:
-        return Inspector::Protocol::Network::Response::Source::Unknown;
-    case ResourceResponse::Source::Network:
-        return Inspector::Protocol::Network::Response::Source::Network;
-    case ResourceResponse::Source::MemoryCache:
-    case ResourceResponse::Source::MemoryCacheAfterValidation:
-        return Inspector::Protocol::Network::Response::Source::MemoryCache;
-    case ResourceResponse::Source::DiskCache:
-    case ResourceResponse::Source::DiskCacheAfterValidation:
-        return Inspector::Protocol::Network::Response::Source::DiskCache;
-    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=178597. Add an Inspector ServiceWorker source.
-    case ResourceResponse::Source::ServiceWorker:
-        return Inspector::Protocol::Network::Response::Source::Unknown;
-    }
-
-    ASSERT_NOT_REACHED();
-    return Inspector::Protocol::Network::Response::Source::Unknown;
-}
-
-RefPtr<Inspector::Protocol::Network::Response> InspectorNetworkAgent::buildObjectForResourceResponse(const ResourceResponse& response, ResourceLoader* resourceLoader)
-{
-    if (response.isNull())
-        return nullptr;
-
-    double status = response.httpStatusCode();
-    Ref<InspectorObject> headers = buildObjectForHeaders(response.httpHeaderFields());
-
-    auto responseObject = Inspector::Protocol::Network::Response::create()
-        .setUrl(response.url().string())
-        .setStatus(status)
-        .setStatusText(response.httpStatusText())
-        .setHeaders(WTFMove(headers))
-        .setMimeType(response.mimeType())
-        .setSource(responseSource(response.source()))
-        .release();
-
-    if (resourceLoader)
-        responseObject->setTiming(buildObjectForTiming(response.deprecatedNetworkLoadMetrics(), *resourceLoader));
-
-    return WTFMove(responseObject);
-}
-
-Ref<Inspector::Protocol::Network::CachedResource> InspectorNetworkAgent::buildObjectForCachedResource(CachedResource* cachedResource)
-{
-    auto resourceObject = Inspector::Protocol::Network::CachedResource::create()
-        .setUrl(cachedResource->url())
-        .setType(InspectorPageAgent::cachedResourceTypeJSON(*cachedResource))
-        .setBodySize(cachedResource->encodedSize())
-        .release();
-
-    auto resourceResponse = buildObjectForResourceResponse(cachedResource->response(), cachedResource->loader());
-    resourceObject->setResponse(WTFMove(resourceResponse));
-
-    String sourceMappingURL = InspectorPageAgent::sourceMapURLForResource(cachedResource);
-    if (!sourceMappingURL.isEmpty())
-        resourceObject->setSourceMapURL(sourceMappingURL);
-
-    return resourceObject;
-}
-
-InspectorNetworkAgent::~InspectorNetworkAgent()
-{
-    if (m_enabled) {
-        ErrorString unused;
-        disable(unused);
-    }
-    ASSERT(!m_instrumentingAgents.inspectorNetworkAgent());
-}
-
-double InspectorNetworkAgent::timestamp()
-{
-    return m_environment.executionStopwatch()->elapsedTime();
-}
-
-void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLoader& loader, ResourceRequest& request, const ResourceResponse& redirectResponse, InspectorPageAgent::ResourceType type)
-{
-    if (request.hiddenFromInspector()) {
-        m_hiddenRequestIdentifiers.add(identifier);
-        return;
-    }
-
-    double sendTimestamp = timestamp();
-    double walltime = currentTime();
-
-    String requestId = IdentifiersFactory::requestId(identifier);
-    m_resourcesData->resourceCreated(requestId, m_pageAgent->loaderId(&loader));
-
-    if (type == InspectorPageAgent::OtherResource) {
-        if (m_loadingXHRSynchronously)
-            type = InspectorPageAgent::XHRResource;
-        else if (equalIgnoringFragmentIdentifier(request.url(), loader.url()) && !loader.isCommitted())
-            type = InspectorPageAgent::DocumentResource;
-        else {
-            for (auto& linkIcon : loader.linkIcons()) {
-                if (equalIgnoringFragmentIdentifier(request.url(), linkIcon.url)) {
-                    type = InspectorPageAgent::ImageResource;
-                    break;
-                }
-            }
-        }
-    }
-
-    m_resourcesData->setResourceType(requestId, type);
-
-    for (auto& entry : m_extraRequestHeaders)
-        request.setHTTPHeaderField(entry.key, entry.value);
-
-    auto protocolResourceType = InspectorPageAgent::resourceTypeJSON(type);
-
-    RefPtr<Inspector::Protocol::Network::Initiator> initiatorObject = buildInitiatorObject(loader.frame() ? loader.frame()->document() : nullptr);
-    String targetId = request.initiatorIdentifier();
-
-    m_frontendDispatcher->requestWillBeSent(requestId, m_pageAgent->frameId(loader.frame()), m_pageAgent->loaderId(&loader), loader.url().string(), buildObjectForResourceRequest(request), sendTimestamp, walltime, initiatorObject, buildObjectForResourceResponse(redirectResponse, nullptr), type != InspectorPageAgent::OtherResource ? &protocolResourceType : nullptr, targetId.isEmpty() ? nullptr : &targetId);
-}
-
-static InspectorPageAgent::ResourceType resourceTypeForCachedResource(CachedResource* resource)
-{
-    if (resource)
-        return InspectorPageAgent::inspectorResourceType(*resource);
-    return InspectorPageAgent::OtherResource;
-}
-
-static InspectorPageAgent::ResourceType resourceTypeForLoadType(InspectorInstrumentation::LoadType loadType)
-{
-    switch (loadType) {
-    case InspectorInstrumentation::LoadType::Ping:
-        return InspectorPageAgent::PingResource;
-    case InspectorInstrumentation::LoadType::Beacon:
-        return InspectorPageAgent::BeaconResource;
-    }
-
-    ASSERT_NOT_REACHED();
-    return InspectorPageAgent::OtherResource;
-}
-
-void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLoader& loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
-{
-    auto* cachedResource = InspectorPageAgent::cachedResource(loader.frame(), request.url());
-    willSendRequest(identifier, loader, request, redirectResponse, resourceTypeForCachedResource(cachedResource));
-}
-
-void InspectorNetworkAgent::willSendRequestOfType(unsigned long identifier, DocumentLoader& loader, ResourceRequest& request, InspectorInstrumentation::LoadType loadType)
-{
-    willSendRequest(identifier, loader, request, ResourceResponse(), resourceTypeForLoadType(loadType));
-}
-
-void InspectorNetworkAgent::didReceiveResponse(unsigned long identifier, DocumentLoader& loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
-{
-    if (m_hiddenRequestIdentifiers.contains(identifier))
-        return;
-
-    String requestId = IdentifiersFactory::requestId(identifier);
-    RefPtr<Inspector::Protocol::Network::Response> resourceResponse = buildObjectForResourceResponse(response, resourceLoader);
-
-    bool isNotModified = response.httpStatusCode() == 304;
-
-    CachedResource* cachedResource = nullptr;
-    if (resourceLoader && resourceLoader->isSubresourceLoader() && !isNotModified)
-        cachedResource = static_cast<SubresourceLoader*>(resourceLoader)->cachedResource();
-    if (!cachedResource)
-        cachedResource = InspectorPageAgent::cachedResource(loader.frame(), response.url());
-
-    if (cachedResource) {
-        // Use mime type from cached resource in case the one in response is empty.
-        if (resourceResponse && response.mimeType().isEmpty())
-            resourceResponse->setString(Inspector::Protocol::Network::Response::MimeType, cachedResource->response().mimeType());
-        m_resourcesData->addCachedResource(requestId, cachedResource);
-    }
-
-    InspectorPageAgent::ResourceType type = m_resourcesData->resourceType(requestId);
-    InspectorPageAgent::ResourceType newType = cachedResource ? InspectorPageAgent::inspectorResourceType(*cachedResource) : type;
-
-    // FIXME: XHRResource is returned for CachedResource::RawResource, it should be OtherResource unless it truly is an XHR.
-    // RawResource is used for loading worker scripts, and those should stay as ScriptResource and not change to XHRResource.
-    if (type != newType && newType != InspectorPageAgent::XHRResource && newType != InspectorPageAgent::OtherResource)
-        type = newType;
-
-    m_resourcesData->responseReceived(requestId, m_pageAgent->frameId(loader.frame()), response);
-    m_resourcesData->setResourceType(requestId, type);
-
-    m_frontendDispatcher->responseReceived(requestId, m_pageAgent->frameId(loader.frame()), m_pageAgent->loaderId(&loader), timestamp(), InspectorPageAgent::resourceTypeJSON(type), resourceResponse);
-
-    // If we revalidated the resource and got Not modified, send content length following didReceiveResponse
-    // as there will be no calls to didReceiveData from the network stack.
-    if (isNotModified && cachedResource && cachedResource->encodedSize())
-        didReceiveData(identifier, nullptr, cachedResource->encodedSize(), 0);
-}
-
-static bool isErrorStatusCode(int statusCode)
-{
-    return statusCode >= 400;
-}
-
-void InspectorNetworkAgent::didReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
-{
-    if (m_hiddenRequestIdentifiers.contains(identifier))
-        return;
-
-    String requestId = IdentifiersFactory::requestId(identifier);
-
-    if (data) {
-        NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
-        if (resourceData && !m_loadingXHRSynchronously && (!resourceData->cachedResource() || resourceData->cachedResource()->dataBufferingPolicy() == DoNotBufferData || isErrorStatusCode(resourceData->httpStatusCode())))
-            m_resourcesData->maybeAddResourceData(requestId, data, dataLength);
-    }
-
-    m_frontendDispatcher->dataReceived(requestId, timestamp(), dataLength, encodedDataLength);
-}
-
-void InspectorNetworkAgent::didFinishLoading(unsigned long identifier, DocumentLoader& loader, const NetworkLoadMetrics& networkLoadMetrics, ResourceLoader* resourceLoader)
-{
-    if (m_hiddenRequestIdentifiers.remove(identifier))
-        return;
-
-    double elapsedFinishTime;
-    if (resourceLoader && networkLoadMetrics.isComplete()) {
-        MonotonicTime startTime = resourceLoader->loadTiming().startTime();
-        double startTimeInInspector = m_environment.executionStopwatch()->elapsedTimeSince(startTime);
-        elapsedFinishTime = startTimeInInspector + networkLoadMetrics.responseEnd.seconds();
-    } else
-        elapsedFinishTime = timestamp();
-
-    String requestId = IdentifiersFactory::requestId(identifier);
-    if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::DocumentResource)
-        m_resourcesData->addResourceSharedBuffer(requestId, loader.frameLoader()->documentLoader()->mainResourceData(), loader.frame()->document()->encoding());
-
-    m_resourcesData->maybeDecodeDataToContent(requestId);
-
-    String sourceMappingURL;
-    NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
-    if (resourceData && resourceData->cachedResource())
-        sourceMappingURL = InspectorPageAgent::sourceMapURLForResource(resourceData->cachedResource());
-
-    RefPtr<Inspector::Protocol::Network::Metrics> metrics = buildObjectForMetrics(networkLoadMetrics);
-
-    m_frontendDispatcher->loadingFinished(requestId, elapsedFinishTime, !sourceMappingURL.isEmpty() ? &sourceMappingURL : nullptr, metrics);
-}
-
-void InspectorNetworkAgent::didFailLoading(unsigned long identifier, DocumentLoader& loader, const ResourceError& error)
-{
-    if (m_hiddenRequestIdentifiers.remove(identifier))
-        return;
-
-    String requestId = IdentifiersFactory::requestId(identifier);
-
-    if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::DocumentResource) {
-        Frame* frame = loader.frame();
-        if (frame && frame->loader().documentLoader() && frame->document()) {
-            m_resourcesData->addResourceSharedBuffer(requestId,
-                frame->loader().documentLoader()->mainResourceData(),
-                frame->document()->encoding());
-        }
-    }
-
-    bool canceled = error.isCancellation();
-    m_frontendDispatcher->loadingFailed(requestId, timestamp(), error.localizedDescription(), canceled ? &canceled : nullptr);
-}
-
-void InspectorNetworkAgent::didLoadResourceFromMemoryCache(DocumentLoader& loader, CachedResource& resource)
-{
-    String loaderId = m_pageAgent->loaderId(&loader);
-    String frameId = m_pageAgent->frameId(loader.frame());
-    unsigned long identifier = loader.frame()->page()->progress().createUniqueIdentifier();
-    String requestId = IdentifiersFactory::requestId(identifier);
-
-    m_resourcesData->resourceCreated(requestId, loaderId);
-    m_resourcesData->addCachedResource(requestId, &resource);
-
-    RefPtr<Inspector::Protocol::Network::Initiator> initiatorObject = buildInitiatorObject(loader.frame() ? loader.frame()->document() : nullptr);
-
-    // FIXME: It would be ideal to generate the Network.Response with the MemoryCache source
-    // instead of whatever ResourceResponse::Source the CachedResources's response has.
-    // The frontend already knows for certain that this was served from the memory cache.
-
-    m_frontendDispatcher->requestServedFromMemoryCache(requestId, frameId, loaderId, loader.url().string(), timestamp(), initiatorObject, buildObjectForCachedResource(&resource));
-}
-
-void InspectorNetworkAgent::setInitialScriptContent(unsigned long identifier, const String& sourceString)
-{
-    m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString);
-}
-
-void InspectorNetworkAgent::didReceiveScriptResponse(unsigned long identifier)
-{
-    m_resourcesData->setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::ScriptResource);
-}
-
-void InspectorNetworkAgent::didReceiveThreadableLoaderResponse(unsigned long identifier, DocumentThreadableLoader& documentThreadableLoader)
-{
-    String initiator = documentThreadableLoader.options().initiator;
-    if (initiator == cachedResourceRequestInitiators().fetch)
-        m_resourcesData->setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::FetchResource);
-    else if (initiator == cachedResourceRequestInitiators().xmlhttprequest)
-        m_resourcesData->setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::XHRResource);
-}
-
-void InspectorNetworkAgent::didFinishXHRLoading(unsigned long identifier, const String& decodedText)
-{
-    m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), decodedText);
-}
-
-void InspectorNetworkAgent::willLoadXHRSynchronously()
-{
-    m_loadingXHRSynchronously = true;
-}
-
-void InspectorNetworkAgent::didLoadXHRSynchronously()
-{
-    m_loadingXHRSynchronously = false;
-}
-
-void InspectorNetworkAgent::willDestroyCachedResource(CachedResource& cachedResource)
-{
-    Vector<String> requestIds = m_resourcesData->removeCachedResource(&cachedResource);
-    if (!requestIds.size())
-        return;
-
-    String content;
-    bool base64Encoded;
-    if (!InspectorPageAgent::cachedResourceContent(&cachedResource, &content, &base64Encoded))
-        return;
-    for (auto& id : requestIds)
-        m_resourcesData->setResourceContent(id, content, base64Encoded);
-}
-
-void InspectorNetworkAgent::willRecalculateStyle()
-{
-    m_isRecalculatingStyle = true;
-}
-
-void InspectorNetworkAgent::didRecalculateStyle()
-{
-    m_isRecalculatingStyle = false;
-    m_styleRecalculationInitiator = nullptr;
-}
-
-void InspectorNetworkAgent::didScheduleStyleRecalculation(Document& document)
-{
-    if (!m_styleRecalculationInitiator)
-        m_styleRecalculationInitiator = buildInitiatorObject(&document);
-}
-
-RefPtr<Inspector::Protocol::Network::Initiator> InspectorNetworkAgent::buildInitiatorObject(Document* document)
-{
-    Ref<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState());
-    if (stackTrace->size() > 0) {
-        auto initiatorObject = Inspector::Protocol::Network::Initiator::create()
-            .setType(Inspector::Protocol::Network::Initiator::Type::Script)
-            .release();
-        initiatorObject->setStackTrace(stackTrace->buildInspectorArray());
-        return WTFMove(initiatorObject);
-    }
-
-    if (document && document->scriptableDocumentParser()) {
-        auto initiatorObject = Inspector::Protocol::Network::Initiator::create()
-            .setType(Inspector::Protocol::Network::Initiator::Type::Parser)
-            .release();
-        initiatorObject->setUrl(document->url().string());
-        initiatorObject->setLineNumber(document->scriptableDocumentParser()->textPosition().m_line.oneBasedInt());
-        return WTFMove(initiatorObject);
-    }
-
-    if (m_isRecalculatingStyle && m_styleRecalculationInitiator)
-        return m_styleRecalculationInitiator;
-
-    return Inspector::Protocol::Network::Initiator::create()
-        .setType(Inspector::Protocol::Network::Initiator::Type::Other)
-        .release();
-}
-
-void InspectorNetworkAgent::didCreateWebSocket(unsigned long identifier, const URL& requestURL)
-{
-    m_frontendDispatcher->webSocketCreated(IdentifiersFactory::requestId(identifier), requestURL.string());
-}
-
-void InspectorNetworkAgent::willSendWebSocketHandshakeRequest(unsigned long identifier, const ResourceRequest& request)
-{
-    auto requestObject = Inspector::Protocol::Network::WebSocketRequest::create()
-        .setHeaders(buildObjectForHeaders(request.httpHeaderFields()))
-        .release();
-    m_frontendDispatcher->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(identifier), timestamp(), currentTime(), WTFMove(requestObject));
-}
-
-void InspectorNetworkAgent::didReceiveWebSocketHandshakeResponse(unsigned long identifier, const ResourceResponse& response)
-{
-    auto responseObject = Inspector::Protocol::Network::WebSocketResponse::create()
-        .setStatus(response.httpStatusCode())
-        .setStatusText(response.httpStatusText())
-        .setHeaders(buildObjectForHeaders(response.httpHeaderFields()))
-        .release();
-    m_frontendDispatcher->webSocketHandshakeResponseReceived(IdentifiersFactory::requestId(identifier), timestamp(), WTFMove(responseObject));
-}
-
-void InspectorNetworkAgent::didCloseWebSocket(unsigned long identifier)
-{
-    m_frontendDispatcher->webSocketClosed(IdentifiersFactory::requestId(identifier), timestamp());
-}
-
-void InspectorNetworkAgent::didReceiveWebSocketFrame(unsigned long identifier, const WebSocketFrame& frame)
-{
-    auto frameObject = Inspector::Protocol::Network::WebSocketFrame::create()
-        .setOpcode(frame.opCode)
-        .setMask(frame.masked)
-        .setPayloadData(String::fromUTF8WithLatin1Fallback(frame.payload, frame.payloadLength))
-        .setPayloadLength(frame.payloadLength)
-        .release();
-    m_frontendDispatcher->webSocketFrameReceived(IdentifiersFactory::requestId(identifier), timestamp(), WTFMove(frameObject));
-}
-
-void InspectorNetworkAgent::didSendWebSocketFrame(unsigned long identifier, const WebSocketFrame& frame)
-{
-    auto frameObject = Inspector::Protocol::Network::WebSocketFrame::create()
-        .setOpcode(frame.opCode)
-        .setMask(frame.masked)
-        .setPayloadData(String::fromUTF8WithLatin1Fallback(frame.payload, frame.payloadLength))
-        .setPayloadLength(frame.payloadLength)
-        .release();
-    m_frontendDispatcher->webSocketFrameSent(IdentifiersFactory::requestId(identifier), timestamp(), WTFMove(frameObject));
-}
-
-void InspectorNetworkAgent::didReceiveWebSocketFrameError(unsigned long identifier, const String& errorMessage)
-{
-    m_frontendDispatcher->webSocketFrameError(IdentifiersFactory::requestId(identifier), timestamp(), errorMessage);
-}
-
-void InspectorNetworkAgent::enable(ErrorString&)
-{
-    enable();
-}
-
-void InspectorNetworkAgent::enable()
-{
-    m_enabled = true;
-    m_instrumentingAgents.setInspectorNetworkAgent(this);
-
-    LockHolder lock(WebSocket::allActiveWebSocketsMutex());
-
-    for (WebSocket* webSocket : WebSocket::allActiveWebSockets(lock)) {
-        if (!is<Document>(webSocket->scriptExecutionContext()) || !is<WebSocketChannel>(webSocket->channel().get()))
-            continue;
-
-        Document* document = downcast<Document>(webSocket->scriptExecutionContext());
-        if (document->page() != &m_pageAgent->page())
-            continue;
-
-        WebSocketChannel* channel = downcast<WebSocketChannel>(webSocket->channel().get());
-        if (!channel)
-            continue;
-
-        unsigned identifier = channel->identifier();
-        didCreateWebSocket(identifier, webSocket->url());
-        willSendWebSocketHandshakeRequest(identifier, channel->clientHandshakeRequest());
-
-        if (channel->handshakeMode() == WebSocketHandshake::Connected)
-            didReceiveWebSocketHandshakeResponse(identifier, channel->serverHandshakeResponse());
-
-        if (webSocket->readyState() == WebSocket::CLOSED)
-            didCloseWebSocket(identifier);
-    }
-}
-
-void InspectorNetworkAgent::disable(ErrorString&)
-{
-    m_enabled = false;
-    m_instrumentingAgents.setInspectorNetworkAgent(nullptr);
-    m_resourcesData->clear();
-    m_extraRequestHeaders.clear();
-
-    m_pageAgent->page().setResourceCachingDisabledOverride(false);
-}
-
-void InspectorNetworkAgent::setExtraHTTPHeaders(ErrorString&, const InspectorObject& headers)
-{
-    for (auto& entry : headers) {
-        String stringValue;
-        if (entry.value->asString(stringValue))
-            m_extraRequestHeaders.set(entry.key, stringValue);
-    }
-}
-
-void InspectorNetworkAgent::getResponseBody(ErrorString& errorString, const String& requestId, String* content, bool* base64Encoded)
-{
-    NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
-    if (!resourceData) {
-        errorString = ASCIILiteral("No resource with given identifier found");
-        return;
-    }
-
-    if (resourceData->hasContent()) {
-        *base64Encoded = resourceData->base64Encoded();
-        *content = resourceData->content();
-        return;
-    }
-
-    if (resourceData->isContentEvicted()) {
-        errorString = ASCIILiteral("Request content was evicted from inspector cache");
-        return;
-    }
-
-    if (resourceData->buffer() && !resourceData->textEncodingName().isNull()) {
-        *base64Encoded = false;
-        if (InspectorPageAgent::sharedBufferContent(resourceData->buffer(), resourceData->textEncodingName(), *base64Encoded, content))
-            return;
-    }
-
-    if (resourceData->cachedResource()) {
-        if (InspectorPageAgent::cachedResourceContent(resourceData->cachedResource(), content, base64Encoded))
-            return;
-    }
-
-    errorString = ASCIILiteral("No data found for resource with given identifier");
-}
-
-void InspectorNetworkAgent::setResourceCachingDisabled(ErrorString&, bool disabled)
-{
-    m_pageAgent->page().setResourceCachingDisabledOverride(disabled);
-}
-
-void InspectorNetworkAgent::loadResource(ErrorString& errorString, const String& frameId, const String& urlString, Ref<LoadResourceCallback>&& callback)
-{
-    Frame* frame = m_pageAgent->assertFrame(errorString, frameId);
-    if (!frame)
-        return;
-
-    Document* document = frame->document();
-    if (!document) {
-        errorString = ASCIILiteral("No Document instance for the specified frame");
-        return;
-    }
-
-    URL url = document->completeURL(urlString);
-    ResourceRequest request(url);
-    request.setHTTPMethod(ASCIILiteral("GET"));
-    request.setHiddenFromInspector(true);
-
-    ThreadableLoaderOptions options;
-    options.sendLoadCallbacks = SendCallbacks; // So we remove this from m_hiddenRequestIdentifiers on completion.
-    options.defersLoadingPolicy = DefersLoadingPolicy::DisallowDefersLoading; // So the request is never deferred.
-    options.mode = FetchOptions::Mode::NoCors;
-    options.credentials = FetchOptions::Credentials::SameOrigin;
-    options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
-
-    // InspectorThreadableLoaderClient deletes itself when the load completes or fails.
-    InspectorThreadableLoaderClient* inspectorThreadableLoaderClient = new InspectorThreadableLoaderClient(callback.copyRef());
-    auto loader = DocumentThreadableLoader::create(*document, *inspectorThreadableLoaderClient, WTFMove(request), options);
-    if (!loader)
-        return;
-
-    // If the load already completed, inspectorThreadableLoaderClient will have been deleted and we will have already called the callback.
-    if (!callback->isActive())
-        return;
-
-    inspectorThreadableLoaderClient->setLoader(WTFMove(loader));
-}
-
-WebSocket* InspectorNetworkAgent::webSocketForRequestId(const String& requestId)
-{
-    LockHolder lock(WebSocket::allActiveWebSocketsMutex());
-
-    for (WebSocket* webSocket : WebSocket::allActiveWebSockets(lock)) {
-        if (!is<WebSocketChannel>(webSocket->channel().get()))
-            continue;
-
-        WebSocketChannel* channel = downcast<WebSocketChannel>(webSocket->channel().get());
-        if (!channel)
-            continue;
-
-        if (IdentifiersFactory::requestId(channel->identifier()) != requestId)
-            continue;
-
-        // FIXME: <webkit.org/b/168475> Web Inspector: Correctly display iframe's and worker's WebSockets
-        if (!is<Document>(webSocket->scriptExecutionContext()))
-            continue;
-
-        Document* document = downcast<Document>(webSocket->scriptExecutionContext());
-        if (document->page() != &m_pageAgent->page())
-            continue;
-
-        return webSocket;
-    }
-
-    return nullptr;
-}
-
-static JSC::JSValue webSocketAsScriptValue(JSC::ExecState& state, WebSocket* webSocket)
-{
-    JSC::JSLockHolder lock(&state);
-    return toJS(&state, deprecatedGlobalObjectForPrototype(&state), webSocket);
-}
-
-void InspectorNetworkAgent::resolveWebSocket(ErrorString& errorString, const String& requestId, const String* const objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result)
-{
-    WebSocket* webSocket = webSocketForRequestId(requestId);
-    if (!webSocket) {
-        errorString = ASCIILiteral("WebSocket not found");
-        return;
-    }
-
-    // FIXME: <webkit.org/b/168475> Web Inspector: Correctly display iframe's and worker's WebSockets
-    Document* document = downcast<Document>(webSocket->scriptExecutionContext());
-    Frame* frame = document->frame();
-    if (!frame) {
-        errorString = ASCIILiteral("WebSocket belongs to document without a frame");
-        return;
-    }
-
-    auto& state = *mainWorldExecState(frame);
-    auto injectedScript = m_injectedScriptManager.injectedScriptFor(&state);
-    ASSERT(!injectedScript.hasNoValue());
-
-    String objectGroupName = objectGroup ? *objectGroup : String();
-    result = injectedScript.wrapObject(webSocketAsScriptValue(state, webSocket), objectGroupName);
-}
-
-static Ref<Inspector::Protocol::Page::SearchResult> buildObjectForSearchResult(const String& requestId, const String& frameId, const String& url, int matchesCount)
-{
-    auto searchResult = Inspector::Protocol::Page::SearchResult::create()
-        .setUrl(url)
-        .setFrameId(frameId)
-        .setMatchesCount(matchesCount)
-        .release();
-    searchResult->setRequestId(requestId);
-    return searchResult;
-}
-
-void InspectorNetworkAgent::searchOtherRequests(const JSC::Yarr::RegularExpression& regex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>& result)
-{
-    Vector<NetworkResourcesData::ResourceData*> resources = m_resourcesData->resources();
-    for (auto* resourceData : resources) {
-        if (resourceData->hasContent()) {
-            int matchesCount = ContentSearchUtilities::countRegularExpressionMatches(regex, resourceData->content());
-            if (matchesCount)
-                result->addItem(buildObjectForSearchResult(resourceData->requestId(), resourceData->frameId(), resourceData->url(), matchesCount));
-        }
-    }
-}
-
-void InspectorNetworkAgent::searchInRequest(ErrorString& errorString, const String& requestId, const String& query, bool caseSensitive, bool isRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>& results)
-{
-    NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
-    if (!resourceData) {
-        errorString = ASCIILiteral("No resource with given identifier found");
-        return;
-    }
-
-    if (!resourceData->hasContent()) {
-        errorString = ASCIILiteral("No resource content");
-        return;
-    }
-
-    results = ContentSearchUtilities::searchInTextByLines(resourceData->content(), query, caseSensitive, isRegex);
-}
-
-void InspectorNetworkAgent::mainFrameNavigated(DocumentLoader& loader)
-{
-    m_resourcesData->clear(m_pageAgent->loaderId(&loader));
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorNetworkAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorNetworkAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorNetworkAgent.h   2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorNetworkAgent.h      2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,147 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2015 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:
- *
- *     * 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.
- */
-
-#pragma once
-
-#include "InspectorInstrumentation.h"
-#include "InspectorPageAgent.h"
-#include "InspectorWebAgentBase.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <wtf/HashSet.h>
-#include <wtf/text/WTFString.h>
-#include <yarr/RegularExpression.h>
-
-namespace Inspector {
-class InspectorObject;
-class InjectedScriptManager;
-}
-
-namespace WebCore {
-
-class CachedResource;
-class Document;
-class DocumentLoader;
-class DocumentThreadableLoader;
-class NetworkLoadMetrics;
-class NetworkResourcesData;
-class ResourceError;
-class ResourceLoader;
-class ResourceRequest;
-class ResourceResponse;
-class URL;
-class WebSocket;
-
-struct WebSocketFrame;
-
-typedef String ErrorString;
-
-class InspectorNetworkAgent final : public InspectorAgentBase, public Inspector::NetworkBackendDispatcherHandler {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorNetworkAgent(WebAgentContext&, InspectorPageAgent*);
-    virtual ~InspectorNetworkAgent();
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    // InspectorInstrumentation
-    void willRecalculateStyle();
-    void didRecalculateStyle();
-    void willSendRequest(unsigned long identifier, DocumentLoader&, ResourceRequest&, const ResourceResponse& redirectResponse);
-    void willSendRequestOfType(unsigned long identifier, DocumentLoader&, ResourceRequest&, InspectorInstrumentation::LoadType);
-    void didReceiveResponse(unsigned long identifier, DocumentLoader&, const ResourceResponse&, ResourceLoader*);
-    void didReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
-    void didFinishLoading(unsigned long identifier, DocumentLoader&, const NetworkLoadMetrics&, ResourceLoader*);
-    void didFailLoading(unsigned long identifier, DocumentLoader&, const ResourceError&);
-    void didLoadResourceFromMemoryCache(DocumentLoader&, CachedResource&);
-    void didReceiveThreadableLoaderResponse(unsigned long identifier, DocumentThreadableLoader&);
-    void didFinishXHRLoading(unsigned long identifier, const String& decodedText);
-    void willLoadXHRSynchronously();
-    void didLoadXHRSynchronously();
-    void didReceiveScriptResponse(unsigned long identifier);
-    void willDestroyCachedResource(CachedResource&);
-    void didCreateWebSocket(unsigned long identifier, const URL& requestURL);
-    void willSendWebSocketHandshakeRequest(unsigned long identifier, const ResourceRequest&);
-    void didReceiveWebSocketHandshakeResponse(unsigned long identifier, const ResourceResponse&);
-    void didCloseWebSocket(unsigned long identifier);
-    void didReceiveWebSocketFrame(unsigned long identifier, const WebSocketFrame&);
-    void didSendWebSocketFrame(unsigned long identifier, const WebSocketFrame&);
-    void didReceiveWebSocketFrameError(unsigned long identifier, const String&);
-    void mainFrameNavigated(DocumentLoader&);
-    void setInitialScriptContent(unsigned long identifier, const String& sourceString);
-    void didScheduleStyleRecalculation(Document&);
-
-    void searchOtherRequests(const JSC::Yarr::RegularExpression&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>&);
-    void searchInRequest(ErrorString&, const String& requestId, const String& query, bool caseSensitive, bool isRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&);
-
-    RefPtr<Inspector::Protocol::Network::Initiator> buildInitiatorObject(Document*);
-
-    // Called from frontend.
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void setExtraHTTPHeaders(ErrorString&, const Inspector::InspectorObject& headers) override;
-    void getResponseBody(ErrorString&, const String& requestId, String* content, bool* base64Encoded) override;
-    void setResourceCachingDisabled(ErrorString&, bool disabled) override;
-    void loadResource(ErrorString&, const String& frameId, const String& url, Ref<LoadResourceCallback>&&) override;
-    void resolveWebSocket(ErrorString&, const String& requestId, const String* const objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>&) override;
-
-private:
-    void enable();
-
-    void willSendRequest(unsigned long identifier, DocumentLoader&, ResourceRequest&, const ResourceResponse& redirectResponse, InspectorPageAgent::ResourceType);
-
-    WebSocket* webSocketForRequestId(const String& requestId);
-
-    Ref<Inspector::Protocol::Network::ResourceTiming> buildObjectForTiming(const NetworkLoadMetrics&, ResourceLoader&);
-    Ref<Inspector::Protocol::Network::Metrics> buildObjectForMetrics(const NetworkLoadMetrics&);
-    RefPtr<Inspector::Protocol::Network::Response> buildObjectForResourceResponse(const ResourceResponse&, ResourceLoader*);
-    Ref<Inspector::Protocol::Network::CachedResource> buildObjectForCachedResource(CachedResource*);
-
-    double timestamp();
-
-    std::unique_ptr<Inspector::NetworkFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::NetworkBackendDispatcher> m_backendDispatcher;
-    Inspector::InjectedScriptManager& m_injectedScriptManager;
-    InspectorPageAgent* m_pageAgent { nullptr };
-
-    // FIXME: InspectorNetworkAgent should not be aware of style recalculation.
-    RefPtr<Inspector::Protocol::Network::Initiator> m_styleRecalculationInitiator;
-    bool m_isRecalculatingStyle { false };
-
-    std::unique_ptr<NetworkResourcesData> m_resourcesData;
-    bool m_enabled { false };
-    bool m_loadingXHRSynchronously { false };
-    HashMap<String, String> m_extraRequestHeaders;
-    HashSet<unsigned long> m_hiddenRequestIdentifiers;
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp    2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp       2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,965 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2015-2017 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:
- *
- *     * 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 "InspectorPageAgent.h"
-
-#include "CachedCSSStyleSheet.h"
-#include "CachedFont.h"
-#include "CachedImage.h"
-#include "CachedResource.h"
-#include "CachedResourceLoader.h"
-#include "CachedScript.h"
-#include "Cookie.h"
-#include "CookieJar.h"
-#include "Document.h"
-#include "DocumentLoader.h"
-#include "Frame.h"
-#include "FrameLoadRequest.h"
-#include "FrameLoader.h"
-#include "FrameSnapshotting.h"
-#include "FrameView.h"
-#include "HTMLFrameOwnerElement.h"
-#include "HTMLNames.h"
-#include "ImageBuffer.h"
-#include "InspectorClient.h"
-#include "InspectorDOMAgent.h"
-#include "InspectorNetworkAgent.h"
-#include "InspectorOverlay.h"
-#include "InstrumentingAgents.h"
-#include "MIMETypeRegistry.h"
-#include "MainFrame.h"
-#include "MemoryCache.h"
-#include "Page.h"
-#include "RenderObject.h"
-#include "ScriptController.h"
-#include "SecurityOrigin.h"
-#include "Settings.h"
-#include "StyleScope.h"
-#include "TextEncoding.h"
-#include "TextResourceDecoder.h"
-#include "UserGestureIndicator.h"
-#include <inspector/ContentSearchUtilities.h>
-#include <inspector/IdentifiersFactory.h>
-#include <inspector/InspectorValues.h>
-#include <wtf/ListHashSet.h>
-#include <wtf/Stopwatch.h>
-#include <wtf/text/Base64.h>
-#include <wtf/text/StringBuilder.h>
-#include <yarr/RegularExpression.h>
-
-#if ENABLE(WEB_ARCHIVE) && USE(CF)
-#include "LegacyWebArchive.h"
-#endif
-
-
-namespace WebCore {
-using namespace Inspector;
-
-static bool decodeBuffer(const char* buffer, unsigned size, const String& textEncodingName, String* result)
-{
-    if (buffer) {
-        TextEncoding encoding(textEncodingName);
-        if (!encoding.isValid())
-            encoding = WindowsLatin1Encoding();
-        *result = encoding.decode(buffer, size);
-        return true;
-    }
-    return false;
-}
-
-static bool hasTextContent(CachedResource* cachedResource)
-{
-    // FIXME: <https://webkit.org/b/165495> Web Inspector: XHR / Fetch for non-text content should not show garbled text
-    // We should not assume XHR / Fetch have text content.
-
-    InspectorPageAgent::ResourceType type = InspectorPageAgent::inspectorResourceType(*cachedResource);
-    return type == InspectorPageAgent::DocumentResource
-        || type == InspectorPageAgent::StylesheetResource
-        || type == InspectorPageAgent::ScriptResource
-        || type == InspectorPageAgent::XHRResource
-        || type == InspectorPageAgent::FetchResource;
-}
-
-bool InspectorPageAgent::cachedResourceContent(CachedResource* cachedResource, String* result, bool* base64Encoded)
-{
-    if (!cachedResource)
-        return false;
-
-    *base64Encoded = !hasTextContent(cachedResource);
-
-    if (!cachedResource->encodedSize()) {
-        *result = emptyString();
-        return true;
-    }
-
-    if (*base64Encoded) {
-        if (auto* buffer = cachedResource->resourceBuffer()) {
-            *result = base64Encode(buffer->data(), buffer->size());
-            return true;
-        }
-        return false;
-    }
-
-    if (cachedResource) {
-        switch (cachedResource->type()) {
-        case CachedResource::CSSStyleSheet:
-            // This can return a null String if the MIME type is invalid.
-            *result = downcast<CachedCSSStyleSheet>(*cachedResource).sheetText();
-            return !result->isNull();
-        case CachedResource::Script:
-            *result = downcast<CachedScript>(*cachedResource).script().toString();
-            return true;
-        case CachedResource::MediaResource:
-        case CachedResource::Icon:
-        case CachedResource::RawResource: {
-            auto* buffer = cachedResource->resourceBuffer();
-            if (!buffer)
-                return false;
-            RefPtr<TextResourceDecoder> decoder = InspectorPageAgent::createTextDecoder(cachedResource->response().mimeType(), cachedResource->response().textEncodingName());
-            // We show content for raw resources only for certain mime types (text, html and xml). Otherwise decoder will be null.
-            if (!decoder)
-                return false;
-            *result = decoder->decodeAndFlush(buffer->data(), buffer->size());
-            return true;
-        }
-        default:
-            auto* buffer = cachedResource->resourceBuffer();
-            return decodeBuffer(buffer ? buffer->data() : nullptr, buffer ? buffer->size() : 0, cachedResource->encoding(), result);
-        }
-    }
-    return false;
-}
-
-bool InspectorPageAgent::mainResourceContent(Frame* frame, bool withBase64Encode, String* result)
-{
-    RefPtr<SharedBuffer> buffer = frame->loader().documentLoader()->mainResourceData();
-    if (!buffer)
-        return false;
-    return InspectorPageAgent::dataContent(buffer->data(), buffer->size(), frame->document()->encoding(), withBase64Encode, result);
-}
-
-bool InspectorPageAgent::sharedBufferContent(RefPtr<SharedBuffer>&& buffer, const String& textEncodingName, bool withBase64Encode, String* result)
-{
-    return dataContent(buffer ? buffer->data() : nullptr, buffer ? buffer->size() : 0, textEncodingName, withBase64Encode, result);
-}
-
-bool InspectorPageAgent::dataContent(const char* data, unsigned size, const String& textEncodingName, bool withBase64Encode, String* result)
-{
-    if (withBase64Encode) {
-        *result = base64Encode(data, size);
-        return true;
-    }
-
-    return decodeBuffer(data, size, textEncodingName, result);
-}
-
-void InspectorPageAgent::resourceContent(ErrorString& errorString, Frame* frame, const URL& url, String* result, bool* base64Encoded)
-{
-    DocumentLoader* loader = assertDocumentLoader(errorString, frame);
-    if (!loader)
-        return;
-
-    RefPtr<SharedBuffer> buffer;
-    bool success = false;
-    if (equalIgnoringFragmentIdentifier(url, loader->url())) {
-        *base64Encoded = false;
-        success = mainResourceContent(frame, *base64Encoded, result);
-    }
-
-    if (!success)
-        success = cachedResourceContent(cachedResource(frame, url), result, base64Encoded);
-
-    if (!success)
-        errorString = ASCIILiteral("No resource with given URL found");
-}
-
-//static
-String InspectorPageAgent::sourceMapURLForResource(CachedResource* cachedResource)
-{
-    static NeverDestroyed<String> sourceMapHTTPHeader(MAKE_STATIC_STRING_IMPL("SourceMap"));
-    static NeverDestroyed<String> sourceMapHTTPHeaderDeprecated(MAKE_STATIC_STRING_IMPL("X-SourceMap"));
-
-    if (!cachedResource)
-        return String();
-
-    // Scripts are handled in a separate path.
-    if (cachedResource->type() != CachedResource::CSSStyleSheet)
-        return String();
-
-    String sourceMapHeader = cachedResource->response().httpHeaderField(sourceMapHTTPHeader);
-    if (!sourceMapHeader.isEmpty())
-        return sourceMapHeader;
-
-    sourceMapHeader = cachedResource->response().httpHeaderField(sourceMapHTTPHeaderDeprecated);
-    if (!sourceMapHeader.isEmpty())
-        return sourceMapHeader;
-
-    String content;
-    bool base64Encoded;
-    if (InspectorPageAgent::cachedResourceContent(cachedResource, &content, &base64Encoded) && !base64Encoded)
-        return ContentSearchUtilities::findStylesheetSourceMapURL(content);
-
-    return String();
-}
-
-CachedResource* InspectorPageAgent::cachedResource(Frame* frame, const URL& url)
-{
-    if (url.isNull())
-        return nullptr;
-
-    CachedResource* cachedResource = frame->document()->cachedResourceLoader().cachedResource(MemoryCache::removeFragmentIdentifierIfNeeded(url));
-    if (!cachedResource) {
-        ResourceRequest request(url);
-        request.setDomainForCachePartition(frame->document()->topOrigin().domainForCachePartition());
-        cachedResource = MemoryCache::singleton().resourceForRequest(request, frame->page()->sessionID());
-    }
-
-    return cachedResource;
-}
-
-Inspector::Protocol::Page::ResourceType InspectorPageAgent::resourceTypeJSON(InspectorPageAgent::ResourceType resourceType)
-{
-    switch (resourceType) {
-    case DocumentResource:
-        return Inspector::Protocol::Page::ResourceType::Document;
-    case ImageResource:
-        return Inspector::Protocol::Page::ResourceType::Image;
-    case FontResource:
-        return Inspector::Protocol::Page::ResourceType::Font;
-    case StylesheetResource:
-        return Inspector::Protocol::Page::ResourceType::Stylesheet;
-    case ScriptResource:
-        return Inspector::Protocol::Page::ResourceType::Script;
-    case XHRResource:
-        return Inspector::Protocol::Page::ResourceType::XHR;
-    case FetchResource:
-        return Inspector::Protocol::Page::ResourceType::Fetch;
-    case PingResource:
-        return Inspector::Protocol::Page::ResourceType::Ping;
-    case BeaconResource:
-        return Inspector::Protocol::Page::ResourceType::Beacon;
-    case WebSocketResource:
-        return Inspector::Protocol::Page::ResourceType::WebSocket;
-    case OtherResource:
-        return Inspector::Protocol::Page::ResourceType::Other;
-    }
-    return Inspector::Protocol::Page::ResourceType::Other;
-}
-
-InspectorPageAgent::ResourceType InspectorPageAgent::inspectorResourceType(CachedResource::Type type)
-{
-    switch (type) {
-    case CachedResource::ImageResource:
-        return InspectorPageAgent::ImageResource;
-#if ENABLE(SVG_FONTS)
-    case CachedResource::SVGFontResource:
-#endif
-    case CachedResource::FontResource:
-        return InspectorPageAgent::FontResource;
-#if ENABLE(XSLT)
-    case CachedResource::XSLStyleSheet:
-#endif
-    case CachedResource::CSSStyleSheet:
-        return InspectorPageAgent::StylesheetResource;
-    case CachedResource::Script:
-        return InspectorPageAgent::ScriptResource;
-    case CachedResource::MainResource:
-        return InspectorPageAgent::DocumentResource;
-    case CachedResource::Beacon:
-        return InspectorPageAgent::BeaconResource;
-    case CachedResource::MediaResource:
-    case CachedResource::Icon:
-    case CachedResource::RawResource:
-    default:
-        return InspectorPageAgent::OtherResource;
-    }
-}
-
-InspectorPageAgent::ResourceType InspectorPageAgent::inspectorResourceType(const CachedResource& cachedResource)
-{
-    if (cachedResource.type() == CachedResource::RawResource) {
-        switch (cachedResource.resourceRequest().requester()) {
-        case ResourceRequest::Requester::Fetch:
-            return InspectorPageAgent::FetchResource;
-        case ResourceRequest::Requester::Main:
-            return InspectorPageAgent::DocumentResource;
-        default:
-            return InspectorPageAgent::XHRResource;
-        }
-    }
-
-    return inspectorResourceType(cachedResource.type());
-}
-
-Inspector::Protocol::Page::ResourceType InspectorPageAgent::cachedResourceTypeJSON(const CachedResource& cachedResource)
-{
-    return resourceTypeJSON(inspectorResourceType(cachedResource));
-}
-
-RefPtr<TextResourceDecoder> InspectorPageAgent::createTextDecoder(const String& mimeType, const String& textEncodingName)
-{
-    if (!textEncodingName.isEmpty())
-        return TextResourceDecoder::create(ASCIILiteral("text/plain"), textEncodingName);
-
-    if (MIMETypeRegistry::isTextMIMEType(mimeType))
-        return TextResourceDecoder::create(mimeType, "UTF-8");
-
-    if (MIMETypeRegistry::isXMLMIMEType(mimeType)) {
-        RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(ASCIILiteral("application/xml"));
-        decoder->useLenientXMLDecoding();
-        return decoder;
-    }
-
-    return TextResourceDecoder::create(ASCIILiteral("text/plain"), "UTF-8");
-}
-
-InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClient* client, InspectorOverlay* overlay)
-    : InspectorAgentBase(ASCIILiteral("Page"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::PageFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::PageBackendDispatcher::create(context.backendDispatcher, this))
-    , m_page(context.inspectedPage)
-    , m_client(client)
-    , m_overlay(overlay)
-{
-}
-
-void InspectorPageAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorPageAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString unused;
-    disable(unused);
-}
-
-double InspectorPageAgent::timestamp()
-{
-    return m_environment.executionStopwatch()->elapsedTime();
-}
-
-void InspectorPageAgent::enable(ErrorString&)
-{
-    m_enabled = true;
-    m_instrumentingAgents.setInspectorPageAgent(this);
-
-    auto stopwatch = m_environment.executionStopwatch();
-    stopwatch->reset();
-    stopwatch->start();
-}
-
-void InspectorPageAgent::disable(ErrorString&)
-{
-    m_enabled = false;
-    m_instrumentingAgents.setInspectorPageAgent(nullptr);
-
-    ErrorString unused;
-    setShowPaintRects(unused, false);
-    setEmulatedMedia(unused, emptyString());
-}
-
-void InspectorPageAgent::reload(ErrorString&, const bool* const optionalReloadFromOrigin, const bool* const optionalRevalidateAllResources)
-{
-    bool reloadFromOrigin = optionalReloadFromOrigin && *optionalReloadFromOrigin;
-    bool revalidateAllResources = optionalRevalidateAllResources && *optionalRevalidateAllResources;
-
-    OptionSet<ReloadOption> reloadOptions;
-    if (reloadFromOrigin)
-        reloadOptions |= ReloadOption::FromOrigin;
-    if (!revalidateAllResources)
-        reloadOptions |= ReloadOption::ExpiredOnly;
-
-    m_page.mainFrame().loader().reload(reloadOptions);
-}
-
-void InspectorPageAgent::navigate(ErrorString&, const String& url)
-{
-    UserGestureIndicator indicator { ProcessingUserGesture };
-    Frame& frame = m_page.mainFrame();
-
-    ResourceRequest resourceRequest { frame.document()->completeURL(url) };
-    FrameLoadRequest frameLoadRequest { *frame.document(), frame.document()->securityOrigin(), resourceRequest, ASCIILiteral("_self"), LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, AllowNavigationToInvalidURL::No, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
-    frame.loader().changeLocation(WTFMove(frameLoadRequest));
-}
-
-static Ref<Inspector::Protocol::Page::Cookie> buildObjectForCookie(const Cookie& cookie)
-{
-    return Inspector::Protocol::Page::Cookie::create()
-        .setName(cookie.name)
-        .setValue(cookie.value)
-        .setDomain(cookie.domain)
-        .setPath(cookie.path)
-        .setExpires(cookie.expires)
-        .setSize((cookie.name.length() + cookie.value.length()))
-        .setHttpOnly(cookie.httpOnly)
-        .setSecure(cookie.secure)
-        .setSession(cookie.session)
-        .release();
-}
-
-static Ref<Inspector::Protocol::Array<Inspector::Protocol::Page::Cookie>> buildArrayForCookies(ListHashSet<Cookie>& cookiesList)
-{
-    auto cookies = Inspector::Protocol::Array<Inspector::Protocol::Page::Cookie>::create();
-
-    for (const auto& cookie : cookiesList)
-        cookies->addItem(buildObjectForCookie(cookie));
-
-    return cookies;
-}
-
-static Vector<CachedResource*> cachedResourcesForFrame(Frame* frame)
-{
-    Vector<CachedResource*> result;
-
-    for (auto& cachedResourceHandle : frame->document()->cachedResourceLoader().allCachedResources().values()) {
-        auto* cachedResource = cachedResourceHandle.get();
-        if (cachedResource->resourceRequest().hiddenFromInspector())
-            continue;
-
-        switch (cachedResource->type()) {
-        case CachedResource::ImageResource:
-            // Skip images that were not auto loaded (images disabled in the user agent).
-#if ENABLE(SVG_FONTS)
-        case CachedResource::SVGFontResource:
-#endif
-        case CachedResource::FontResource:
-            // Skip fonts that were referenced in CSS but never used/downloaded.
-            if (cachedResource->stillNeedsLoad())
-                continue;
-            break;
-        default:
-            // All other CachedResource types download immediately.
-            break;
-        }
-
-        result.append(cachedResource);
-    }
-
-    return result;
-}
-
-static Vector<URL> allResourcesURLsForFrame(Frame* frame)
-{
-    Vector<URL> result;
-
-    result.append(frame->loader().documentLoader()->url());
-
-    for (auto* cachedResource : cachedResourcesForFrame(frame))
-        result.append(cachedResource->url());
-
-    return result;
-}
-
-void InspectorPageAgent::getCookies(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::Cookie>>& cookies)
-{
-    // If we can get raw cookies.
-    ListHashSet<Cookie> rawCookiesList;
-
-    // If we can't get raw cookies - fall back to String representation
-    StringBuilder stringCookiesList;
-
-    // Return value to getRawCookies should be the same for every call because
-    // the return value is platform/network backend specific, and the call will
-    // always return the same true/false value.
-    bool rawCookiesImplemented = false;
-
-    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
-        Document* document = frame->document();
-        if (!document)
-            continue;
-
-        for (auto& url : allResourcesURLsForFrame(frame)) {
-            Vector<Cookie> docCookiesList;
-            rawCookiesImplemented = getRawCookies(*document, URL(ParsedURLString, url), docCookiesList);
-
-            if (!rawCookiesImplemented) {
-                // FIXME: We need duplication checking for the String representation of cookies.
-                // Exceptions are thrown by cookie() in sandboxed frames. That won't happen here
-                // because "document" is the document of the main frame of the page.
-                stringCookiesList.append(document->cookie().releaseReturnValue());
-            } else {
-                for (auto& cookie : docCookiesList) {
-                    if (!rawCookiesList.contains(cookie))
-                        rawCookiesList.add(cookie);
-                }
-            }
-        }
-    }
-
-    // FIXME: Do not return empty string/empty array. Make returns optional instead. https://bugs.webkit.org/show_bug.cgi?id=80855
-    if (rawCookiesImplemented)
-        cookies = buildArrayForCookies(rawCookiesList);
-    else
-        cookies = Inspector::Protocol::Array<Inspector::Protocol::Page::Cookie>::create();
-}
-
-void InspectorPageAgent::deleteCookie(ErrorString&, const String& cookieName, const String& url)
-{
-    URL parsedURL(ParsedURLString, url);
-    for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
-        if (auto* document = frame->document())
-            WebCore::deleteCookie(*document, parsedURL, cookieName);
-    }
-}
-
-void InspectorPageAgent::getResourceTree(ErrorString&, RefPtr<Inspector::Protocol::Page::FrameResourceTree>& object)
-{
-    object = buildObjectForFrameTree(&m_page.mainFrame());
-}
-
-void InspectorPageAgent::getResourceContent(ErrorString& errorString, const String& frameId, const String& url, String* content, bool* base64Encoded)
-{
-    Frame* frame = assertFrame(errorString, frameId);
-    if (!frame)
-        return;
-
-    resourceContent(errorString, frame, URL(ParsedURLString, url), content, base64Encoded);
-}
-
-static bool textContentForCachedResource(CachedResource* cachedResource, String* result)
-{
-    if (hasTextContent(cachedResource)) {
-        bool base64Encoded;
-        if (InspectorPageAgent::cachedResourceContent(cachedResource, result, &base64Encoded)) {
-            ASSERT(!base64Encoded);
-            return true;
-        }
-    }
-    return false;
-}
-
-void InspectorPageAgent::searchInResource(ErrorString& errorString, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, const String* optionalRequestId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>& results)
-{
-    results = Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>::create();
-
-    bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
-    bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
-
-    if (optionalRequestId) {
-        if (InspectorNetworkAgent* networkAgent = m_instrumentingAgents.inspectorNetworkAgent()) {
-            networkAgent->searchInRequest(errorString, *optionalRequestId, query, caseSensitive, isRegex, results);
-            return;
-        }
-    }
-
-    Frame* frame = assertFrame(errorString, frameId);
-    if (!frame)
-        return;
-
-    DocumentLoader* loader = assertDocumentLoader(errorString, frame);
-    if (!loader)
-        return;
-
-    URL kurl(ParsedURLString, url);
-
-    String content;
-    bool success = false;
-    if (equalIgnoringFragmentIdentifier(kurl, loader->url()))
-        success = mainResourceContent(frame, false, &content);
-
-    if (!success) {
-        CachedResource* resource = cachedResource(frame, kurl);
-        if (resource)
-            success = textContentForCachedResource(resource, &content);
-    }
-
-    if (!success)
-        return;
-
-    results = ContentSearchUtilities::searchInTextByLines(content, query, caseSensitive, isRegex);
-}
-
-static Ref<Inspector::Protocol::Page::SearchResult> buildObjectForSearchResult(const String& frameId, const String& url, int matchesCount)
-{
-    return Inspector::Protocol::Page::SearchResult::create()
-        .setUrl(url)
-        .setFrameId(frameId)
-        .setMatchesCount(matchesCount)
-        .release();
-}
-
-void InspectorPageAgent::searchInResources(ErrorString&, const String& text, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>& result)
-{
-    result = Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>::create();
-
-    bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
-    bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
-    JSC::Yarr::RegularExpression regex = ContentSearchUtilities::createSearchRegex(text, caseSensitive, isRegex);
-
-    for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
-        String content;
-
-        for (auto* cachedResource : cachedResourcesForFrame(frame)) {
-            if (textContentForCachedResource(cachedResource, &content)) {
-                int matchesCount = ContentSearchUtilities::countRegularExpressionMatches(regex, content);
-                if (matchesCount)
-                    result->addItem(buildObjectForSearchResult(frameId(frame), cachedResource->url(), matchesCount));
-            }
-        }
-
-        if (mainResourceContent(frame, false, &content)) {
-            int matchesCount = ContentSearchUtilities::countRegularExpressionMatches(regex, content);
-            if (matchesCount)
-                result->addItem(buildObjectForSearchResult(frameId(frame), frame->document()->url(), matchesCount));
-        }
-    }
-
-    if (InspectorNetworkAgent* networkAgent = m_instrumentingAgents.inspectorNetworkAgent())
-        networkAgent->searchOtherRequests(regex, result);
-}
-
-void InspectorPageAgent::setShowPaintRects(ErrorString&, bool show)
-{
-    m_showPaintRects = show;
-    m_client->setShowPaintRects(show);
-
-    if (m_client->overridesShowPaintRects())
-        return;
-
-    m_overlay->setShowingPaintRects(show);
-}
-
-void InspectorPageAgent::domContentEventFired()
-{
-    m_isFirstLayoutAfterOnLoad = true;
-    m_frontendDispatcher->domContentEventFired(timestamp());
-}
-
-void InspectorPageAgent::loadEventFired()
-{
-    m_frontendDispatcher->loadEventFired(timestamp());
-}
-
-void InspectorPageAgent::frameNavigated(Frame& frame)
-{
-    m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame));
-}
-
-void InspectorPageAgent::frameDetached(Frame& frame)
-{
-    HashMap<Frame*, String>::iterator iterator = m_frameToIdentifier.find(&frame);
-    if (iterator != m_frameToIdentifier.end()) {
-        m_frontendDispatcher->frameDetached(iterator->value);
-        m_identifierToFrame.remove(iterator->value);
-        m_frameToIdentifier.remove(iterator);
-    }
-}
-
-MainFrame& InspectorPageAgent::mainFrame()
-{
-    return m_page.mainFrame();
-}
-
-Frame* InspectorPageAgent::frameForId(const String& frameId)
-{
-    return frameId.isEmpty() ? nullptr : m_identifierToFrame.get(frameId);
-}
-
-String InspectorPageAgent::frameId(Frame* frame)
-{
-    if (!frame)
-        return emptyString();
-    String identifier = m_frameToIdentifier.get(frame);
-    if (identifier.isNull()) {
-        identifier = IdentifiersFactory::createIdentifier();
-        m_frameToIdentifier.set(frame, identifier);
-        m_identifierToFrame.set(identifier, frame);
-    }
-    return identifier;
-}
-
-bool InspectorPageAgent::hasIdForFrame(Frame* frame) const
-{
-    return frame && m_frameToIdentifier.contains(frame);
-}
-
-String InspectorPageAgent::loaderId(DocumentLoader* loader)
-{
-    if (!loader)
-        return emptyString();
-    String identifier = m_loaderToIdentifier.get(loader);
-    if (identifier.isNull()) {
-        identifier = IdentifiersFactory::createIdentifier();
-        m_loaderToIdentifier.set(loader, identifier);
-    }
-    return identifier;
-}
-
-Frame* InspectorPageAgent::findFrameWithSecurityOrigin(const String& originRawString)
-{
-    for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
-        Ref<SecurityOrigin> documentOrigin = frame->document()->securityOrigin();
-        if (documentOrigin->toRawString() == originRawString)
-            return frame;
-    }
-    return nullptr;
-}
-
-Frame* InspectorPageAgent::assertFrame(ErrorString& errorString, const String& frameId)
-{
-    Frame* frame = frameForId(frameId);
-    if (!frame)
-        errorString = ASCIILiteral("No frame for given id found");
-    return frame;
-}
-
-DocumentLoader* InspectorPageAgent::assertDocumentLoader(ErrorString& errorString, Frame* frame)
-{
-    FrameLoader& frameLoader = frame->loader();
-    DocumentLoader* documentLoader = frameLoader.documentLoader();
-    if (!documentLoader)
-        errorString = ASCIILiteral("No documentLoader for given frame found");
-    return documentLoader;
-}
-
-void InspectorPageAgent::loaderDetachedFromFrame(DocumentLoader& loader)
-{
-    m_loaderToIdentifier.remove(&loader);
-}
-
-void InspectorPageAgent::frameStartedLoading(Frame& frame)
-{
-    m_frontendDispatcher->frameStartedLoading(frameId(&frame));
-}
-
-void InspectorPageAgent::frameStoppedLoading(Frame& frame)
-{
-    m_frontendDispatcher->frameStoppedLoading(frameId(&frame));
-}
-
-void InspectorPageAgent::frameScheduledNavigation(Frame& frame, Seconds delay)
-{
-    m_frontendDispatcher->frameScheduledNavigation(frameId(&frame), delay.value());
-}
-
-void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
-{
-    m_frontendDispatcher->frameClearedScheduledNavigation(frameId(&frame));
-}
-
-void InspectorPageAgent::didPaint(RenderObject& renderer, const LayoutRect& rect)
-{
-    if (!m_enabled || !m_showPaintRects)
-        return;
-
-    LayoutRect absoluteRect = LayoutRect(renderer.localToAbsoluteQuad(FloatRect(rect)).boundingBox());
-    FrameView* view = renderer.document().view();
-
-    LayoutRect rootRect = absoluteRect;
-    if (!view->frame().isMainFrame()) {
-        IntRect rootViewRect = view->contentsToRootView(snappedIntRect(absoluteRect));
-        rootRect = view->frame().mainFrame().view()->rootViewToContents(rootViewRect);
-    }
-
-    if (m_client->overridesShowPaintRects()) {
-        m_client->showPaintRect(rootRect);
-        return;
-    }
-
-    m_overlay->showPaintRect(rootRect);
-}
-
-void InspectorPageAgent::didLayout()
-{
-    bool isFirstLayout = m_isFirstLayoutAfterOnLoad;
-    if (isFirstLayout)
-        m_isFirstLayoutAfterOnLoad = false;
-
-    if (!m_enabled)
-        return;
-
-    m_overlay->update();
-}
-
-void InspectorPageAgent::didScroll()
-{
-    if (m_enabled)
-        m_overlay->update();
-}
-
-void InspectorPageAgent::didRecalculateStyle()
-{
-    if (m_enabled)
-        m_overlay->update();
-}
-
-Ref<Inspector::Protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(Frame* frame)
-{
-    ASSERT_ARG(frame, frame);
-
-    auto frameObject = Inspector::Protocol::Page::Frame::create()
-        .setId(frameId(frame))
-        .setLoaderId(loaderId(frame->loader().documentLoader()))
-        .setUrl(frame->document()->url().string())
-        .setMimeType(frame->loader().documentLoader()->responseMIMEType())
-        .setSecurityOrigin(frame->document()->securityOrigin().toRawString())
-        .release();
-    if (frame->tree().parent())
-        frameObject->setParentId(frameId(frame->tree().parent()));
-    if (frame->ownerElement()) {
-        String name = frame->ownerElement()->getNameAttribute();
-        if (name.isEmpty())
-            name = frame->ownerElement()->attributeWithoutSynchronization(HTMLNames::idAttr);
-        frameObject->setName(name);
-    }
-
-    return frameObject;
-}
-
-Ref<Inspector::Protocol::Page::FrameResourceTree> InspectorPageAgent::buildObjectForFrameTree(Frame* frame)
-{
-    ASSERT_ARG(frame, frame);
-
-    Ref<Inspector::Protocol::Page::Frame> frameObject = buildObjectForFrame(frame);
-    auto subresources = Inspector::Protocol::Array<Inspector::Protocol::Page::FrameResource>::create();
-    auto result = Inspector::Protocol::Page::FrameResourceTree::create()
-        .setFrame(WTFMove(frameObject))
-        .setResources(subresources.copyRef())
-        .release();
-
-    for (auto* cachedResource : cachedResourcesForFrame(frame)) {
-        auto resourceObject = Inspector::Protocol::Page::FrameResource::create()
-            .setUrl(cachedResource->url())
-            .setType(cachedResourceTypeJSON(*cachedResource))
-            .setMimeType(cachedResource->response().mimeType())
-            .release();
-        if (cachedResource->wasCanceled())
-            resourceObject->setCanceled(true);
-        else if (cachedResource->status() == CachedResource::LoadError || cachedResource->status() == CachedResource::DecodeError)
-            resourceObject->setFailed(true);
-        String sourceMappingURL = InspectorPageAgent::sourceMapURLForResource(cachedResource);
-        if (!sourceMappingURL.isEmpty())
-            resourceObject->setSourceMapURL(sourceMappingURL);
-        String targetId = cachedResource->resourceRequest().initiatorIdentifier();
-        if (!targetId.isEmpty())
-            resourceObject->setTargetId(targetId);
-        subresources->addItem(WTFMove(resourceObject));
-    }
-
-    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::FrameResourceTree>> childrenArray;
-    for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
-        if (!childrenArray) {
-            childrenArray = Inspector::Protocol::Array<Inspector::Protocol::Page::FrameResourceTree>::create();
-            result->setChildFrames(childrenArray);
-        }
-        childrenArray->addItem(buildObjectForFrameTree(child));
-    }
-    return result;
-}
-
-void InspectorPageAgent::setEmulatedMedia(ErrorString&, const String& media)
-{
-    if (media == m_emulatedMedia)
-        return;
-
-    m_emulatedMedia = media;
-    Document* document = m_page.mainFrame().document();
-    if (document) {
-        document->styleScope().didChangeStyleSheetEnvironment();
-        document->updateLayout();
-    }
-}
-
-void InspectorPageAgent::applyEmulatedMedia(String& media)
-{
-    if (!m_emulatedMedia.isEmpty())
-        media = m_emulatedMedia;
-}
-
-void InspectorPageAgent::getCompositingBordersVisible(ErrorString&, bool* outParam)
-{
-    *outParam = m_page.settings().showDebugBorders() || m_page.settings().showRepaintCounter();
-}
-
-void InspectorPageAgent::setCompositingBordersVisible(ErrorString&, bool visible)
-{
-    m_page.settings().setShowDebugBorders(visible);
-    m_page.settings().setShowRepaintCounter(visible);
-}
-
-void InspectorPageAgent::snapshotNode(ErrorString& errorString, int nodeId, String* outDataURL)
-{
-    Frame& frame = mainFrame();
-
-    InspectorDOMAgent* domAgent = m_instrumentingAgents.inspectorDOMAgent();
-    ASSERT(domAgent);
-    Node* node = domAgent->assertNode(errorString, nodeId);
-    if (!node)
-        return;
-
-    std::unique_ptr<ImageBuffer> snapshot = WebCore::snapshotNode(frame, *node);
-    if (!snapshot) {
-        errorString = ASCIILiteral("Could not capture snapshot");
-        return;
-    }
-
-    *outDataURL = snapshot->toDataURL(ASCIILiteral("image/png"));
-}
-
-void InspectorPageAgent::snapshotRect(ErrorString& errorString, int x, int y, int width, int height, const String& coordinateSystem, String* outDataURL)
-{
-    Frame& frame = mainFrame();
-
-    SnapshotOptions options = SnapshotOptionsNone;
-    if (coordinateSystem == "Viewport")
-        options |= SnapshotOptionsInViewCoordinates;
-
-    IntRect rectangle(x, y, width, height);
-    std::unique_ptr<ImageBuffer> snapshot = snapshotFrameRect(frame, rectangle, options);
-
-    if (!snapshot) {
-        errorString = ASCIILiteral("Could not capture snapshot");
-        return;
-    }
-
-    *outDataURL = snapshot->toDataURL(ASCIILiteral("image/png"));
-}
-
-void InspectorPageAgent::archive(ErrorString& errorString, String* data)
-{
-#if ENABLE(WEB_ARCHIVE) && USE(CF)
-    Frame& frame = mainFrame();
-    RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(frame);
-    if (!archive) {
-        errorString = ASCIILiteral("Could not create web archive for main frame");
-        return;
-    }
-
-    RetainPtr<CFDataRef> buffer = archive->rawDataRepresentation();
-    *data = base64Encode(CFDataGetBytePtr(buffer.get()), CFDataGetLength(buffer.get()));
-#else
-    UNUSED_PARAM(data);
-    errorString = ASCIILiteral("No support for creating archives");
-#endif
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgenth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorPageAgent.h (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.h      2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h 2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,169 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2015-2016 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:
- *
- *     * 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.
- */
-
-#pragma once
-
-#include "CachedResource.h"
-#include "InspectorWebAgentBase.h"
-#include "LayoutRect.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <wtf/HashMap.h>
-#include <wtf/Seconds.h>
-#include <wtf/text/WTFString.h>
-
-namespace Inspector {
-class InspectorObject;
-}
-
-namespace WebCore {
-
-class DocumentLoader;
-class Frame;
-class InspectorClient;
-class InspectorOverlay;
-class MainFrame;
-class Page;
-class RenderObject;
-class SharedBuffer;
-class TextResourceDecoder;
-class URL;
-
-typedef String ErrorString;
-
-class InspectorPageAgent final : public InspectorAgentBase, public Inspector::PageBackendDispatcherHandler {
-    WTF_MAKE_NONCOPYABLE(InspectorPageAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorPageAgent(PageAgentContext&, InspectorClient*, InspectorOverlay*);
-
-    enum ResourceType {
-        DocumentResource,
-        StylesheetResource,
-        ImageResource,
-        FontResource,
-        ScriptResource,
-        XHRResource,
-        FetchResource,
-        PingResource,
-        BeaconResource,
-        WebSocketResource,
-        OtherResource,
-    };
-
-    static bool cachedResourceContent(CachedResource*, String* result, bool* base64Encoded);
-    static bool sharedBufferContent(RefPtr<SharedBuffer>&&, const String& textEncodingName, bool withBase64Encode, String* result);
-    static void resourceContent(ErrorString&, Frame*, const URL&, String* result, bool* base64Encoded);
-    static String sourceMapURLForResource(CachedResource*);
-
-    static CachedResource* cachedResource(Frame*, const URL&);
-    static Inspector::Protocol::Page::ResourceType resourceTypeJSON(ResourceType);
-    static ResourceType inspectorResourceType(CachedResource::Type);
-    static ResourceType inspectorResourceType(const CachedResource&);
-    static Inspector::Protocol::Page::ResourceType cachedResourceTypeJSON(const CachedResource&);
-    static RefPtr<TextResourceDecoder> createTextDecoder(const String& mimeType, const String& textEncodingName);
-
-    // Page API for InspectorFrontend
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-    void reload(ErrorString&, const bool* const optionalReloadFromOrigin, const bool* const optionalRevalidateAllResources) override;
-    void navigate(ErrorString&, const String& url) override;
-    void getCookies(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::Cookie>>& cookies) override;
-    void deleteCookie(ErrorString&, const String& cookieName, const String& url) override;
-    void getResourceTree(ErrorString&, RefPtr<Inspector::Protocol::Page::FrameResourceTree>&) override;
-    void getResourceContent(ErrorString&, const String& frameId, const String& url, String* content, bool* base64Encoded) override;
-    void searchInResource(ErrorString&, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, const String* const optionalRequestId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&) override;
-    void searchInResources(ErrorString&, const String&, const bool* const caseSensitive, const bool* const isRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>&) override;
-    void setShowPaintRects(ErrorString&, bool show) override;
-    void setEmulatedMedia(ErrorString&, const String&) override;
-    void getCompositingBordersVisible(ErrorString&, bool* out_param) override;
-    void setCompositingBordersVisible(ErrorString&, bool) override;
-    void snapshotNode(ErrorString&, int nodeId, String* outDataURL) override;
-    void snapshotRect(ErrorString&, int x, int y, int width, int height, const String& coordinateSystem, String* outDataURL) override;
-    void archive(ErrorString&, String* data) override;
-
-    // InspectorInstrumentation
-    void domContentEventFired();
-    void loadEventFired();
-    void frameNavigated(Frame&);
-    void frameDetached(Frame&);
-    void loaderDetachedFromFrame(DocumentLoader&);
-    void frameStartedLoading(Frame&);
-    void frameStoppedLoading(Frame&);
-    void frameScheduledNavigation(Frame&, Seconds delay);
-    void frameClearedScheduledNavigation(Frame&);
-    void applyEmulatedMedia(String&);
-    void didPaint(RenderObject&, const LayoutRect&);
-    void didLayout();
-    void didScroll();
-    void didRecalculateStyle();
-
-    // Inspector Controller API
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-
-    // Cross-agents API
-    Page& page() { return m_page; }
-    MainFrame& mainFrame();
-    Frame* frameForId(const String& frameId);
-    WEBCORE_EXPORT String frameId(Frame*);
-    bool hasIdForFrame(Frame*) const;
-    String loaderId(DocumentLoader*);
-    Frame* findFrameWithSecurityOrigin(const String& originRawString);
-    Frame* assertFrame(ErrorString&, const String& frameId);
-    static DocumentLoader* assertDocumentLoader(ErrorString&, Frame*);
-
-private:
-    double timestamp();
-
-    static bool mainResourceContent(Frame*, bool withBase64Encode, String* result);
-    static bool dataContent(const char* data, unsigned size, const String& textEncodingName, bool withBase64Encode, String* result);
-
-    Ref<Inspector::Protocol::Page::Frame> buildObjectForFrame(Frame*);
-    Ref<Inspector::Protocol::Page::FrameResourceTree> buildObjectForFrameTree(Frame*);
-
-    std::unique_ptr<Inspector::PageFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::PageBackendDispatcher> m_backendDispatcher;
-
-    Page& m_page;
-    InspectorClient* m_client { nullptr };
-    InspectorOverlay* m_overlay { nullptr };
-
-    HashMap<Frame*, String> m_frameToIdentifier;
-    HashMap<String, Frame*> m_identifierToFrame;
-    HashMap<DocumentLoader*, String> m_loaderToIdentifier;
-    bool m_enabled { false };
-    bool m_isFirstLayoutAfterOnLoad { false };
-    bool m_showPaintRects { false };
-    String m_emulatedMedia;
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (224344 => 224345)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2017-11-02 17:46:48 UTC (rev 224344)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp   2017-11-02 18:25:28 UTC (rev 224345)
</span><span class="lines">@@ -1,759 +0,0 @@
</span><del>-/*
-* Copyright (C) 2013 Google Inc. All rights reserved.
-* Copyright (C) 2014 University of Washington.
-* Copyright (C) 2015 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:
-*
-*     * 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 "InspectorTimelineAgent.h"
-
-#include "DOMWindow.h"
-#include "Event.h"
-#include "Frame.h"
-#include "InspectorMemoryAgent.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "JSDOMWindow.h"
-#include "PageScriptDebugServer.h"
-#include "RenderView.h"
-#include "ScriptState.h"
-#include "TimelineRecordFactory.h"
-#include "WebConsoleAgent.h"
-#include <inspector/ConsoleMessage.h>
-#include <inspector/ScriptBreakpoint.h>
-#include <inspector/agents/InspectorDebuggerAgent.h>
-#include <inspector/agents/InspectorHeapAgent.h>
-#include <inspector/agents/InspectorScriptProfilerAgent.h>
-#include <wtf/Stopwatch.h>
-
-#if PLATFORM(IOS)
-#include "RuntimeApplicationChecks.h"
-#include "WebCoreThreadInternal.h"
-#endif
-
-#if PLATFORM(COCOA)
-#include "RunLoopObserver.h"
-#endif
-
-
-namespace WebCore {
-using namespace Inspector;
-
-#if PLATFORM(COCOA)
-static const CFIndex frameStopRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit + 1;
-
-static CFRunLoopRef currentRunLoop()
-{
-#if PLATFORM(IOS)
-    // A race condition during WebView deallocation can lead to a crash if the layer sync run loop
-    // observer is added to the main run loop <rdar://problem/9798550>. However, for responsiveness,
-    // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
-    // crash are especially troublesome for iBooks, we never allow the observer to be added to the
-    // main run loop in iBooks.
-    if (IOSApplication::isIBooks())
-        return WebThreadRunLoop();
-#endif
-    return CFRunLoopGetCurrent();
-}
-#endif
-
-InspectorTimelineAgent::InspectorTimelineAgent(WebAgentContext& context, InspectorScriptProfilerAgent* scriptProfileAgent, InspectorHeapAgent* heapAgent, InspectorPageAgent* pageAgent)
-    : InspectorAgentBase(ASCIILiteral("Timeline"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::TimelineFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::TimelineBackendDispatcher::create(context.backendDispatcher, this))
-    , m_scriptProfilerAgent(scriptProfileAgent)
-    , m_heapAgent(heapAgent)
-    , m_pageAgent(pageAgent)
-{
-}
-
-InspectorTimelineAgent::~InspectorTimelineAgent() = default;
-
-void InspectorTimelineAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-    m_instrumentingAgents.setPersistentInspectorTimelineAgent(this);
-}
-
-void InspectorTimelineAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    m_instrumentingAgents.setPersistentInspectorTimelineAgent(nullptr);
-
-    ErrorString unused;
-    stop(unused);
-
-    m_autoCaptureEnabled = false;
-    m_instruments.clear();
-}
-
-void InspectorTimelineAgent::start(ErrorString&, const int* maxCallStackDepth)
-{
-    m_enabledFromFrontend = true;
-
-    internalStart(maxCallStackDepth);
-}
-
-void InspectorTimelineAgent::stop(ErrorString&)
-{
-    internalStop();
-
-    m_enabledFromFrontend = false;
-}
-
-void InspectorTimelineAgent::setAutoCaptureEnabled(ErrorString&, bool enabled)
-{
-    m_autoCaptureEnabled = enabled;
-}
-
-void InspectorTimelineAgent::setInstruments(ErrorString& errorString, const InspectorArray& instruments)
-{
-    Vector<Protocol::Timeline::Instrument> newInstruments;
-    newInstruments.reserveCapacity(instruments.length());
-
-    for (auto instrumentValue : instruments) {
-        String enumValueString;
-        if (!instrumentValue->asString(enumValueString)) {
-            errorString = ASCIILiteral("Unexpected type in instruments list, should be string");
-            return;
-        }
-
-        std::optional<Protocol::Timeline::Instrument> instrumentType = Protocol::InspectorHelpers::parseEnumValueFromString<Protocol::Timeline::Instrument>(enumValueString);
-        if (!instrumentType) {
-            errorString = makeString("Unexpected enum value: ", enumValueString);
-            return;
-        }
-
-        newInstruments.uncheckedAppend(*instrumentType);
-    }
-
-    m_instruments.swap(newInstruments);
-}
-
-void InspectorTimelineAgent::internalStart(const int* maxCallStackDepth)
-{
-    if (m_enabled)
-        return;
-
-    if (maxCallStackDepth && *maxCallStackDepth > 0)
-        m_maxCallStackDepth = *maxCallStackDepth;
-    else
-        m_maxCallStackDepth = 5;
-
-    m_instrumentingAgents.setInspectorTimelineAgent(this);
-
-    m_environment.scriptDebugServer().addListener(this);
-
-    m_enabled = true;
-
-    // FIXME: Abstract away platform-specific code once https://bugs.webkit.org/show_bug.cgi?id=142748 is fixed.
-
-#if PLATFORM(COCOA)
-    m_frameStartObserver = std::make_unique<RunLoopObserver>(0, [this]() {
-        if (!m_enabled || m_environment.scriptDebugServer().isPaused())
-            return;
-
-        if (!m_runLoopNestingLevel)
-            pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RenderingFrame, false, nullptr);
-        m_runLoopNestingLevel++;
-    });
-
-    m_frameStopObserver = std::make_unique<RunLoopObserver>(frameStopRunLoopOrder, [this]() {
-        if (!m_enabled || m_environment.scriptDebugServer().isPaused())
-            return;
-
-        ASSERT(m_runLoopNestingLevel > 0);
-        m_runLoopNestingLevel--;
-        if (m_runLoopNestingLevel)
-            return;
-
-        if (m_startedComposite)
-            didComposite();
-
-        didCompleteCurrentRecord(TimelineRecordType::RenderingFrame);
-    });
-
-    m_frameStartObserver->schedule(currentRunLoop(), kCFRunLoopEntry | kCFRunLoopAfterWaiting);
-    m_frameStopObserver->schedule(currentRunLoop(), kCFRunLoopExit | kCFRunLoopBeforeWaiting);
-
-    // Create a runloop record and increment the runloop nesting level, to capture the current turn of the main runloop
-    // (which is the outer runloop if recording started while paused in the debugger).
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RenderingFrame, false, nullptr);
-
-    m_runLoopNestingLevel = 1;
-#endif
-
-    m_frontendDispatcher->recordingStarted(timestamp());
-}
-
-void InspectorTimelineAgent::internalStop()
-{
-    if (!m_enabled)
-        return;
-
-    m_instrumentingAgents.setInspectorTimelineAgent(nullptr);
-
-    m_environment.scriptDebugServer().removeListener(this, true);
-
-#if PLATFORM(COCOA)
-    m_frameStartObserver = nullptr;
-    m_frameStopObserver = nullptr;
-    m_runLoopNestingLevel = 0;
-
-    // Complete all pending records to prevent discarding events that are currently in progress.
-    while (!m_recordStack.isEmpty())
-        didCompleteCurrentRecord(m_recordStack.last().type);
-#endif
-
-    clearRecordStack();
-
-    m_enabled = false;
-    m_startedComposite = false;
-    m_autoCapturePhase = AutoCapturePhase::None;
-
-    m_frontendDispatcher->recordingStopped(timestamp());
-}
-
-double InspectorTimelineAgent::timestamp()
-{
-    return m_environment.executionStopwatch()->elapsedTime();
-}
-
-void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String& title)
-{
-    // Allow duplicate unnamed profiles. Disallow duplicate named profiles.
-    if (!title.isEmpty()) {
-        for (const TimelineRecordEntry& record : m_pendingConsoleProfileRecords) {
-            String recordTitle;
-            record.data->getString(ASCIILiteral("title"), recordTitle);
-            if (recordTitle == title) {
-                if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) {
-                    // FIXME: Send an enum to the frontend for localization?
-                    String warning = title.isEmpty() ? ASCIILiteral("Unnamed Profile already exists") : makeString("Profile \"", title, "\" already exists");
-                    consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Profile, MessageLevel::Warning, warning));
-                }
-                return;
-            }
-        }
-    }
-
-    if (!m_enabled && m_pendingConsoleProfileRecords.isEmpty())
-        startProgrammaticCapture();
-
-    m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
-}
-
-void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String& title)
-{
-    // Stop profiles in reverse order. If the title is empty, then stop the last profile.
-    // Otherwise, match the title of the profile to stop.
-    for (int i = m_pendingConsoleProfileRecords.size() - 1; i >= 0; --i) {
-        const TimelineRecordEntry& record = m_pendingConsoleProfileRecords[i];
-
-        String recordTitle;
-        record.data->getString(ASCIILiteral("title"), recordTitle);
-        if (title.isEmpty() || recordTitle == title) {
-            didCompleteRecordEntry(record);
-            m_pendingConsoleProfileRecords.remove(i);
-
-            if (!m_enabledFromFrontend && m_pendingConsoleProfileRecords.isEmpty())
-                stopProgrammaticCapture();
-
-            return;
-        }
-    }
-
-    if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) {
-        // FIXME: Send an enum to the frontend for localization?
-        String warning = title.isEmpty() ? ASCIILiteral("No profiles exist") : makeString("Profile \"", title, "\" does not exist");
-        consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::ProfileEnd, MessageLevel::Warning, warning));
-    }
-}
-
-void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, Frame* frame)
-{
-    pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame);
-}
-
-void InspectorTimelineAgent::didCallFunction(Frame*)
-{
-    didCompleteCurrentRecord(TimelineRecordType::FunctionCall);
-}
-
-void InspectorTimelineAgent::willDispatchEvent(const Event& event, Frame* frame)
-{
-    pushCurrentRecord(TimelineRecordFactory::createEventDispatchData(event), TimelineRecordType::EventDispatch, false, frame);
-}
-
-void InspectorTimelineAgent::didDispatchEvent()
-{
-    didCompleteCurrentRecord(TimelineRecordType::EventDispatch);
-}
-
-void InspectorTimelineAgent::didInvalidateLayout(Frame& frame)
-{
-    appendRecord(InspectorObject::create(), TimelineRecordType::InvalidateLayout, true, &frame);
-}
-
-void InspectorTimelineAgent::willLayout(Frame& frame)
-{
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Layout, true, &frame);
-}
-
-void InspectorTimelineAgent::didLayout(RenderObject& root)
-{
-    if (m_recordStack.isEmpty())
-        return;
-    TimelineRecordEntry& entry = m_recordStack.last();
-    ASSERT(entry.type == TimelineRecordType::Layout);
-    Vector<FloatQuad> quads;
-    root.absoluteQuads(quads);
-    if (quads.size() >= 1)
-        TimelineRecordFactory::appendLayoutRoot(entry.data.get(), quads[0]);
-    else
-        ASSERT_NOT_REACHED();
-    didCompleteCurrentRecord(TimelineRecordType::Layout);
-}
-
-void InspectorTimelineAgent::didScheduleStyleRecalculation(Frame* frame)
-{
-    appendRecord(InspectorObject::create(), TimelineRecordType::ScheduleStyleRecalculation, true, frame);
-}
-
-void InspectorTimelineAgent::willRecalculateStyle(Frame* frame)
-{
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RecalculateStyles, true, frame);
-}
-
-void InspectorTimelineAgent::didRecalculateStyle()
-{
-    didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles);
-}
-
-void InspectorTimelineAgent::willComposite(Frame& frame)
-{
-    ASSERT(!m_startedComposite);
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Composite, true, &frame);
-    m_startedComposite = true;
-}
-
-void InspectorTimelineAgent::didComposite()
-{
-    ASSERT(m_startedComposite);
-    didCompleteCurrentRecord(TimelineRecordType::Composite);
-    m_startedComposite = false;
-}
-
-void InspectorTimelineAgent::willPaint(Frame& frame)
-{
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true, &frame);
-}
-
-void InspectorTimelineAgent::didPaint(RenderObject& renderer, const LayoutRect& clipRect)
-{
-    TimelineRecordEntry& entry = m_recordStack.last();
-    ASSERT(entry.type == TimelineRecordType::Paint);
-    FloatQuad quad;
-    localToPageQuad(renderer, clipRect, &quad);
-    entry.data = TimelineRecordFactory::createPaintData(quad);
-    didCompleteCurrentRecord(TimelineRecordType::Paint);
-}
-
-void InspectorTimelineAgent::didInstallTimer(int timerId, Seconds timeout, bool singleShot, Frame* frame)
-{
-    appendRecord(TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot), TimelineRecordType::TimerInstall, true, frame);
-}
-
-void InspectorTimelineAgent::didRemoveTimer(int timerId, Frame* frame)
-{
-    appendRecord(TimelineRecordFactory::createGenericTimerData(timerId), TimelineRecordType::TimerRemove, true, frame);
-}
-
-void InspectorTimelineAgent::willFireTimer(int timerId, Frame* frame)
-{
-    pushCurrentRecord(TimelineRecordFactory::createGenericTimerData(timerId), TimelineRecordType::TimerFire, false, frame);
-}
-
-void InspectorTimelineAgent::didFireTimer()
-{
-    didCompleteCurrentRecord(TimelineRecordType::TimerFire);
-}
-
-void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, Frame& frame)
-{
-    pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber), TimelineRecordType::EvaluateScript, true, &frame);
-}
-
-void InspectorTimelineAgent::didEvaluateScript(Frame&)
-{
-    didCompleteCurrentRecord(TimelineRecordType::EvaluateScript);
-}
-
-void InspectorTimelineAgent::didTimeStamp(Frame& frame, const String& message)
-{
-    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeStamp, true, &frame);
-}
-
-void InspectorTimelineAgent::time(Frame& frame, const String& message)
-{
-    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::Time, true, &frame);
-}
-
-void InspectorTimelineAgent::timeEnd(Frame& frame, const String& message)
-{
-    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeEnd, true, &frame);
-}
-
-void InspectorTimelineAgent::mainFrameStartedLoading()
-{
-    if (m_enabled)
-        return;
-
-    if (!m_autoCaptureEnabled)
-        return;
-
-    if (m_instruments.isEmpty())
-        return;
-
-    m_autoCapturePhase = AutoCapturePhase::BeforeLoad;
-
-    // Pre-emptively disable breakpoints. The frontend must re-enable them.
-    if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) {
-        ErrorString unused;
-        debuggerAgent->setBreakpointsActive(unused, false);
-    }
-
-    // Inform the frontend we started an auto capture. The frontend must stop capture.
-    m_frontendDispatcher->autoCaptureStarted();
-
-    toggleInstruments(InstrumentState::Start);
-}
-
-void InspectorTimelineAgent::mainFrameNavigated()
-{
-    if (m_autoCapturePhase == AutoCapturePhase::BeforeLoad) {
-        m_autoCapturePhase = AutoCapturePhase::FirstNavigation;
-        toggleInstruments(InstrumentState::Start);
-        m_autoCapturePhase = AutoCapturePhase::AfterFirstNavigation;
-    }
-}
-
-void InspectorTimelineAgent::startProgrammaticCapture()
-{
-    ASSERT(!m_enabled);
-
-    // Disable breakpoints during programmatic capture.
-    if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) {
-        m_programmaticCaptureRestoreBreakpointActiveValue = debuggerAgent->breakpointsActive();
-        if (m_programmaticCaptureRestoreBreakpointActiveValue) {
-            ErrorString unused;
-            debuggerAgent->setBreakpointsActive(unused, false);
-        }
-    } else
-        m_programmaticCaptureRestoreBreakpointActiveValue = false;
-
-    m_frontendDispatcher->programmaticCaptureStarted();
-
-    toggleScriptProfilerInstrument(InstrumentState::Start); // Ensure JavaScript samping data.
-    toggleTimelineInstrument(InstrumentState::Start); // Ensure Console Profile&nb