<!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>[205369] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/205369">205369</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-02 13:57:51 -0700 (Fri, 02 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Provide a way to open an inspector frontend for a remote target
https://bugs.webkit.org/show_bug.cgi?id=161515
&lt;rdar://problem/13182127&gt;

Reviewed by Brian Burg.

Source/WebCore:

Previously WebKit inspector frontend clients could only
create a frontend for a web page with the latest protocol.
Now it may create a frontend for a &quot;javascript&quot; or &quot;web&quot;
debuggable that may be current or an older protocol.

The frontend already supports these configurations by
checking and calling InspectorFrontendHost methods
that may or may not have existed previously:

- debuggableType was always &quot;web&quot; but frontend supports &quot;javascript&quot;
- inspectorBackendCommandsURLs was absent so the frontend used the most current
    - rename this to backendCommandsURL

Formalize the methods and have them delegate to the
frontend client opening the frontend.

* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::backendCommandsURL):
(WebCore::InspectorFrontendClient::debuggableType):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::localizedStringsURL):
(WebCore::InspectorFrontendHost::backendCommandsURL):
(WebCore::InspectorFrontendHost::debuggableType):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Formalize and give default values to InspectorFrontentHost methods.

Source/WebInspectorUI:

* UserInterface/Base/InspectorFrontendHostStub.js:
(WebInspector.InspectorFrontendHostStub.prototype.backendCommandsURL):
Stub new InspectorFrontendHost methods. This value causes the
frontend to load the latest protocol.

* UserInterface/Protocol/LoadInspectorBackendCommands.js:
Use formalized backendCommandsURL, and if empty load the latest protocol.

Source/WebKit2:

Provide an interface to open a Web Inspector window/webView for a
remote debuggable. Unlike the local Web Inspector, the remote
debuggable may be either a JSContext or WebPage, and may only
support an older version of the protocol. The Inspector frontend
already supports these configurations.

This adds new RemoteWebInspector/Proxy classes that mirror the
WebInspector/Proxy classes for local inspection, but have
slightly different behavior as the inspected target is not
directly available (and may not be a web page).

The remote and local classes share a lot of inspector
frontend implementation:

  - share most of the inspector frontend host implementation
  - share much of the frontend webview/window handling
  - use an inspector process for the frontend page

But remains separate in some ways:

  - inspected target is unavailable
  - docking is never available
  - a few inspector frontend host methods are duplicated
  - some of the webview/window handling is duplicated

* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: Added.
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: Added.
(-[_WKRemoteWebInspectorViewController init]):
(-[_WKRemoteWebInspectorViewController window]):
(-[_WKRemoteWebInspectorViewController webView]):
(-[_WKRemoteWebInspectorViewController loadForDebuggableType:backendCommandsURL:]):
(-[_WKRemoteWebInspectorViewController close]):
(-[_WKRemoteWebInspectorViewController show]):
(-[_WKRemoteWebInspectorViewController sendMessageToFrontend:]):
(-[_WKRemoteWebInspectorViewController sendMessageToBackend:]):
(-[_WKRemoteWebInspectorViewController closeFromFrontend]):
The interface that may be used to open an inspector window for
a remote debuggable. There are only a few delegates to handle
sending messages to the backend and knowing if the frontend
closed itself (InspectorFrontendHost.closeWindow() or crashed).

* UIProcess/WebInspectorUtilities.h:
* UIProcess/WebInspectorUtilities.cpp: Added.
(WebKit::pageLevelMap):
(WebKit::inspectorLevelForPage):
(WebKit::inspectorPageGroupIdentifierForPage):
(WebKit::trackInspectorPage):
(WebKit::untrackInspectorPage):
(WebKit::inspectorProcessPool):
(WebKit::isInspectorProcessPool):
(WebKit::isInspectorPage):
Extract utilities for determining if a page contains an inspector frontend.
Previously this was part of WebInspectorProxy and subclasses but can
now be used by multiple classes.

* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::inspectionLevel):
(WebKit::WebInspectorProxy::invalidate):
(WebKit::WebInspectorProxy::isMainOrTestInspectorPage):
(WebKit::decidePolicyForNavigationAction):
(WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
(WebKit::WebInspectorProxy::didClose):
(WebKit::pageLevelMap): Deleted.
(WebKit::WebInspectorProxy::inspectorPageGroupIdentifier): Deleted.
(WebKit::WebInspectorProxy::inspectorProcessPool): Deleted.
(WebKit::WebInspectorProxy::isInspectorProcessPool): Deleted.
(WebKit::WebInspectorProxy::isInspectorPage): Deleted.
(WebKit::isMainOrTestInspectorPage): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
Extract methods to utilities and use them.

Also address an issue where WebInspectorProxy was untracking
the wrong page. It should have been untracking the inspector
page but was untracking the inspected page.

* UIProcess/RemoteWebInspectorProxy.cpp: Added.
(WebKit::RemoteWebInspectorProxy::RemoteWebInspectorProxy):
(WebKit::RemoteWebInspectorProxy::~RemoteWebInspectorProxy):
(WebKit::RemoteWebInspectorProxy::invalidate):
(WebKit::RemoteWebInspectorProxy::load):
(WebKit::RemoteWebInspectorProxy::closeFromBackend):
(WebKit::RemoteWebInspectorProxy::closeFromCrash):
(WebKit::RemoteWebInspectorProxy::show):
(WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
(WebKit::RemoteWebInspectorProxy::frontendDidClose):
(WebKit::RemoteWebInspectorProxy::bringToFront):
(WebKit::RemoteWebInspectorProxy::save):
(WebKit::RemoteWebInspectorProxy::append):
(WebKit::RemoteWebInspectorProxy::startWindowDrag):
(WebKit::RemoteWebInspectorProxy::openInNewTab):
(WebKit::RemoteWebInspectorProxy::sendMessageToBackend):
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::closeFrontendPageAndWindow):
This class behaves like WebInspectorProxy but without having a
reference to the inspected target. It communicates with
RemoteInspectorUI in an Inspector process to send and receive
frontend messages. What can't be easily shared is duplicated.

* UIProcess/mac/RemoteWebInspectorProxyMac.mm: Added.
(-[WKRemoteWebInspectorProxyObjCAdapter initWithRemoteWebInspectorProxy:]):
(-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]):
(-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]):
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::platformBringToFront):
(WebKit::RemoteWebInspectorProxy::platformSave):
(WebKit::RemoteWebInspectorProxy::platformAppend):
(WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
(WebKit::RemoteWebInspectorProxy::platformOpenInNewTab):
Platform implementation for the bits that are platform specific.
What can't be easily shared is duplicated. Ideally we will
eventually share this with WebInspectorProxyMac.

* UIProcess/mac/WKWebInspectorWKWebView.h:
* UIProcess/mac/WKWebInspectorWKWebView.mm: Added.
(WebKit::getWindowFrame):
(WebKit::setWindowFrame):
(WebKit::exceededDatabaseQuota):
(WebKit::runOpenPanel):
(-[WKWebInspectorWKWebView initWithFrame:configuration:]):
(-[WKWebInspectorWKWebView tag]):
Extract Mac platform code for the inspector webview from WebInspectorProxyMac.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::closeTimerFired):
(WebKit::WebInspectorProxy::createInspectorWindow):
(WebKit::WebInspectorProxy::createFrontendConfiguration):
(WebKit::WebInspectorProxy::createFrontendWindow):
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
(-[WKWebInspectorWKWebView tag]): Deleted.
(WebKit::getWindowFrame): Deleted.
(WebKit::setWindowFrame): Deleted.
(WebKit::exceededDatabaseQuota): Deleted.
(WebKit::runOpenPanel): Deleted.
Extact Mac platform code to be shared for construction of a
WKWebViewConfiguration, WKWebView, and NSWindow for an inspector webview.

* WebProcess/WebPage/RemoteWebInspectorUI.cpp: Added.
(WebKit::RemoteWebInspectorUI::create):
(WebKit::RemoteWebInspectorUI::RemoteWebInspectorUI):
(WebKit::RemoteWebInspectorUI::initialize):
(WebKit::RemoteWebInspectorUI::didSave):
(WebKit::RemoteWebInspectorUI::didAppend):
(WebKit::RemoteWebInspectorUI::sendMessageToFrontend):
(WebKit::RemoteWebInspectorUI::sendMessageToBackend):
(WebKit::RemoteWebInspectorUI::windowObjectCleared):
(WebKit::RemoteWebInspectorUI::frontendLoaded):
(WebKit::RemoteWebInspectorUI::startWindowDrag):
(WebKit::RemoteWebInspectorUI::moveWindowBy):
(WebKit::RemoteWebInspectorUI::bringToFront):
(WebKit::RemoteWebInspectorUI::closeWindow):
(WebKit::RemoteWebInspectorUI::openInNewTab):
(WebKit::RemoteWebInspectorUI::save):
(WebKit::RemoteWebInspectorUI::append):
(WebKit::RemoteWebInspectorUI::inspectedURLChanged):
* WebProcess/WebPage/RemoteWebInspectorUI.h: Added.
* WebProcess/WebPage/RemoteWebInspectorUI.messages.in: Added.
* UIProcess/RemoteWebInspectorProxy.messages.in: Added.
* UIProcess/RemoteWebInspectorProxy.mm: Added.
Inspector frontend client that knows to talk
with a RemoteWebInspectorProxy instead of a WebInspectorProxy.

* WebProcess/WebPage/WebInspectorUI.cpp:
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/mac/WebInspectorUIMac.mm:
(WebKit::webInspectorUILocalizedStringsURL):
(WebKit::WebInspectorUI::localizedStringsURL):
(WebKit::RemoteWebInspectorUI::localizedStringsURL):
Simplify localized string URL lookup.

* DerivedSources.make:
* WebKit2.xcodeproj/project.pbxproj:
New files.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::~WebPage):
(WebKit::WebPage::remoteInspectorUI):
(WebKit::WebPage::didReceiveMessage):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isInspectorPage):
An InspectorProcess WebPage may have either a WebInspectorUI or a RemoteWebInspectorUI.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorFrontendClienth">trunk/Source/WebCore/inspector/InspectorFrontendClient.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorFrontendHostcpp">trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorFrontendHosth">trunk/Source/WebCore/inspector/InspectorFrontendHost.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorFrontendHostidl">trunk/Source/WebCore/inspector/InspectorFrontendHost.idl</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseInspectorFrontendHostStubjs">trunk/Source/WebInspectorUI/UserInterface/Base/InspectorFrontendHostStub.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolLoadInspectorBackendCommandsjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebInspectorProxycpp">trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebInspectorProxyh">trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxycpp">trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflWebInspectorProxyEflcpp">trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebInspectorProxyGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebInspectorProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageLayerTreeHosth">trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebInspectorUIh">trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageeflWebInspectorUIEflcpp">trunk/Source/WebKit2/WebProcess/WebPage/efl/WebInspectorUIEfl.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagegtkWebInspectorUIGtkcpp">trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWebInspectorUIMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorUIMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKRemoteWebInspectorViewControllerh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKRemoteWebInspectorViewControllermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessRemoteWebInspectorProxycpp">trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessRemoteWebInspectorProxyh">trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessRemoteWebInspectorProxymessagesin">trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebInspectorUtilitiescpp">trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebInspectorUtilitiesh">trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteWebInspectorProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKWebInspectorWKWebViewh">trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKWebInspectorWKWebViewmm">trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageRemoteWebInspectorUIcpp">trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageRemoteWebInspectorUIh">trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageRemoteWebInspectorUImessagesin">trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebCore/ChangeLog        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-09-02  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Provide a way to open an inspector frontend for a remote target
+        https://bugs.webkit.org/show_bug.cgi?id=161515
+        &lt;rdar://problem/13182127&gt;
+
+        Reviewed by Brian Burg.
+
+        Previously WebKit inspector frontend clients could only
+        create a frontend for a web page with the latest protocol.
+        Now it may create a frontend for a &quot;javascript&quot; or &quot;web&quot;
+        debuggable that may be current or an older protocol.
+
+        The frontend already supports these configurations by
+        checking and calling InspectorFrontendHost methods
+        that may or may not have existed previously:
+
+        - debuggableType was always &quot;web&quot; but frontend supports &quot;javascript&quot;
+        - inspectorBackendCommandsURLs was absent so the frontend used the most current
+            - rename this to backendCommandsURL
+        
+        Formalize the methods and have them delegate to the
+        frontend client opening the frontend.
+
+        * inspector/InspectorFrontendClient.h:
+        (WebCore::InspectorFrontendClient::backendCommandsURL):
+        (WebCore::InspectorFrontendClient::debuggableType):
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::localizedStringsURL):
+        (WebCore::InspectorFrontendHost::backendCommandsURL):
+        (WebCore::InspectorFrontendHost::debuggableType):
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.idl:
+        Formalize and give default values to InspectorFrontentHost methods.
+
</ins><span class="cx"> 2016-09-02  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for media query parsing using new CSS Parser
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorFrontendClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorFrontendClient.h (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorFrontendClient.h        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClient.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><ins>+#include &lt;wtf/text/WTFString.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -52,6 +53,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual String localizedStringsURL() = 0;
</span><span class="cx">     virtual unsigned inspectionLevel() const = 0;
</span><ins>+    virtual String backendCommandsURL() { return String(); };
+    virtual String debuggableType() { return ASCIILiteral(&quot;web&quot;); }
</ins><span class="cx"> 
</span><span class="cx">     virtual void bringToFront() = 0;
</span><span class="cx">     virtual void closeWindow() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorFrontendHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -222,12 +222,17 @@
</span><span class="cx"> 
</span><span class="cx"> String InspectorFrontendHost::localizedStringsURL()
</span><span class="cx"> {
</span><del>-    return m_client ? m_client-&gt;localizedStringsURL() : emptyString();
</del><ins>+    return m_client ? m_client-&gt;localizedStringsURL() : String();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String InspectorFrontendHost::backendCommandsURL()
+{
+    return m_client ? m_client-&gt;backendCommandsURL() : String();
+}
+
</ins><span class="cx"> String InspectorFrontendHost::debuggableType()
</span><span class="cx"> {
</span><del>-    return ASCIILiteral(&quot;web&quot;);
</del><ins>+    return m_client ? m_client-&gt;debuggableType() : String();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned InspectorFrontendHost::inspectionLevel()
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorFrontendHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.h (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorFrontendHost.h        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     void moveWindowBy(float x, float y) const;
</span><span class="cx"> 
</span><span class="cx">     String localizedStringsURL();
</span><ins>+    String backendCommandsURL();
</ins><span class="cx">     String debuggableType();
</span><span class="cx">     unsigned inspectionLevel();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorFrontendHostidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.idl (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorFrontendHost.idl        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.idl        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx">     void moveWindowBy(unrestricted float x, unrestricted float y);
</span><span class="cx"> 
</span><span class="cx">     DOMString localizedStringsURL();
</span><ins>+    DOMString backendCommandsURL();
</ins><span class="cx">     DOMString debuggableType();
</span><span class="cx">     unsigned long inspectionLevel();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-09-02  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Provide a way to open an inspector frontend for a remote target
+        https://bugs.webkit.org/show_bug.cgi?id=161515
+        &lt;rdar://problem/13182127&gt;
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Base/InspectorFrontendHostStub.js:
+        (WebInspector.InspectorFrontendHostStub.prototype.backendCommandsURL):
+        Stub new InspectorFrontendHost methods. This value causes the
+        frontend to load the latest protocol.
+
+        * UserInterface/Protocol/LoadInspectorBackendCommands.js:
+        Use formalized backendCommandsURL, and if empty load the latest protocol.
+
</ins><span class="cx"> 2016-09-02  Johan K. Jensen  &lt;johan_jensen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: NetworkTimelineOverviewGraph.MinimumBarPaddingTime is undefined
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseInspectorFrontendHostStubjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/InspectorFrontendHostStub.js (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/InspectorFrontendHostStub.js        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/InspectorFrontendHostStub.js        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -101,6 +101,11 @@
</span><span class="cx">             return undefined;
</span><span class="cx">         },
</span><span class="cx"> 
</span><ins>+        backendCommandsURL: function()
+        {
+            return undefined;
+        },
+
</ins><span class="cx">         debuggableType: function()
</span><span class="cx">         {
</span><span class="cx">             return &quot;web&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolLoadInspectorBackendCommandsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/LoadInspectorBackendCommands.js        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -24,17 +24,6 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> (function() {
</span><del>-    var backendURLs;
-    if (InspectorFrontendHost.inspectorBackendCommandsURLs) {
-        var suggestedBackendCommandsURLs = InspectorFrontendHost.inspectorBackendCommandsURLs();
-        if (suggestedBackendCommandsURLs)
-            backendURLs = suggestedBackendCommandsURLs;
-    }
-
-    if (!backendURLs)
-        backendURLs = [&quot;Protocol/InspectorBackendCommands.js&quot;];
-
-    console.assert(backendURLs.length);
-    for (var backendCommandsURL of backendURLs)
-        document.write(&quot;&lt;script src=\&quot;&quot; + backendCommandsURL + &quot;\&quot;&gt;&lt;/script&gt;&quot;);
</del><ins>+    let backendCommandsURL = InspectorFrontendHost.backendCommandsURL() || &quot;Protocol/InspectorBackendCommands.js&quot;;
+    document.write(&quot;&lt;script src=\&quot;&quot; + backendCommandsURL + &quot;\&quot;&gt;&lt;/script&gt;&quot;);
</ins><span class="cx"> })();
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/CMakeLists.txt        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -352,6 +352,7 @@
</span><span class="cx">     UIProcess/PageLoadState.cpp
</span><span class="cx">     UIProcess/ProcessAssertion.cpp
</span><span class="cx">     UIProcess/ProcessThrottler.cpp
</span><ins>+    UIProcess/RemoteWebInspectorProxy.cpp
</ins><span class="cx">     UIProcess/ResponsivenessTimer.cpp
</span><span class="cx">     UIProcess/StatisticsRequest.cpp
</span><span class="cx">     UIProcess/TextCheckerCompletion.cpp
</span><span class="lines">@@ -383,6 +384,7 @@
</span><span class="cx">     UIProcess/WebIconDatabase.cpp
</span><span class="cx">     UIProcess/WebIconDatabaseClient.cpp
</span><span class="cx">     UIProcess/WebInspectorProxy.cpp
</span><ins>+    UIProcess/WebInspectorUtilities.cpp
</ins><span class="cx">     UIProcess/WebNavigationState.cpp
</span><span class="cx">     UIProcess/WebOpenPanelResultListenerProxy.cpp
</span><span class="cx">     UIProcess/WebPageDiagnosticLoggingClient.cpp
</span><span class="lines">@@ -637,6 +639,7 @@
</span><span class="cx">     WebProcess/WebPage/FindController.cpp
</span><span class="cx">     WebProcess/WebPage/LayerTreeHost.cpp
</span><span class="cx">     WebProcess/WebPage/PageBanner.cpp
</span><ins>+    WebProcess/WebPage/RemoteWebInspectorUI.cpp
</ins><span class="cx">     WebProcess/WebPage/VisitedLinkTableController.cpp
</span><span class="cx">     WebProcess/WebPage/WebBackForwardListProxy.cpp
</span><span class="cx">     WebProcess/WebPage/WebContextMenu.cpp
</span><span class="lines">@@ -680,6 +683,7 @@
</span><span class="cx">     Shared/Plugins/NPObjectMessageReceiver.messages.in
</span><span class="cx"> 
</span><span class="cx">     UIProcess/DrawingAreaProxy.messages.in
</span><ins>+    UIProcess/RemoteWebInspectorProxy.messages.in
</ins><span class="cx">     UIProcess/VisitedLinkStore.messages.in
</span><span class="cx">     UIProcess/WebBatteryManagerProxy.messages.in
</span><span class="cx">     UIProcess/WebCookieManagerProxy.messages.in
</span><span class="lines">@@ -741,6 +745,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebProcess/WebPage/DrawingArea.messages.in
</span><span class="cx">     WebProcess/WebPage/EventDispatcher.messages.in
</span><ins>+    WebProcess/WebPage/RemoteWebInspectorUI.messages.in
</ins><span class="cx">     WebProcess/WebPage/VisitedLinkTableController.messages.in
</span><span class="cx">     WebProcess/WebPage/WebInspector.messages.in
</span><span class="cx">     WebProcess/WebPage/WebInspectorUI.messages.in
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/ChangeLog        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -1,3 +1,202 @@
</span><ins>+2016-09-02  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Provide a way to open an inspector frontend for a remote target
+        https://bugs.webkit.org/show_bug.cgi?id=161515
+        &lt;rdar://problem/13182127&gt;
+
+        Reviewed by Brian Burg.
+
+        Provide an interface to open a Web Inspector window/webView for a
+        remote debuggable. Unlike the local Web Inspector, the remote
+        debuggable may be either a JSContext or WebPage, and may only
+        support an older version of the protocol. The Inspector frontend
+        already supports these configurations.
+
+        This adds new RemoteWebInspector/Proxy classes that mirror the
+        WebInspector/Proxy classes for local inspection, but have
+        slightly different behavior as the inspected target is not
+        directly available (and may not be a web page).
+
+        The remote and local classes share a lot of inspector
+        frontend implementation:
+
+          - share most of the inspector frontend host implementation
+          - share much of the frontend webview/window handling
+          - use an inspector process for the frontend page
+
+        But remains separate in some ways:
+
+          - inspected target is unavailable
+          - docking is never available
+          - a few inspector frontend host methods are duplicated
+          - some of the webview/window handling is duplicated
+
+        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: Added.
+        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: Added.
+        (-[_WKRemoteWebInspectorViewController init]):
+        (-[_WKRemoteWebInspectorViewController window]):
+        (-[_WKRemoteWebInspectorViewController webView]):
+        (-[_WKRemoteWebInspectorViewController loadForDebuggableType:backendCommandsURL:]):
+        (-[_WKRemoteWebInspectorViewController close]):
+        (-[_WKRemoteWebInspectorViewController show]):
+        (-[_WKRemoteWebInspectorViewController sendMessageToFrontend:]):
+        (-[_WKRemoteWebInspectorViewController sendMessageToBackend:]):
+        (-[_WKRemoteWebInspectorViewController closeFromFrontend]):
+        The interface that may be used to open an inspector window for
+        a remote debuggable. There are only a few delegates to handle
+        sending messages to the backend and knowing if the frontend
+        closed itself (InspectorFrontendHost.closeWindow() or crashed).
+
+        * UIProcess/WebInspectorUtilities.h:
+        * UIProcess/WebInspectorUtilities.cpp: Added.
+        (WebKit::pageLevelMap):
+        (WebKit::inspectorLevelForPage):
+        (WebKit::inspectorPageGroupIdentifierForPage):
+        (WebKit::trackInspectorPage):
+        (WebKit::untrackInspectorPage):
+        (WebKit::inspectorProcessPool):
+        (WebKit::isInspectorProcessPool):
+        (WebKit::isInspectorPage):
+        Extract utilities for determining if a page contains an inspector frontend.
+        Previously this was part of WebInspectorProxy and subclasses but can
+        now be used by multiple classes.
+
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::inspectionLevel):
+        (WebKit::WebInspectorProxy::invalidate):
+        (WebKit::WebInspectorProxy::isMainOrTestInspectorPage):
+        (WebKit::decidePolicyForNavigationAction):
+        (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
+        (WebKit::WebInspectorProxy::didClose):
+        (WebKit::pageLevelMap): Deleted.
+        (WebKit::WebInspectorProxy::inspectorPageGroupIdentifier): Deleted.
+        (WebKit::WebInspectorProxy::inspectorProcessPool): Deleted.
+        (WebKit::WebInspectorProxy::isInspectorProcessPool): Deleted.
+        (WebKit::WebInspectorProxy::isInspectorPage): Deleted.
+        (WebKit::isMainOrTestInspectorPage): Deleted.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::getLaunchOptions):
+        * UIProcess/efl/WebInspectorProxyEfl.cpp:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        Extract methods to utilities and use them.
+
+        Also address an issue where WebInspectorProxy was untracking
+        the wrong page. It should have been untracking the inspector
+        page but was untracking the inspected page.
+
+        * UIProcess/RemoteWebInspectorProxy.cpp: Added.
+        (WebKit::RemoteWebInspectorProxy::RemoteWebInspectorProxy):
+        (WebKit::RemoteWebInspectorProxy::~RemoteWebInspectorProxy):
+        (WebKit::RemoteWebInspectorProxy::invalidate):
+        (WebKit::RemoteWebInspectorProxy::load):
+        (WebKit::RemoteWebInspectorProxy::closeFromBackend):
+        (WebKit::RemoteWebInspectorProxy::closeFromCrash):
+        (WebKit::RemoteWebInspectorProxy::show):
+        (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
+        (WebKit::RemoteWebInspectorProxy::frontendDidClose):
+        (WebKit::RemoteWebInspectorProxy::bringToFront):
+        (WebKit::RemoteWebInspectorProxy::save):
+        (WebKit::RemoteWebInspectorProxy::append):
+        (WebKit::RemoteWebInspectorProxy::startWindowDrag):
+        (WebKit::RemoteWebInspectorProxy::openInNewTab):
+        (WebKit::RemoteWebInspectorProxy::sendMessageToBackend):
+        (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
+        (WebKit::RemoteWebInspectorProxy::closeFrontendPageAndWindow):
+        This class behaves like WebInspectorProxy but without having a
+        reference to the inspected target. It communicates with
+        RemoteInspectorUI in an Inspector process to send and receive
+        frontend messages. What can't be easily shared is duplicated.
+
+        * UIProcess/mac/RemoteWebInspectorProxyMac.mm: Added.
+        (-[WKRemoteWebInspectorProxyObjCAdapter initWithRemoteWebInspectorProxy:]):
+        (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]):
+        (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]):
+        (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
+        (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
+        (WebKit::RemoteWebInspectorProxy::platformBringToFront):
+        (WebKit::RemoteWebInspectorProxy::platformSave):
+        (WebKit::RemoteWebInspectorProxy::platformAppend):
+        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
+        (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab):
+        Platform implementation for the bits that are platform specific.
+        What can't be easily shared is duplicated. Ideally we will
+        eventually share this with WebInspectorProxyMac.
+
+        * UIProcess/mac/WKWebInspectorWKWebView.h:
+        * UIProcess/mac/WKWebInspectorWKWebView.mm: Added.
+        (WebKit::getWindowFrame):
+        (WebKit::setWindowFrame):
+        (WebKit::exceededDatabaseQuota):
+        (WebKit::runOpenPanel):
+        (-[WKWebInspectorWKWebView initWithFrame:configuration:]):
+        (-[WKWebInspectorWKWebView tag]):
+        Extract Mac platform code for the inspector webview from WebInspectorProxyMac.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::closeTimerFired):
+        (WebKit::WebInspectorProxy::createInspectorWindow):
+        (WebKit::WebInspectorProxy::createFrontendConfiguration):
+        (WebKit::WebInspectorProxy::createFrontendWindow):
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        (-[WKWebInspectorWKWebView tag]): Deleted.
+        (WebKit::getWindowFrame): Deleted.
+        (WebKit::setWindowFrame): Deleted.
+        (WebKit::exceededDatabaseQuota): Deleted.
+        (WebKit::runOpenPanel): Deleted.
+        Extact Mac platform code to be shared for construction of a
+        WKWebViewConfiguration, WKWebView, and NSWindow for an inspector webview.
+        
+        * WebProcess/WebPage/RemoteWebInspectorUI.cpp: Added.
+        (WebKit::RemoteWebInspectorUI::create):
+        (WebKit::RemoteWebInspectorUI::RemoteWebInspectorUI):
+        (WebKit::RemoteWebInspectorUI::initialize):
+        (WebKit::RemoteWebInspectorUI::didSave):
+        (WebKit::RemoteWebInspectorUI::didAppend):
+        (WebKit::RemoteWebInspectorUI::sendMessageToFrontend):
+        (WebKit::RemoteWebInspectorUI::sendMessageToBackend):
+        (WebKit::RemoteWebInspectorUI::windowObjectCleared):
+        (WebKit::RemoteWebInspectorUI::frontendLoaded):
+        (WebKit::RemoteWebInspectorUI::startWindowDrag):
+        (WebKit::RemoteWebInspectorUI::moveWindowBy):
+        (WebKit::RemoteWebInspectorUI::bringToFront):
+        (WebKit::RemoteWebInspectorUI::closeWindow):
+        (WebKit::RemoteWebInspectorUI::openInNewTab):
+        (WebKit::RemoteWebInspectorUI::save):
+        (WebKit::RemoteWebInspectorUI::append):
+        (WebKit::RemoteWebInspectorUI::inspectedURLChanged):
+        * WebProcess/WebPage/RemoteWebInspectorUI.h: Added.
+        * WebProcess/WebPage/RemoteWebInspectorUI.messages.in: Added.
+        * UIProcess/RemoteWebInspectorProxy.messages.in: Added.
+        * UIProcess/RemoteWebInspectorProxy.mm: Added.
+        Inspector frontend client that knows to talk
+        with a RemoteWebInspectorProxy instead of a WebInspectorProxy.
+
+        * WebProcess/WebPage/WebInspectorUI.cpp:
+        * WebProcess/WebPage/WebInspectorUI.h:
+        * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
+        (WebKit::webInspectorUILocalizedStringsURL):
+        (WebKit::WebInspectorUI::localizedStringsURL):
+        (WebKit::RemoteWebInspectorUI::localizedStringsURL):
+        Simplify localized string URL lookup.
+
+        * DerivedSources.make:
+        * WebKit2.xcodeproj/project.pbxproj:
+        New files.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::~WebPage):
+        (WebKit::WebPage::remoteInspectorUI):
+        (WebKit::WebPage::didReceiveMessage):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::isInspectorPage):
+        An InspectorProcess WebPage may have either a WebInspectorUI or a RemoteWebInspectorUI.
+
</ins><span class="cx"> 2016-07-08  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Refactor WebPlaybackSessionModelMediaElement to be client based.
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/DerivedSources.make        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -110,6 +110,8 @@
</span><span class="cx">     RemoteLayerTreeDrawingAreaProxy \
</span><span class="cx">     RemoteObjectRegistry \
</span><span class="cx">     RemoteScrollingCoordinator \
</span><ins>+    RemoteWebInspectorProxy \
+    RemoteWebInspectorUI \
</ins><span class="cx">     SecItemShimProxy \
</span><span class="cx">     SmartMagnificationController \
</span><span class="cx">     StorageAreaMap \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKRemoteWebInspectorViewControllerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * 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.
+ */
+
+#import &lt;WebKit/WKFoundation.h&gt;
+
+#if WK_API_ENABLED
+
+#if !TARGET_OS_IPHONE
+
+@class WKWebView;
+@protocol _WKRemoteWebInspectorViewControllerDelegate;
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef NS_ENUM(NSInteger, WKRemoteWebInspectorDebuggableType) {
+    WKRemoteWebInspectorDebuggableTypeJavaScript,
+    WKRemoteWebInspectorDebuggableTypeWeb,
+} WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+
+WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
+@interface _WKRemoteWebInspectorViewController : NSObject
+
+@property (nonatomic, assign) id &lt;_WKRemoteWebInspectorViewControllerDelegate&gt; delegate;
+
+@property (nonatomic, readonly, retain) NSWindow *window;
+@property (nonatomic, readonly, retain) WKWebView *webView;
+
+- (void)loadForDebuggableType:(WKRemoteWebInspectorDebuggableType)debuggableType backendCommandsURL:(NSURL *)backendCommandsURL;
+- (void)close;
+- (void)show;
+
+- (void)sendMessageToFrontend:(NSString *)message;
+
+@end
+
+@protocol _WKRemoteWebInspectorViewControllerDelegate &lt;NSObject&gt;
+@optional
+- (void)inspectorViewController:(_WKRemoteWebInspectorViewController *)controller sendMessageToBackend:(NSString *)message;
+- (void)inspectorViewControllerInspectorDidClose:(_WKRemoteWebInspectorViewController *)controller;
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif // !TARGET_OS_IPHONE
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKRemoteWebInspectorViewControllermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+/*
+ * 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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;_WKRemoteWebInspectorViewController.h&quot;
+
+#if PLATFORM(MAC) &amp;&amp; WK_API_ENABLED
+
+#import &quot;RemoteWebInspectorProxy.h&quot;
+#import &quot;WKWebInspectorWKWebView.h&quot;
+
+using namespace WebKit;
+
+@interface _WKRemoteWebInspectorViewController ()
+- (void)sendMessageToBackend:(NSString *)message;
+- (void)closeFromFrontend;
+@end
+
+namespace WebKit {
+
+class _WKRemoteWebInspectorProxyClient final : public RemoteWebInspectorProxyClient {
+public:
+    _WKRemoteWebInspectorProxyClient(_WKRemoteWebInspectorViewController *controller)
+        : m_controller(controller)
+    {
+    }
+
+    virtual ~_WKRemoteWebInspectorProxyClient()
+    {
+    }
+
+    void sendMessageToBackend(const String&amp; message) override
+    {
+        [m_controller sendMessageToBackend:message];
+    }
+
+    void closeFromFrontend() override
+    {
+        [m_controller closeFromFrontend];
+    }
+
+private:
+    _WKRemoteWebInspectorViewController *m_controller;
+};
+
+} // namespace WebKit
+
+@implementation _WKRemoteWebInspectorViewController {
+    RefPtr&lt;RemoteWebInspectorProxy&gt; m_remoteInspectorProxy;
+    std::unique_ptr&lt;_WKRemoteWebInspectorProxyClient&gt; m_remoteInspectorClient;
+}
+
+- (instancetype)init
+{
+    if (!(self = [super init]))
+        return nil;
+
+    m_remoteInspectorProxy = RemoteWebInspectorProxy::create();
+    m_remoteInspectorClient = std::make_unique&lt;_WKRemoteWebInspectorProxyClient&gt;(self);
+    m_remoteInspectorProxy-&gt;setClient(m_remoteInspectorClient.get());
+
+    return self;
+}
+
+- (NSWindow *)window
+{
+    return m_remoteInspectorProxy-&gt;window();
+}
+
+- (WKWebView *)webView
+{
+    return m_remoteInspectorProxy-&gt;webView();
+}
+
+static String debuggableTypeString(WKRemoteWebInspectorDebuggableType debuggableType)
+{
+    switch (debuggableType) {
+    case WKRemoteWebInspectorDebuggableTypeJavaScript:
+        return ASCIILiteral(&quot;javascript&quot;);
+    case WKRemoteWebInspectorDebuggableTypeWeb:
+        return ASCIILiteral(&quot;web&quot;);
+    }
+}
+
+- (void)loadForDebuggableType:(WKRemoteWebInspectorDebuggableType)debuggableType backendCommandsURL:(NSURL *)backendCommandsURL
+{
+    m_remoteInspectorProxy-&gt;load(debuggableTypeString(debuggableType), backendCommandsURL.absoluteString);
+}
+
+- (void)close
+{
+    m_remoteInspectorProxy-&gt;closeFromBackend();
+}
+
+- (void)show
+{
+    m_remoteInspectorProxy-&gt;show();
+}
+
+- (void)sendMessageToFrontend:(NSString *)message
+{
+    m_remoteInspectorProxy-&gt;sendMessageToFrontend(message);
+}
+
+- (void)sendMessageToBackend:(NSString *)message
+{
+    if (_delegate &amp;&amp; [_delegate respondsToSelector:@selector(inspectorViewController:sendMessageToBackend:)])
+        [_delegate inspectorViewController:self sendMessageToBackend:message];
+}
+
+- (void)closeFromFrontend
+{
+    if (_delegate &amp;&amp; [_delegate respondsToSelector:@selector(inspectorViewControllerInspectorDidClose:)])
+        [_delegate inspectorViewControllerInspectorDidClose:self];
+}
+
+@end
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessRemoteWebInspectorProxycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.cpp (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,163 @@
</span><ins>+/*
+ * 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 &quot;config.h&quot;
+#include &quot;RemoteWebInspectorProxy.h&quot;
+
+#include &quot;RemoteWebInspectorProxyMessages.h&quot;
+#include &quot;RemoteWebInspectorUIMessages.h&quot;
+#include &quot;WebInspectorProxy.h&quot;
+#include &quot;WebPageGroup.h&quot;
+#include &quot;WebPageProxy.h&quot;
+#include &lt;WebCore/NotImplemented.h&gt;
+
+using namespace WebCore;
+
+namespace WebKit {
+
+RemoteWebInspectorProxy::RemoteWebInspectorProxy()
+{
+}
+
+RemoteWebInspectorProxy::~RemoteWebInspectorProxy()
+{
+    ASSERT(!m_inspectorPage);
+}
+
+void RemoteWebInspectorProxy::invalidate()
+{
+    closeFrontendPageAndWindow();
+}
+
+void RemoteWebInspectorProxy::load(const String&amp; debuggableType, const String&amp; backendCommandsURL)
+{
+    createFrontendPageAndWindow();
+
+    m_inspectorPage-&gt;process().send(Messages::RemoteWebInspectorUI::Initialize(debuggableType, backendCommandsURL), m_inspectorPage-&gt;pageID());
+    m_inspectorPage-&gt;loadRequest(URL(URL(), WebInspectorProxy::inspectorPageURL()));
+}
+
+void RemoteWebInspectorProxy::closeFromBackend()
+{
+    closeFrontendPageAndWindow();
+}
+
+void RemoteWebInspectorProxy::closeFromCrash()
+{
+    // Behave as if the frontend just closed, so clients are informed the frontend is gone.
+    frontendDidClose();
+}
+
+void RemoteWebInspectorProxy::show()
+{
+    bringToFront();
+}
+
+void RemoteWebInspectorProxy::sendMessageToFrontend(const String&amp; message)
+{
+    m_inspectorPage-&gt;process().send(Messages::RemoteWebInspectorUI::SendMessageToFrontend(message), m_inspectorPage-&gt;pageID());
+}
+
+void RemoteWebInspectorProxy::frontendDidClose()
+{
+    if (m_client)
+        m_client-&gt;closeFromFrontend();
+
+    closeFrontendPageAndWindow();
+}
+
+void RemoteWebInspectorProxy::bringToFront()
+{
+    platformBringToFront();
+}
+
+void RemoteWebInspectorProxy::save(const String&amp; suggestedURL, const String&amp; content, bool base64Encoded, bool forceSaveDialog)
+{
+    platformSave(suggestedURL, content, base64Encoded, forceSaveDialog);
+}
+
+void RemoteWebInspectorProxy::append(const String&amp; suggestedURL, const String&amp; content)
+{
+    platformAppend(suggestedURL, content);
+}
+
+void RemoteWebInspectorProxy::startWindowDrag()
+{
+    platformStartWindowDrag();
+}
+
+void RemoteWebInspectorProxy::openInNewTab(const String&amp; url)
+{
+    platformOpenInNewTab(url);
+}
+
+void RemoteWebInspectorProxy::sendMessageToBackend(const String&amp; message)
+{
+    if (m_client)
+        m_client-&gt;sendMessageToBackend(message);
+}
+
+void RemoteWebInspectorProxy::createFrontendPageAndWindow()
+{
+    if (m_inspectorPage)
+        return;
+
+    m_inspectorPage = platformCreateFrontendPageAndWindow();
+
+    trackInspectorPage(m_inspectorPage);
+
+    m_inspectorPage-&gt;process().addMessageReceiver(Messages::RemoteWebInspectorProxy::messageReceiverName(), m_inspectorPage-&gt;pageID(), *this);
+}
+
+void RemoteWebInspectorProxy::closeFrontendPageAndWindow()
+{
+    if (!m_inspectorPage)
+        return;
+
+    m_inspectorPage-&gt;process().removeMessageReceiver(Messages::RemoteWebInspectorProxy::messageReceiverName(), m_inspectorPage-&gt;pageID());
+
+    untrackInspectorPage(m_inspectorPage);
+
+    m_inspectorPage = nullptr;
+
+    platformCloseFrontendPageAndWindow();
+}
+
+#if !PLATFORM(MAC)
+WebPageProxy* RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow()
+{
+    notImplemented();
+    return nullptr;
+}
+
+void RemoteWebInspectorProxy::platformBringToFront() { }
+void RemoteWebInspectorProxy::platformSave(const String&amp;, const String&amp;, bool, bool) { }
+void RemoteWebInspectorProxy::platformAppend(const String&amp;, const String&amp;) { }
+void RemoteWebInspectorProxy::platformStartWindowDrag() { }
+void RemoteWebInspectorProxy::platformOpenInNewTab(const String&amp;) { }
+void RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow() { }
+#endif
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessRemoteWebInspectorProxyh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.h (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+/*
+ * 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
+
+#include &quot;APIObject.h&quot;
+#include &quot;MessageReceiver.h&quot;
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+#if PLATFORM(MAC)
+OBJC_CLASS NSURL;
+OBJC_CLASS NSWindow;
+OBJC_CLASS WKRemoteWebInspectorProxyObjCAdapter;
+OBJC_CLASS WKWebInspectorWKWebView;
+#endif
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class RemoteWebInspectorProxyClient {
+public:
+    virtual ~RemoteWebInspectorProxyClient() { }
+    virtual void sendMessageToBackend(const String&amp; message) = 0;
+    virtual void closeFromFrontend() = 0;
+};
+
+class RemoteWebInspectorProxy : public RefCounted&lt;RemoteWebInspectorProxy&gt;, public IPC::MessageReceiver {
+public:
+    static Ref&lt;RemoteWebInspectorProxy&gt; create()
+    {
+        return adoptRef(*new RemoteWebInspectorProxy());
+    }
+
+    ~RemoteWebInspectorProxy();
+
+    void setClient(RemoteWebInspectorProxyClient* client) { m_client = client; }
+
+    void invalidate();
+
+    void load(const String&amp; debuggableType, const String&amp; backendCommandsURL);
+    void closeFromBackend();
+    void show();
+
+    void sendMessageToFrontend(const String&amp; message);
+
+#if PLATFORM(MAC)
+    NSWindow *window() const { return m_window.get(); }
+    WKWebInspectorWKWebView *webView() const { return m_webView.get(); }
+#endif
+
+    void closeFromCrash();
+
+private:
+    RemoteWebInspectorProxy();
+
+    // IPC::MessageReceiver
+    void didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) override;
+
+    // RemoteWebInspectorProxy messages.
+    void frontendDidClose();
+    void bringToFront();
+    void save(const String&amp; filename, const String&amp; content, bool base64Encoded, bool forceSaveAs);
+    void append(const String&amp; filename, const String&amp; content);
+    void startWindowDrag();
+    void openInNewTab(const String&amp; url);
+    void sendMessageToBackend(const String&amp; message);
+
+    void createFrontendPageAndWindow();
+    void closeFrontendPageAndWindow();
+
+    // Platform implementations.
+    WebPageProxy* platformCreateFrontendPageAndWindow();
+    void platformCloseFrontendPageAndWindow();
+    void platformBringToFront();
+    void platformSave(const String&amp; filename, const String&amp; content, bool base64Encoded, bool forceSaveAs);
+    void platformAppend(const String&amp; filename, const String&amp; content);
+    void platformStartWindowDrag();
+    void platformOpenInNewTab(const String&amp; url);
+
+    RemoteWebInspectorProxyClient* m_client { nullptr };
+    WebPageProxy* m_inspectorPage { nullptr };
+
+#if PLATFORM(MAC)
+    RetainPtr&lt;WKWebInspectorWKWebView&gt; m_webView;
+    RetainPtr&lt;NSWindow&gt; m_window;
+    RetainPtr&lt;WKRemoteWebInspectorProxyObjCAdapter&gt; m_objCAdapter;
+    HashMap&lt;String, RetainPtr&lt;NSURL&gt;&gt; m_suggestedToActualURLMap;
+#endif
+};
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessRemoteWebInspectorProxymessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.messages.in (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/RemoteWebInspectorProxy.messages.in        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+# 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.
+
+messages -&gt; RemoteWebInspectorProxy {
+    FrontendDidClose()
+    BringToFront()
+
+    Save(String filename, String content, bool base64Encoded, bool forceSaveAs)
+    Append(String filename, String content)
+
+    StartWindowDrag()
+
+    OpenInNewTab(String url)
+
+    SendMessageToBackend(String message)
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebInspectorProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -60,14 +60,6 @@
</span><span class="cx"> const unsigned WebInspectorProxy::initialWindowWidth = 1000;
</span><span class="cx"> const unsigned WebInspectorProxy::initialWindowHeight = 650;
</span><span class="cx"> 
</span><del>-typedef HashMap&lt;WebPageProxy*, unsigned&gt; PageLevelMap;
-
-static PageLevelMap&amp; pageLevelMap()
-{
-    static NeverDestroyed&lt;PageLevelMap&gt; map;
-    return map;
-}
-
</del><span class="cx"> WebInspectorProxy::WebInspectorProxy(WebPageProxy* inspectedPage)
</span><span class="cx">     : m_inspectedPage(inspectedPage)
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; WK_API_ENABLED
</span><span class="lines">@@ -83,18 +75,9 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned WebInspectorProxy::inspectionLevel() const
</span><span class="cx"> {
</span><del>-    auto findResult = pageLevelMap().find(inspectedPage());
-    if (findResult != pageLevelMap().end())
-        return findResult-&gt;value + 1;
-
-    return 1;
</del><ins>+    return inspectorLevelForPage(inspectedPage());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-String WebInspectorProxy::inspectorPageGroupIdentifier() const
-{
-    return String::format(&quot;__WebInspectorPageGroupLevel%u__&quot;, inspectionLevel());
-}
-
</del><span class="cx"> WebPreferences&amp; WebInspectorProxy::inspectorPagePreferences() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_inspectorPage);
</span><span class="lines">@@ -113,7 +96,6 @@
</span><span class="cx">     didClose();
</span><span class="cx">     platformInvalidate();
</span><span class="cx"> 
</span><del>-    pageLevelMap().remove(m_inspectedPage);
</del><span class="cx">     m_inspectedPage = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -317,38 +299,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static WebProcessPool* s_mainInspectorProcessPool;
-static WebProcessPool* s_nestedInspectorProcessPool;
-
-WebProcessPool&amp; WebInspectorProxy::inspectorProcessPool(unsigned inspectionLevel)
</del><ins>+bool WebInspectorProxy::isMainOrTestInspectorPage(const URL&amp; url)
</ins><span class="cx"> {
</span><del>-    // Having our own process pool removes us from the main process pool and
-    // guarantees no process sharing for our user interface.
-    WebProcessPool*&amp; pool = inspectionLevel == 1 ? s_mainInspectorProcessPool : s_nestedInspectorProcessPool;
-    if (!pool) {
-        auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
-        pool = &amp;WebProcessPool::create(configuration.get()).leakRef();
-    }
-    return *pool;
-}
-
-bool WebInspectorProxy::isInspectorProcessPool(WebProcessPool&amp; processPool)
-{
-    return (s_mainInspectorProcessPool &amp;&amp; s_mainInspectorProcessPool == &amp;processPool)
-        || (s_nestedInspectorProcessPool &amp;&amp; s_nestedInspectorProcessPool == &amp;processPool);
-}
-
-bool WebInspectorProxy::isInspectorPage(WebPageProxy&amp; webPage)
-{
-    return pageLevelMap().contains(&amp;webPage);
-}
-
-static bool isMainOrTestInspectorPage(WebCore::ResourceRequest&amp; request)
-{
</del><span class="cx">     // Use URL so we can compare the paths and protocols.
</span><del>-    const URL&amp; requestURL = request.url();
</del><span class="cx">     URL mainPageURL(URL(), WebInspectorProxy::inspectorPageURL());
</span><del>-    if (requestURL.protocol() == mainPageURL.protocol() &amp;&amp; decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(mainPageURL.path()))
</del><ins>+    if (url.protocol() == mainPageURL.protocol() &amp;&amp; decodeURLEscapeSequences(url.path()) == decodeURLEscapeSequences(mainPageURL.path()))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     // We might not have a Test URL in Production builds.
</span><span class="lines">@@ -357,7 +312,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     URL testPageURL(URL(), testPageURLString);
</span><del>-    return requestURL.protocol() == testPageURL.protocol() &amp;&amp; decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(testPageURL.path());
</del><ins>+    return url.protocol() == testPageURL.protocol() &amp;&amp; decodeURLEscapeSequences(url.path()) == decodeURLEscapeSequences(testPageURL.path());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void webProcessDidCrash(WKPageRef, const void* clientInfo)
</span><span class="lines">@@ -382,7 +337,7 @@
</span><span class="cx">     WebCore::ResourceRequest request = toImpl(navigationActionRef)-&gt;request();
</span><span class="cx"> 
</span><span class="cx">     // Allow loading of the main inspector file.
</span><del>-    if (isMainOrTestInspectorPage(request)) {
</del><ins>+    if (WebInspectorProxy::isMainOrTestInspectorPage(request.url())) {
</ins><span class="cx">         toImpl(listenerRef)-&gt;use();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -451,7 +406,7 @@
</span><span class="cx">     if (!m_inspectorPage)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    pageLevelMap().set(m_inspectorPage, inspectionLevel());
</del><ins>+    trackInspectorPage(m_inspectorPage);
</ins><span class="cx"> 
</span><span class="cx">     WKPageNavigationClientV0 navigationClient = {
</span><span class="cx">         { 0, this },
</span><span class="lines">@@ -563,6 +518,8 @@
</span><span class="cx">     m_showMessageSent = false;
</span><span class="cx">     m_ignoreFirstBringToFront = false;
</span><span class="cx"> 
</span><ins>+    untrackInspectorPage(m_inspectorPage);
+
</ins><span class="cx">     m_inspectorPage-&gt;process().send(Messages::WebInspectorUI::SetIsVisible(m_isVisible), m_inspectorPage-&gt;pageID());
</span><span class="cx">     m_inspectorPage-&gt;process().removeMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage-&gt;pageID());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebInspectorProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;APIObject.h&quot;
</span><span class="cx"> #include &quot;Attachment.h&quot;
</span><span class="cx"> #include &quot;MessageReceiver.h&quot;
</span><ins>+#include &quot;WebInspectorUtilities.h&quot;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -36,6 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #include &quot;WKGeometry.h&quot;
</span><ins>+#include &lt;WebCore/IntRect.h&gt;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="lines">@@ -45,6 +47,7 @@
</span><span class="cx"> OBJC_CLASS NSWindow;
</span><span class="cx"> OBJC_CLASS WKWebInspectorProxyObjCAdapter;
</span><span class="cx"> OBJC_CLASS WKWebInspectorWKWebView;
</span><ins>+OBJC_CLASS WKWebViewConfiguration;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="lines">@@ -56,12 +59,15 @@
</span><span class="cx"> #include &lt;Evas.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+namespace WebCore {
+class URL;
+}
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class WebFrameProxy;
</span><span class="cx"> class WebPageProxy;
</span><span class="cx"> class WebPreferences;
</span><del>-class WebProcessPool;
</del><span class="cx"> 
</span><span class="cx"> enum class AttachmentSide {
</span><span class="cx">     Bottom,
</span><span class="lines">@@ -93,6 +99,9 @@
</span><span class="cx">     void close();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; WK_API_ENABLED
</span><ins>+    static RetainPtr&lt;WKWebViewConfiguration&gt; createFrontendConfiguration(WebPageProxy*, bool underTest);
+    static RetainPtr&lt;NSWindow&gt; createFrontendWindow(NSRect savedWindowFrame);
+
</ins><span class="cx">     void createInspectorWindow();
</span><span class="cx">     void updateInspectorWindowTitle() const;
</span><span class="cx">     void inspectedViewFrameDidChange(CGFloat = 0);
</span><span class="lines">@@ -136,13 +145,11 @@
</span><span class="cx">     bool isElementSelectionActive() const { return m_elementSelectionActive; }
</span><span class="cx">     void toggleElementSelection();
</span><span class="cx"> 
</span><del>-    static bool isInspectorProcessPool(WebProcessPool&amp;);
-    static bool isInspectorPage(WebPageProxy&amp;);
-
</del><span class="cx">     // Provided by platform WebInspectorProxy implementations.
</span><span class="cx">     static String inspectorPageURL();
</span><span class="cx">     static String inspectorTestPageURL();
</span><span class="cx">     static String inspectorBaseURL();
</span><ins>+    static bool isMainOrTestInspectorPage(const WebCore::URL&amp;);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR_SERVER)
</span><span class="cx">     void enableRemoteInspection();
</span><span class="lines">@@ -152,11 +159,15 @@
</span><span class="cx">     int remoteInspectionPageID() const { return m_remoteInspectionPageId; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    static const unsigned minimumWindowWidth;
+    static const unsigned minimumWindowHeight;
+
+    static const unsigned initialWindowWidth;
+    static const unsigned initialWindowHeight;
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit WebInspectorProxy(WebPageProxy*);
</span><span class="cx"> 
</span><del>-    static WebProcessPool&amp; inspectorProcessPool(unsigned inspectionLevel);
-
</del><span class="cx">     void eagerlyCreateInspectorPage();
</span><span class="cx"> 
</span><span class="cx">     // IPC::MessageReceiver
</span><span class="lines">@@ -210,11 +221,8 @@
</span><span class="cx"> 
</span><span class="cx">     void open();
</span><span class="cx"> 
</span><del>-    // The inspection level is used to give different preferences to each inspector
-    // by setting a per-level page group identifier. Local storage settings in the frontend
-    // also use the inspection level in the key prefix to disambiguate persistent view state.
</del><span class="cx">     unsigned inspectionLevel() const;
</span><del>-    String inspectorPageGroupIdentifier() const;
</del><ins>+
</ins><span class="cx">     WebPreferences&amp; inspectorPagePreferences() const;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK) || PLATFORM(EFL)
</span><span class="lines">@@ -225,12 +233,6 @@
</span><span class="cx">     void updateInspectorWindowTitle() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    static const unsigned minimumWindowWidth;
-    static const unsigned minimumWindowHeight;
-
-    static const unsigned initialWindowWidth;
-    static const unsigned initialWindowHeight;
-
</del><span class="cx">     WebPageProxy* m_inspectedPage { nullptr };
</span><span class="cx">     WebPageProxy* m_inspectorPage { nullptr };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebInspectorUtilitiescpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.cpp (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+/*
+ * 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 &quot;config.h&quot;
+#include &quot;WebInspectorUtilities.h&quot;
+
+#include &quot;APIProcessPoolConfiguration.h&quot;
+#include &quot;WebPageGroup.h&quot;
+#include &quot;WebPageProxy.h&quot;
+#include &quot;WebProcessPool.h&quot;
+#include &quot;WebProcessProxy.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+
+namespace WebKit {
+
+typedef HashMap&lt;WebPageProxy*, unsigned&gt; PageLevelMap;
+
+static PageLevelMap&amp; pageLevelMap()
+{
+    static NeverDestroyed&lt;PageLevelMap&gt; map;
+    return map;
+}
+
+unsigned inspectorLevelForPage(WebPageProxy* page)
+{
+    if (page) {
+        auto findResult = pageLevelMap().find(page);
+        if (findResult != pageLevelMap().end())
+            return findResult-&gt;value + 1;
+    }
+
+    return 1;
+}
+
+String inspectorPageGroupIdentifierForPage(WebPageProxy* page)
+{
+    return String::format(&quot;__WebInspectorPageGroupLevel%u__&quot;, inspectorLevelForPage(page));
+}
+
+void trackInspectorPage(WebPageProxy* page)
+{
+    pageLevelMap().set(page, inspectorLevelForPage(page));
+}
+
+void untrackInspectorPage(WebPageProxy* page)
+{
+    pageLevelMap().remove(page);
+}
+
+static WebProcessPool* s_mainInspectorProcessPool;
+static WebProcessPool* s_nestedInspectorProcessPool;
+
+WebProcessPool&amp; inspectorProcessPool(unsigned inspectionLevel)
+{
+    // Having our own process pool removes us from the main process pool and
+    // guarantees no process sharing for our user interface.
+    WebProcessPool*&amp; pool = (inspectionLevel == 1) ? s_mainInspectorProcessPool : s_nestedInspectorProcessPool;
+    if (!pool) {
+        auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
+        pool = &amp;WebProcessPool::create(configuration.get()).leakRef();
+    }
+    return *pool;
+}
+
+bool isInspectorProcessPool(WebProcessPool&amp; processPool)
+{
+    return (s_mainInspectorProcessPool &amp;&amp; s_mainInspectorProcessPool == &amp;processPool)
+        || (s_nestedInspectorProcessPool &amp;&amp; s_nestedInspectorProcessPool == &amp;processPool);
+}
+
+bool isInspectorPage(WebPageProxy&amp; webPage)
+{
+    return pageLevelMap().contains(&amp;webPage);
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebInspectorUtilitieshfromrev205368trunkSourceWebKit2WebProcessWebPageeflWebInspectorUIEflcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.h (from rev 205368, trunk/Source/WebKit2/WebProcess/WebPage/efl/WebInspectorUIEfl.cpp) (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorUtilities.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * 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
+
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebKit {
+
+class WebPageProxy;
+class WebProcessPool;
+
+// The inspector page groups are used to give different preferences to each
+// inspector level by setting a per-level page group identifier.
+unsigned inspectorLevelForPage(WebPageProxy*);
+String inspectorPageGroupIdentifierForPage(WebPageProxy*);
+void trackInspectorPage(WebPageProxy*);
+void untrackInspectorPage(WebPageProxy*);
+
+WebProcessPool&amp; inspectorProcessPool(unsigned inspectionLevel);
+bool isInspectorProcessPool(WebProcessPool&amp;);
+bool isInspectorPage(WebPageProxy&amp;);
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> #include &quot;WebFullScreenManagerProxyMessages.h&quot;
</span><span class="cx"> #include &quot;WebImage.h&quot;
</span><span class="cx"> #include &quot;WebInspectorProxy.h&quot;
</span><del>-#include &quot;WebInspectorProxyMessages.h&quot;
</del><ins>+#include &quot;WebInspectorUtilities.h&quot;
</ins><span class="cx"> #include &quot;WebNavigationState.h&quot;
</span><span class="cx"> #include &quot;WebNotificationManagerProxy.h&quot;
</span><span class="cx"> #include &quot;WebOpenPanelResultListenerProxy.h&quot;
</span><span class="lines">@@ -905,7 +905,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // Inspector resources are in a directory with assumed access.
</span><del>-    ASSERT_WITH_SECURITY_IMPLICATION(!WebInspectorProxy::isInspectorPage(*this));
</del><ins>+    ASSERT_WITH_SECURITY_IMPLICATION(!WebKit::isInspectorPage(*this));
</ins><span class="cx"> 
</span><span class="cx">     SandboxExtension::createHandle(&quot;/&quot;, SandboxExtension::ReadOnly, sandboxExtensionHandle);
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> #include &quot;UserData.h&quot;
</span><span class="cx"> #include &quot;WebBackForwardListItem.h&quot;
</span><span class="cx"> #include &quot;WebIconDatabase.h&quot;
</span><del>-#include &quot;WebInspectorProxy.h&quot;
</del><ins>+#include &quot;WebInspectorUtilities.h&quot;
</ins><span class="cx"> #include &quot;WebNavigationDataStore.h&quot;
</span><span class="cx"> #include &quot;WebNotificationManagerProxy.h&quot;
</span><span class="cx"> #include &quot;WebPageGroup.h&quot;
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> 
</span><span class="cx">     ChildProcessProxy::getLaunchOptions(launchOptions);
</span><span class="cx"> 
</span><del>-    if (WebInspectorProxy::isInspectorProcessPool(m_processPool))
</del><ins>+    if (WebKit::isInspectorProcessPool(m_processPool))
</ins><span class="cx">         launchOptions.extraInitializationData.add(ASCIILiteral(&quot;inspector-process&quot;), ASCIILiteral(&quot;1&quot;));
</span><span class="cx"> 
</span><span class="cx">     auto overrideLanguages = m_processPool-&gt;configuration().overrideLanguages();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflWebInspectorProxyEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     WKContextRef wkContext = toAPI(&amp;inspectorProcessPool(inspectionLevel()));
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; wkGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString(inspectorPageGroupIdentifier().utf8().data()));
</del><ins>+    WKRetainPtr&lt;WKStringRef&gt; wkGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString(inspectorPageGroupIdentifierForPage(inspectedPage()).utf8().data()));
</ins><span class="cx">     WKPageGroupRef wkPageGroup = WKPageGroupCreateWithIdentifier(wkGroupIdentifier.get());
</span><span class="cx"> 
</span><span class="cx">     WKRetainPtr&lt;WKPageConfigurationRef&gt; wkPageConfiguration = adoptWK(WKPageConfigurationCreate());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebInspectorProxyGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     preferences-&gt;setJavaScriptRuntimeFlags({
</span><span class="cx">     });
</span><del>-    RefPtr&lt;WebPageGroup&gt; pageGroup = WebPageGroup::create(inspectorPageGroupIdentifier(), false, false);
</del><ins>+    RefPtr&lt;WebPageGroup&gt; pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(inspectedPage()), false, false);
</ins><span class="cx"> 
</span><span class="cx">     auto pageConfiguration = API::PageConfiguration::create();
</span><span class="cx">     pageConfiguration-&gt;setProcessPool(&amp;inspectorProcessPool(inspectionLevel()));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteWebInspectorProxyMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteWebInspectorProxyMac.mm        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,231 @@
</span><ins>+/*
+ * Copyright (C) 2010-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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;RemoteWebInspectorProxy.h&quot;
+
+#if PLATFORM(MAC) &amp;&amp; WK_API_ENABLED
+
+#import &quot;RemoteWebInspectorProxyMessages.h&quot;
+#import &quot;RemoteWebInspectorUIMessages.h&quot;
+#import &quot;WKFrameInfo.h&quot;
+#import &quot;WKNavigationAction.h&quot;
+#import &quot;WKNavigationDelegate.h&quot;
+#import &quot;WKWebInspectorWKWebView.h&quot;
+#import &quot;WKWebViewInternal.h&quot;
+#import &quot;WebInspectorProxy.h&quot;
+#import &quot;WebPageGroup.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &lt;wtf/text/Base64.h&gt;
+
+using namespace WebKit;
+
+@interface WKRemoteWebInspectorProxyObjCAdapter : NSObject &lt;WKNavigationDelegate&gt; {
+    RemoteWebInspectorProxy* _inspectorProxy;
+}
+- (instancetype)initWithRemoteWebInspectorProxy:(RemoteWebInspectorProxy*)inspectorProxy;
+@end
+
+@implementation WKRemoteWebInspectorProxyObjCAdapter
+
+- (instancetype)initWithRemoteWebInspectorProxy:(RemoteWebInspectorProxy*)inspectorProxy
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _inspectorProxy = inspectorProxy;
+
+    return self;
+}
+
+- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
+{
+    _inspectorProxy-&gt;closeFromCrash();
+}
+
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
+{
+    // Allow non-main frames to navigate anywhere.
+    if (!navigationAction.targetFrame.isMainFrame) {
+        decisionHandler(WKNavigationActionPolicyAllow);
+        return;
+    }
+
+    // Allow loading of the main inspector file.
+    if (WebInspectorProxy::isMainOrTestInspectorPage(navigationAction.request.URL)) {
+        decisionHandler(WKNavigationActionPolicyAllow);
+        return;
+    }
+
+    // Prevent everything else.
+    decisionHandler(WKNavigationActionPolicyCancel);
+}
+
+@end
+
+namespace WebKit {
+
+WebPageProxy* RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow()
+{
+    NSRect initialFrame = NSMakeRect(0, 0, WebInspectorProxy::initialWindowWidth, WebInspectorProxy::initialWindowHeight);
+    auto configuration = WebInspectorProxy::createFrontendConfiguration(nullptr, false);
+
+    m_objCAdapter = adoptNS([[WKRemoteWebInspectorProxyObjCAdapter alloc] initWithRemoteWebInspectorProxy:this]);
+
+    m_webView = adoptNS([[WKWebInspectorWKWebView alloc] initWithFrame:initialFrame configuration:configuration.get()]);
+    [m_webView setNavigationDelegate:m_objCAdapter.get()];
+
+    m_window = WebInspectorProxy::createFrontendWindow(NSZeroRect);
+
+    NSView *contentView = [m_window contentView];
+    [m_webView setFrame:[contentView bounds]];
+    [m_webView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+    [contentView addSubview:m_webView.get()];
+
+    return m_webView-&gt;_page.get();
+}
+
+void RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow()
+{
+    if (m_window) {
+        [m_window setDelegate:nil];
+        [m_window close];
+        m_window = nil;
+    }
+
+    if (m_webView) {
+        WebPageProxy* inspectorPage = m_webView-&gt;_page.get();
+        inspectorPage-&gt;close();
+        [m_webView setNavigationDelegate:nil];
+        m_webView = nil;
+    }
+
+    if (m_objCAdapter)
+        m_objCAdapter = nil;
+}
+
+
+void RemoteWebInspectorProxy::platformBringToFront()
+{
+    [m_window makeKeyAndOrderFront:nil];
+    [m_window makeFirstResponder:m_webView.get()];
+}
+
+void RemoteWebInspectorProxy::platformSave(const String&amp; suggestedURL, const String&amp; content, bool base64Encoded, bool forceSaveDialog)
+{
+    // FIXME: Share with WebInspectorProxyMac.
+
+    ASSERT(!suggestedURL.isEmpty());
+    
+    NSURL *platformURL = m_suggestedToActualURLMap.get(suggestedURL).get();
+    if (!platformURL) {
+        platformURL = [NSURL URLWithString:suggestedURL];
+        // The user must confirm new filenames before we can save to them.
+        forceSaveDialog = true;
+    }
+    
+    ASSERT(platformURL);
+    if (!platformURL)
+        return;
+
+    // Necessary for the block below.
+    String suggestedURLCopy = suggestedURL;
+    String contentCopy = content;
+
+    auto saveToURL = ^(NSURL *actualURL) {
+        ASSERT(actualURL);
+
+        m_suggestedToActualURLMap.set(suggestedURLCopy, actualURL);
+
+        if (base64Encoded) {
+            Vector&lt;char&gt; out;
+            if (!base64Decode(contentCopy, out, Base64ValidatePadding))
+                return;
+            RetainPtr&lt;NSData&gt; dataContent = adoptNS([[NSData alloc] initWithBytes:out.data() length:out.size()]);
+            [dataContent writeToURL:actualURL atomically:YES];
+        } else
+            [contentCopy writeToURL:actualURL atomically:YES encoding:NSUTF8StringEncoding error:NULL];
+
+        WebPageProxy* inspectorPage = m_webView-&gt;_page.get();
+        inspectorPage-&gt;process().send(Messages::RemoteWebInspectorUI::DidSave([actualURL absoluteString]), inspectorPage-&gt;pageID());
+    };
+
+    if (!forceSaveDialog) {
+        saveToURL(platformURL);
+        return;
+    }
+
+    NSSavePanel *panel = [NSSavePanel savePanel];
+    panel.nameFieldStringValue = platformURL.lastPathComponent;
+    panel.directoryURL = [platformURL URLByDeletingLastPathComponent];
+
+    auto completionHandler = ^(NSInteger result) {
+        if (result == NSFileHandlingPanelCancelButton)
+            return;
+        ASSERT(result == NSFileHandlingPanelOKButton);
+        saveToURL(panel.URL);
+    };
+
+    if (m_window)
+        [panel beginSheetModalForWindow:m_window.get() completionHandler:completionHandler];
+    else
+        completionHandler([panel runModal]);
+}
+
+void RemoteWebInspectorProxy::platformAppend(const String&amp; suggestedURL, const String&amp; content)
+{
+    // FIXME: Share with WebInspectorProxyMac.
+
+    ASSERT(!suggestedURL.isEmpty());
+    
+    RetainPtr&lt;NSURL&gt; actualURL = m_suggestedToActualURLMap.get(suggestedURL);
+    // Do not append unless the user has already confirmed this filename in save().
+    if (!actualURL)
+        return;
+
+    NSFileHandle *handle = [NSFileHandle fileHandleForWritingToURL:actualURL.get() error:NULL];
+    [handle seekToEndOfFile];
+    [handle writeData:[content dataUsingEncoding:NSUTF8StringEncoding]];
+    [handle closeFile];
+
+    WebPageProxy* inspectorPage = m_webView-&gt;_page.get();
+    inspectorPage-&gt;process().send(Messages::RemoteWebInspectorUI::DidAppend([actualURL absoluteString]), inspectorPage-&gt;pageID());
+}
+
+void RemoteWebInspectorProxy::platformStartWindowDrag()
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
+    m_webView-&gt;_page-&gt;startWindowDrag();
+#endif
+}
+
+void RemoteWebInspectorProxy::platformOpenInNewTab(const String&amp; url)
+{
+    [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
+}
+
+} // namespace WebKit
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKWebInspectorWKWebViewhfromrev205368trunkSourceWebKit2WebProcessWebPageeflWebInspectorUIEflcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.h (from rev 205368, trunk/Source/WebKit2/WebProcess/WebPage/efl/WebInspectorUIEfl.cpp) (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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
+
+#import &lt;WebKit/WKWebView.h&gt;
+
+#if PLATFORM(MAC) &amp;&amp; WK_API_ENABLED
+
+@interface WKWebInspectorWKWebView : WKWebView
+
+- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKWebInspectorWKWebViewmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/WKWebInspectorWKWebView.mm        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,179 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WKWebInspectorWKWebView.h&quot;
+
+#if PLATFORM(MAC) &amp;&amp; WK_API_ENABLED
+
+#import &quot;WKAPICast.h&quot;
+#import &quot;WKInspectorPrivateMac.h&quot;
+#import &quot;WKMutableArray.h&quot;
+#import &quot;WKOpenPanelParametersRef.h&quot;
+#import &quot;WKOpenPanelResultListener.h&quot;
+#import &quot;WKRetainPtr.h&quot;
+#import &quot;WKURLCF.h&quot;
+#import &quot;WKWebViewInternal.h&quot;
+#import &quot;WebPageProxy.h&quot;
+
+using namespace WebKit;
+
+namespace WebKit {
+
+static WKRect getWindowFrame(WKPageRef, const void* clientInfo)
+{
+    WKWebInspectorWKWebView *inspectorWKWebView = static_cast&lt;WKWebInspectorWKWebView *&gt;(const_cast&lt;void*&gt;(clientInfo));
+    ASSERT(inspectorWKWebView);
+
+    if (!inspectorWKWebView.window)
+        return WKRectMake(0, 0, 0, 0);
+
+    NSRect frame = inspectorWKWebView.frame;
+    return WKRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
+}
+
+static void setWindowFrame(WKPageRef, WKRect frame, const void* clientInfo)
+{
+    WKWebInspectorWKWebView *inspectorWKWebView = static_cast&lt;WKWebInspectorWKWebView *&gt;(const_cast&lt;void*&gt;(clientInfo));
+    ASSERT(inspectorWKWebView);
+
+    if (!inspectorWKWebView.window)
+        return;
+
+    [inspectorWKWebView.window setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height) display:YES];
+}
+
+static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long, unsigned long long, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void*)
+{
+    return std::max&lt;unsigned long long&gt;(expectedUsage, currentDatabaseUsage * 1.25);
+}
+
+static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void* clientInfo)
+{
+    WKWebInspectorWKWebView *inspectorWKWebView = static_cast&lt;WKWebInspectorWKWebView *&gt;(const_cast&lt;void*&gt;(clientInfo));
+    ASSERT(inspectorWKWebView);
+
+    NSOpenPanel *openPanel = [NSOpenPanel openPanel];
+    [openPanel setAllowsMultipleSelection:WKOpenPanelParametersGetAllowsMultipleFiles(parameters)];
+
+    WKRetain(listener);
+
+    auto completionHandler = ^(NSInteger result) {
+        if (result == NSFileHandlingPanelOKButton) {
+            WKRetainPtr&lt;WKMutableArrayRef&gt; fileURLs = adoptWK(WKMutableArrayCreate());
+
+            for (NSURL* nsURL in [openPanel URLs]) {
+                WKRetainPtr&lt;WKURLRef&gt; wkURL = adoptWK(WKURLCreateWithCFURL(reinterpret_cast&lt;CFURLRef&gt;(nsURL)));
+                WKArrayAppendItem(fileURLs.get(), wkURL.get());
+            }
+
+            WKOpenPanelResultListenerChooseFiles(listener, fileURLs.get());
+        } else
+            WKOpenPanelResultListenerCancel(listener);
+
+        WKRelease(listener);
+    };
+
+    if (inspectorWKWebView.window)
+        [openPanel beginSheetModalForWindow:inspectorWKWebView.window completionHandler:completionHandler];
+    else
+        completionHandler([openPanel runModal]);
+}
+
+} // namespace WebKit
+
+@implementation WKWebInspectorWKWebView
+
+- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
+{
+    if (!(self = [super initWithFrame:frame configuration:configuration]))
+        return nil;
+
+    [self _setAutomaticallyAdjustsContentInsets:NO];
+
+    WKPageUIClientV2 uiClient = {
+        { 2, self },
+        0, // createNewPage_deprecatedForUseWithV0
+        0, // showPage
+        0, // closePage
+        0, // takeFocus
+        0, // focus
+        0, // unfocus
+        0, // runJavaScriptAlert
+        0, // runJavaScriptConfirm
+        0, // runJavaScriptPrompt
+        0, // setStatusText
+        0, // mouseDidMoveOverElement_deprecatedForUseWithV0
+        0, // missingPluginButtonClicked_deprecatedForUseWithV0
+        0, // didNotHandleKeyEvent
+        0, // didNotHandleWheelEvent
+        0, // areToolbarsVisible
+        0, // setToolbarsVisible
+        0, // isMenuBarVisible
+        0, // setMenuBarVisible
+        0, // isStatusBarVisible
+        0, // setStatusBarVisible
+        0, // isResizable
+        0, // setResizable
+        getWindowFrame,
+        setWindowFrame,
+        0, // runBeforeUnloadConfirmPanel
+        0, // didDraw
+        0, // pageDidScroll
+        exceededDatabaseQuota,
+        runOpenPanel,
+        0, // decidePolicyForGeolocationPermissionRequest
+        0, // headerHeight
+        0, // footerHeight
+        0, // drawHeader
+        0, // drawFooter
+        0, // printFrame
+        0, // runModal
+        0, // unused
+        0, // saveDataToFileInDownloadsFolder
+        0, // shouldInterruptJavaScript
+        0, // createPage
+        0, // mouseDidMoveOverElement
+        0, // decidePolicyForNotificationPermissionRequest
+        0, // unavailablePluginButtonClicked_deprecatedForUseWithV1
+        0, // showColorPicker
+        0, // hideColorPicker
+        0, // unavailablePluginButtonClicked
+    };
+
+    WebPageProxy* inspectorPage = self-&gt;_page.get();
+    WKPageSetPageUIClient(toAPI(inspectorPage), &amp;uiClient.base);
+
+    return self;
+}
+
+- (NSInteger)tag
+{
+    return WKInspectorViewTag;
+}
+
+@end
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebInspectorProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -28,23 +28,16 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; WK_API_ENABLED
</span><span class="cx"> 
</span><del>-#import &quot;WKAPICast.h&quot;
</del><span class="cx"> #import &quot;WKInspectorPrivateMac.h&quot;
</span><del>-#import &quot;WKMutableArray.h&quot;
-#import &quot;WKOpenPanelParametersRef.h&quot;
-#import &quot;WKOpenPanelResultListener.h&quot;
</del><span class="cx"> #import &quot;WKPreferencesInternal.h&quot;
</span><span class="cx"> #import &quot;WKProcessPoolInternal.h&quot;
</span><del>-#import &quot;WKRetainPtr.h&quot;
-#import &quot;WKURLCF.h&quot;
</del><span class="cx"> #import &quot;WKViewInternal.h&quot;
</span><ins>+#import &quot;WKWebInspectorWKWebView.h&quot;
</ins><span class="cx"> #import &quot;WKWebViewConfigurationPrivate.h&quot;
</span><span class="cx"> #import &quot;WKWebViewInternal.h&quot;
</span><span class="cx"> #import &quot;WebInspectorUIMessages.h&quot;
</span><span class="cx"> #import &quot;WebPageGroup.h&quot;
</span><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><del>-#import &quot;WebPreferences.h&quot;
-#import &quot;WebProcessProxy.h&quot;
</del><span class="cx"> #import &lt;WebCore/InspectorFrontendClientLocal.h&gt;
</span><span class="cx"> #import &lt;WebCore/LocalizedStrings.h&gt;
</span><span class="cx"> #import &lt;WebCore/SoftLinking.h&gt;
</span><span class="lines">@@ -139,83 +132,8 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface WKWebInspectorWKWebView : WKWebView {
-@private
-    WKWebInspectorProxyObjCAdapter *_inspectorProxyObjCAdapter;
-}
-
-@property (nonatomic, assign) WKWebInspectorProxyObjCAdapter *inspectorProxyObjCAdapter;
-@end
-
-@implementation WKWebInspectorWKWebView
-
-@synthesize inspectorProxyObjCAdapter = _inspectorProxyObjCAdapter;
-
-- (NSInteger)tag
-{
-    return WKInspectorViewTag;
-}
-
-@end
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static WKRect getWindowFrame(WKPageRef, const void* clientInfo)
-{
-    WebInspectorProxy* webInspectorProxy = static_cast&lt;WebInspectorProxy*&gt;(const_cast&lt;void*&gt;(clientInfo));
-    ASSERT(webInspectorProxy);
-
-    return webInspectorProxy-&gt;inspectorWindowFrame();
-}
-
-static void setWindowFrame(WKPageRef, WKRect frame, const void* clientInfo)
-{
-    WebInspectorProxy* webInspectorProxy = static_cast&lt;WebInspectorProxy*&gt;(const_cast&lt;void*&gt;(clientInfo));
-    ASSERT(webInspectorProxy);
-
-    webInspectorProxy-&gt;setInspectorWindowFrame(frame);
-}
-
-static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long, unsigned long long, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void*)
-{
-    return std::max&lt;unsigned long long&gt;(expectedUsage, currentDatabaseUsage * 1.25);
-}
-
-static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void* clientInfo)
-{
-    WebInspectorProxy* webInspectorProxy = static_cast&lt;WebInspectorProxy*&gt;(const_cast&lt;void*&gt;(clientInfo));
-    ASSERT(webInspectorProxy);
-
-    NSOpenPanel *openPanel = [NSOpenPanel openPanel];
-    [openPanel setAllowsMultipleSelection:WKOpenPanelParametersGetAllowsMultipleFiles(parameters)];
-
-    WKRetain(listener);
-
-    auto completionHandler = ^(NSInteger result) {
-        if (result == NSFileHandlingPanelOKButton) {
-            WKMutableArrayRef fileURLs = WKMutableArrayCreate();
-
-            for (NSURL* nsURL in [openPanel URLs]) {
-                WKURLRef wkURL = WKURLCreateWithCFURL(reinterpret_cast&lt;CFURLRef&gt;(nsURL));
-                WKArrayAppendItem(fileURLs, wkURL);
-                WKRelease(wkURL);
-            }
-
-            WKOpenPanelResultListenerChooseFiles(listener, fileURLs);
-
-            WKRelease(fileURLs);
-        } else
-            WKOpenPanelResultListenerCancel(listener);
-
-        WKRelease(listener);
-    };
-
-    if (webInspectorProxy-&gt;inspectorWindow())
-        [openPanel beginSheetModalForWindow:webInspectorProxy-&gt;inspectorWindow() completionHandler:completionHandler];
-    else
-        completionHandler([openPanel runModal]);
-}
-
</del><span class="cx"> void WebInspectorProxy::attachmentViewDidChange(NSView *oldView, NSView *newView)
</span><span class="cx"> {
</span><span class="cx">     [[NSNotificationCenter defaultCenter] removeObserver:m_inspectorProxyObjCAdapter.get() name:NSViewFrameDidChangeNotification object:oldView];
</span><span class="lines">@@ -249,7 +167,6 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_inspectorView) {
</span><span class="cx">         m_inspectorView-&gt;_page-&gt;close();
</span><del>-        [m_inspectorView setInspectorProxyObjCAdapter:nil];
</del><span class="cx">         m_inspectorView = nil;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -263,42 +180,72 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_inspectorWindow);
</span><span class="cx"> 
</span><del>-    NSRect windowFrame = NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight);
-
-    // Restore the saved window frame, if there was one.
</del><span class="cx">     NSString *savedWindowFrameString = inspectedPage()-&gt;pageGroup().preferences().inspectorWindowFrame();
</span><span class="cx">     NSRect savedWindowFrame = NSRectFromString(savedWindowFrameString);
</span><del>-    if (!NSIsEmptyRect(savedWindowFrame))
-        windowFrame = savedWindowFrame;
</del><span class="cx"> 
</span><del>-    NSWindow *window = [[NSWindow alloc] initWithContentRect:windowFrame styleMask:windowStyleMask backing:NSBackingStoreBuffered defer:NO];
-    [window setDelegate:m_inspectorProxyObjCAdapter.get()];
</del><ins>+    m_inspectorWindow = WebInspectorProxy::createFrontendWindow(savedWindowFrame);
+    [m_inspectorWindow setDelegate:m_inspectorProxyObjCAdapter.get()];
+
+    NSView *contentView = [m_inspectorWindow contentView];
+    [m_inspectorView setFrame:[contentView bounds]];
+    [m_inspectorView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+    [contentView addSubview:m_inspectorView.get()];
+
+    updateInspectorWindowTitle();
+}
+
+RetainPtr&lt;WKWebViewConfiguration&gt; WebInspectorProxy::createFrontendConfiguration(WebPageProxy* page, bool underTest)
+{
+    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+
+    WKPreferences *preferences = [configuration preferences];
+    preferences._allowFileAccessFromFileURLs = YES;
+    [configuration _setAllowUniversalAccessFromFileURLs:YES];
+    preferences._storageBlockingPolicy = _WKStorageBlockingPolicyAllowAll;
+    preferences._javaScriptRuntimeFlags = 0;
+
+#ifndef NDEBUG
+    // Allow developers to inspect the Web Inspector in debug builds without changing settings.
+    preferences._developerExtrasEnabled = YES;
+    preferences._logsPageMessagesToSystemConsoleEnabled = YES;
+#endif
+
+    if (underTest) {
+        preferences._hiddenPageDOMTimerThrottlingEnabled = NO;
+        preferences._pageVisibilityBasedProcessSuppressionEnabled = NO;
+    }
+
+    unsigned inspectorLevel = inspectorLevelForPage(page);
+    [configuration setProcessPool: ::WebKit::wrapper(inspectorProcessPool(inspectorLevel))];
+    [configuration _setGroupIdentifier:inspectorPageGroupIdentifierForPage(page)];
+
+    return configuration;
+}
+
+RetainPtr&lt;NSWindow&gt; WebInspectorProxy::createFrontendWindow(NSRect savedWindowFrame)
+{
+    NSRect windowFrame = !NSIsEmptyRect(savedWindowFrame) ? savedWindowFrame : NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight);
+
+    auto window = adoptNS([[NSWindow alloc] initWithContentRect:windowFrame styleMask:windowStyleMask backing:NSBackingStoreBuffered defer:NO]);
+    // [window setDelegate:m_inspectorProxyObjCAdapter.get()];
</ins><span class="cx">     [window setMinSize:NSMakeSize(minimumWindowWidth, minimumWindowHeight)];
</span><span class="cx">     [window setReleasedWhenClosed:NO];
</span><span class="cx">     [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)];
</span><span class="cx"> 
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
</span><del>-    CGFloat approximatelyHalfScreenSize = (window.screen.frame.size.width / 2) - 4;
</del><ins>+    CGFloat approximatelyHalfScreenSize = ([window screen].frame.size.width / 2) - 4;
</ins><span class="cx">     CGFloat minimumFullScreenWidth = std::max&lt;CGFloat&gt;(636, approximatelyHalfScreenSize);
</span><span class="cx">     [window setMinFullScreenContentSize:NSMakeSize(minimumFullScreenWidth, minimumWindowHeight)];
</span><span class="cx">     [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenAllowsTiling)];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    window.titlebarAppearsTransparent = YES;
</del><ins>+    [window setTitlebarAppearsTransparent:YES];
</ins><span class="cx"> 
</span><del>-    m_inspectorWindow = adoptNS(window);
-
-    NSView *contentView = [window contentView];
-
-    [m_inspectorView setFrame:[contentView bounds]];
-    [m_inspectorView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    [contentView addSubview:m_inspectorView.get()];
-
</del><span class="cx">     // Center the window if the saved frame was empty.
</span><span class="cx">     if (NSIsEmptyRect(savedWindowFrame))
</span><span class="cx">         [window center];
</span><span class="cx"> 
</span><del>-    updateInspectorWindowTitle();
</del><ins>+    return window;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebInspectorProxy::updateInspectorWindowTitle() const
</span><span class="lines">@@ -353,93 +300,15 @@
</span><span class="cx">             initialRect = [NSWindow contentRectForFrameRect:windowFrame styleMask:windowStyleMask];
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    WKPreferences *preferences = [configuration preferences];
-#ifndef NDEBUG
-    // Allow developers to inspect the Web Inspector in debug builds without changing settings.
-    preferences._developerExtrasEnabled = YES;
-    preferences._logsPageMessagesToSystemConsoleEnabled = YES;
-#endif
-    preferences._allowFileAccessFromFileURLs = YES;
-    [configuration _setAllowUniversalAccessFromFileURLs:YES];
-    preferences._storageBlockingPolicy = _WKStorageBlockingPolicyAllowAll;
-    preferences._javaScriptRuntimeFlags = 0;
-    if (isUnderTest()) {
-        preferences._hiddenPageDOMTimerThrottlingEnabled = NO;
-        preferences._pageVisibilityBasedProcessSuppressionEnabled = NO;
-    }
-
-    [configuration setProcessPool: ::WebKit::wrapper(inspectorProcessPool(inspectionLevel()))];
-    [configuration _setGroupIdentifier:inspectorPageGroupIdentifier()];
-
-    m_inspectorView = adoptNS([[WKWebInspectorWKWebView alloc] initWithFrame:initialRect configuration:configuration.get()]);
-    ASSERT(m_inspectorView);
-
-    [m_inspectorView _setAutomaticallyAdjustsContentInsets:NO];
-
</del><span class="cx">     m_inspectorProxyObjCAdapter = adoptNS([[WKWebInspectorProxyObjCAdapter alloc] initWithWebInspectorProxy:this]);
</span><span class="cx">     ASSERT(m_inspectorProxyObjCAdapter);
</span><span class="cx"> 
</span><del>-    [m_inspectorView setInspectorProxyObjCAdapter:m_inspectorProxyObjCAdapter.get()];
-
</del><span class="cx">     [[NSNotificationCenter defaultCenter] addObserver:m_inspectorProxyObjCAdapter.get() selector:@selector(inspectedViewFrameDidChange:) name:NSViewFrameDidChangeNotification object:inspectedView];
</span><span class="cx"> 
</span><del>-    WebPageProxy* inspectorPage = m_inspectorView-&gt;_page.get();
-    ASSERT(inspectorPage);
</del><ins>+    auto configuration = WebInspectorProxy::createFrontendConfiguration(inspectedPage(), isUnderTest());
+    m_inspectorView = adoptNS([[WKWebInspectorWKWebView alloc] initWithFrame:initialRect configuration:configuration.get()]);
</ins><span class="cx"> 
</span><del>-    WKPageUIClientV2 uiClient = {
-        { 2, this },
-        0, // createNewPage_deprecatedForUseWithV0
-        0, // showPage
-        0, // closePage
-        0, // takeFocus
-        0, // focus
-        0, // unfocus
-        0, // runJavaScriptAlert
-        0, // runJavaScriptConfirm
-        0, // runJavaScriptPrompt
-        0, // setStatusText
-        0, // mouseDidMoveOverElement_deprecatedForUseWithV0
-        0, // missingPluginButtonClicked_deprecatedForUseWithV0
-        0, // didNotHandleKeyEvent
-        0, // didNotHandleWheelEvent
-        0, // areToolbarsVisible
-        0, // setToolbarsVisible
-        0, // isMenuBarVisible
-        0, // setMenuBarVisible
-        0, // isStatusBarVisible
-        0, // setStatusBarVisible
-        0, // isResizable
-        0, // setResizable
-        getWindowFrame,
-        setWindowFrame,
-        0, // runBeforeUnloadConfirmPanel
-        0, // didDraw
-        0, // pageDidScroll
-        exceededDatabaseQuota,
-        runOpenPanel,
-        0, // decidePolicyForGeolocationPermissionRequest
-        0, // headerHeight
-        0, // footerHeight
-        0, // drawHeader
-        0, // drawFooter
-        0, // printFrame
-        0, // runModal
-        0, // unused
-        0, // saveDataToFileInDownloadsFolder
-        0, // shouldInterruptJavaScript
-        0, // createPage
-        0, // mouseDidMoveOverElement
-        0, // decidePolicyForNotificationPermissionRequest
-        0, // unavailablePluginButtonClicked_deprecatedForUseWithV1
-        0, // showColorPicker
-        0, // hideColorPicker
-        0, // unavailablePluginButtonClicked
-    };
-
-    WKPageSetPageUIClient(toAPI(inspectorPage), &amp;uiClient.base);
-
-    return inspectorPage;
</del><ins>+    return m_inspectorView-&gt;_page.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebInspectorProxy::platformCanAttach(bool webProcessCanAttach)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -528,6 +528,7 @@
</span><span class="cx">                 1AFE436518B6C081009C7A48 /* UIDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFE436318B6C081009C7A48 /* UIDelegate.mm */; };
</span><span class="cx">                 1AFE436618B6C081009C7A48 /* UIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE436418B6C081009C7A48 /* UIDelegate.h */; };
</span><span class="cx">                 1AFF49001833DE78009AB15A /* WKDeprecatedFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF48FE1833DE78009AB15A /* WKDeprecatedFunctions.cpp */; };
</span><ins>+                1BBBE4A019B66C53006B7D81 /* RemoteWebInspectorUIMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BBBE49E19B66C53006B7D81 /* RemoteWebInspectorUIMessageReceiver.cpp */; };
</ins><span class="cx">                 1C0A19461C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */; };
</span><span class="cx">                 1C0A19471C8FF1A800FE0EBB /* WebAutomationSessionProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */; };
</span><span class="cx">                 1C0A19531C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */; };
</span><span class="lines">@@ -1301,10 +1302,23 @@
</span><span class="cx">                 A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A1DF631118E0B7C8003A3E2A /* DownloadClient.h */; };
</span><span class="cx">                 A54293A4195A43DA002782C7 /* WKInspectorNodeSearchGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A54293A2195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.h */; };
</span><span class="cx">                 A54293A5195A43DD002782C7 /* WKInspectorNodeSearchGestureRecognizer.mm in Sources */ = {isa = PBXBuildFile; fileRef = A54293A3195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.mm */; };
</span><ins>+                A55BA8101BA1317E007CD33D /* _WKRemoteWebInspectorViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA80C1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                A55BA8111BA13181007CD33D /* _WKRemoteWebInspectorViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A55BA80D1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.mm */; };
+                A55BA8171BA23E12007CD33D /* RemoteWebInspectorUI.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA8131BA23E05007CD33D /* RemoteWebInspectorUI.h */; };
+                A55BA8181BA23E18007CD33D /* RemoteWebInspectorUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55BA8121BA23E05007CD33D /* RemoteWebInspectorUI.cpp */; };
+                A55BA81F1BA25B27007CD33D /* RemoteWebInspectorProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA8191BA25B1E007CD33D /* RemoteWebInspectorProxy.h */; };
+                A55BA8201BA25B2C007CD33D /* RemoteWebInspectorProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55BA81B1BA25B1E007CD33D /* RemoteWebInspectorProxy.cpp */; };
+                A55BA8251BA25CFB007CD33D /* RemoteWebInspectorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA8221BA25BB8007CD33D /* RemoteWebInspectorProxyMessages.h */; };
+                A55BA8261BA25CFD007CD33D /* RemoteWebInspectorProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55BA8211BA25BB8007CD33D /* RemoteWebInspectorProxyMessageReceiver.cpp */; };
+                A55BA82B1BA38E61007CD33D /* WebInspectorUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA8281BA38E1E007CD33D /* WebInspectorUtilities.h */; };
+                A55BA82C1BA38E64007CD33D /* WebInspectorUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55BA8271BA38E1E007CD33D /* WebInspectorUtilities.cpp */; };
</ins><span class="cx">                 A55BA8351BA3E70A007CD33D /* WebInspectorFrontendAPIDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA8331BA3E6FA007CD33D /* WebInspectorFrontendAPIDispatcher.h */; };
</span><span class="cx">                 A55BA8361BA3E70D007CD33D /* WebInspectorFrontendAPIDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55BA8321BA3E6FA007CD33D /* WebInspectorFrontendAPIDispatcher.cpp */; };
</span><span class="cx">                 A58B6F0818FCA733008CBA53 /* WKFileUploadPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = A58B6F0618FCA733008CBA53 /* WKFileUploadPanel.h */; };
</span><span class="cx">                 A58B6F0918FCA733008CBA53 /* WKFileUploadPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = A58B6F0718FCA733008CBA53 /* WKFileUploadPanel.mm */; };
</span><ins>+                A5D3504B1D752116005124A9 /* WKWebInspectorWKWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = A5D350491D752116005124A9 /* WKWebInspectorWKWebView.h */; };
+                A5D3504C1D752116005124A9 /* WKWebInspectorWKWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5D3504A1D752116005124A9 /* WKWebInspectorWKWebView.mm */; };
+                A5D3504E1D78F5B3005124A9 /* RemoteWebInspectorProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorProxyMac.mm */; };
</ins><span class="cx">                 A5EFD38C16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EFD38B16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A78CCDDA193AC9F4005ECC25 /* com.apple.WebKit.Databases.sb in CopyFiles */ = {isa = PBXBuildFile; fileRef = A78CCDD7193AC9E3005ECC25 /* com.apple.WebKit.Databases.sb */; };
</span><span class="cx">                 A78CCDDB193AC9F8005ECC25 /* com.apple.WebKit.Networking.sb in CopyFiles */ = {isa = PBXBuildFile; fileRef = A78CCDD8193AC9E3005ECC25 /* com.apple.WebKit.Networking.sb */; };
</span><span class="lines">@@ -2539,6 +2553,7 @@
</span><span class="cx">                 1AFE436418B6C081009C7A48 /* UIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AFF48FE1833DE78009AB15A /* WKDeprecatedFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKDeprecatedFunctions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCheckerCompletion.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1BBBE49E19B66C53006B7D81 /* RemoteWebInspectorUIMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteWebInspectorUIMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAutomationSessionProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C0A19481C8FF30E00FE0EBB /* WebAutomationSessionProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebAutomationSessionProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3386,10 +3401,25 @@
</span><span class="cx">                 A1EDD2DD1884B9E300BBFE98 /* WebProcessShim.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebProcessShim.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A54293A2195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKInspectorNodeSearchGestureRecognizer.h; path = ios/WKInspectorNodeSearchGestureRecognizer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A54293A3195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKInspectorNodeSearchGestureRecognizer.mm; path = ios/WKInspectorNodeSearchGestureRecognizer.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A55BA80C1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKRemoteWebInspectorViewController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA80D1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKRemoteWebInspectorViewController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8121BA23E05007CD33D /* RemoteWebInspectorUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteWebInspectorUI.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8131BA23E05007CD33D /* RemoteWebInspectorUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteWebInspectorUI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8141BA23E05007CD33D /* RemoteWebInspectorUI.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RemoteWebInspectorUI.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8191BA25B1E007CD33D /* RemoteWebInspectorProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteWebInspectorProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA81A1BA25B1E007CD33D /* RemoteWebInspectorProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RemoteWebInspectorProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA81B1BA25B1E007CD33D /* RemoteWebInspectorProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteWebInspectorProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8211BA25BB8007CD33D /* RemoteWebInspectorProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteWebInspectorProxyMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8221BA25BB8007CD33D /* RemoteWebInspectorProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteWebInspectorProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8271BA38E1E007CD33D /* WebInspectorUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorUtilities.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A55BA8281BA38E1E007CD33D /* WebInspectorUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorUtilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A55BA8321BA3E6FA007CD33D /* WebInspectorFrontendAPIDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorFrontendAPIDispatcher.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A55BA8331BA3E6FA007CD33D /* WebInspectorFrontendAPIDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorFrontendAPIDispatcher.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A58B6F0618FCA733008CBA53 /* WKFileUploadPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKFileUploadPanel.h; path = ios/forms/WKFileUploadPanel.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A58B6F0718FCA733008CBA53 /* WKFileUploadPanel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKFileUploadPanel.mm; path = ios/forms/WKFileUploadPanel.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A5D350491D752116005124A9 /* WKWebInspectorWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebInspectorWKWebView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5D3504A1D752116005124A9 /* WKWebInspectorWKWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebInspectorWKWebView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteWebInspectorProxyMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A5EFD38B16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageVisibilityTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A72D5D7F1236CBA800A88B15 /* APISerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APISerializedScriptValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A78CCDD7193AC9E3005ECC25 /* com.apple.WebKit.Databases.sb */ = {isa = PBXFileReference; lastKnownFileType = text; path = com.apple.WebKit.Databases.sb; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4807,10 +4837,6 @@
</span><span class="cx">                                 1AEFD27811D16C81008219D3 /* ArgumentCoder.h */,
</span><span class="cx">                                 1A3D610413A7F03A00F95D4E /* ArgumentCoders.cpp */,
</span><span class="cx">                                 1AEFD2F611D1807B008219D3 /* ArgumentCoders.h */,
</span><del>-                                BC032D9D10F437D10058C15A /* Decoder.cpp */,
-                                BC032D9E10F437D10058C15A /* Decoder.h */,
-                                BC032D9F10F437D10058C15A /* Encoder.cpp */,
-                                BC032DA010F437D10058C15A /* Encoder.h */,
</del><span class="cx">                                 BCEE966A112FAF57006BCC24 /* Attachment.cpp */,
</span><span class="cx">                                 BCEE966B112FAF57006BCC24 /* Attachment.h */,
</span><span class="cx">                                 BC032DA210F437D10058C15A /* Connection.cpp */,
</span><span class="lines">@@ -4817,6 +4843,10 @@
</span><span class="cx">                                 BC032DA310F437D10058C15A /* Connection.h */,
</span><span class="cx">                                 1AC7537D183BE50F0072CB15 /* DataReference.cpp */,
</span><span class="cx">                                 1AC7537E183BE50F0072CB15 /* DataReference.h */,
</span><ins>+                                BC032D9D10F437D10058C15A /* Decoder.cpp */,
+                                BC032D9E10F437D10058C15A /* Decoder.h */,
+                                BC032D9F10F437D10058C15A /* Encoder.cpp */,
+                                BC032DA010F437D10058C15A /* Encoder.h */,
</ins><span class="cx">                                 C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */,
</span><span class="cx">                                 1AC4C82816B876A90069DCCD /* MessageFlags.h */,
</span><span class="cx">                                 1A3EED11161A53D600AEB4F5 /* MessageReceiver.h */,
</span><span class="lines">@@ -5141,6 +5171,8 @@
</span><span class="cx">                                 1A43E828188F3CDC009E4D30 /* _WKProcessPoolConfiguration.h */,
</span><span class="cx">                                 1A43E827188F3CDC009E4D30 /* _WKProcessPoolConfiguration.mm */,
</span><span class="cx">                                 7C89D2D61A6C6BE6003A5FDE /* _WKProcessPoolConfigurationInternal.h */,
</span><ins>+                                A55BA80C1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.h */,
+                                A55BA80D1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.mm */,
</ins><span class="cx">                                 1A002D3F196B329400B9AD44 /* _WKSessionState.h */,
</span><span class="cx">                                 1A002D3E196B329400B9AD44 /* _WKSessionState.mm */,
</span><span class="cx">                                 1A002D42196B337000B9AD44 /* _WKSessionStateInternal.h */,
</span><span class="lines">@@ -5267,7 +5299,6 @@
</span><span class="cx">                 37C4C0901814B37B003688B9 /* cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                5C79439A1D762CDF003102D4 /* WebKit2InitializeCocoa.mm */,
</del><span class="cx">                                 1A1EF1971A1D5B420023200A /* APIDataCocoa.mm */,
</span><span class="cx">                                 378E1A3B181ED6FF0031007A /* APIObject.mm */,
</span><span class="cx">                                 37BEC4DF19491486008B4286 /* CompletionHandlerCallChecker.h */,
</span><span class="lines">@@ -5276,6 +5307,7 @@
</span><span class="cx">                                 C55F916D1C595E440029E92D /* DataDetectionResult.mm */,
</span><span class="cx">                                 2D1087621D2C641B00B85F82 /* LoadParametersCocoa.mm */,
</span><span class="cx">                                 1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */,
</span><ins>+                                5C79439A1D762CDF003102D4 /* WebKit2InitializeCocoa.mm */,
</ins><span class="cx">                                 37C4C0921814B3AF003688B9 /* WKNSArray.h */,
</span><span class="cx">                                 37C4C0911814B3AF003688B9 /* WKNSArray.mm */,
</span><span class="cx">                                 373CEAD4185417AE008C363D /* WKNSData.h */,
</span><span class="lines">@@ -5980,6 +6012,9 @@
</span><span class="cx">                                 1A90C1F21264FD71003E44D4 /* FindController.h */,
</span><span class="cx">                                 7C387433172F5615001BD88A /* PageBanner.cpp */,
</span><span class="cx">                                 7CF47FF917275C57008ACB91 /* PageBanner.h */,
</span><ins>+                                A55BA8121BA23E05007CD33D /* RemoteWebInspectorUI.cpp */,
+                                A55BA8131BA23E05007CD33D /* RemoteWebInspectorUI.h */,
+                                A55BA8141BA23E05007CD33D /* RemoteWebInspectorUI.messages.in */,
</ins><span class="cx">                                 2D819B99186275B3001F03D1 /* ViewGestureGeometryCollector.cpp */,
</span><span class="cx">                                 2D819B9A186275B3001F03D1 /* ViewGestureGeometryCollector.h */,
</span><span class="cx">                                 2D819B9B186275B3001F03D1 /* ViewGestureGeometryCollector.messages.in */,
</span><span class="lines">@@ -6062,6 +6097,9 @@
</span><span class="cx">                                 86E67A22190F411800004AB7 /* ProcessThrottler.cpp */,
</span><span class="cx">                                 86E67A21190F411800004AB7 /* ProcessThrottler.h */,
</span><span class="cx">                                 83048AE51ACA45DC0082C832 /* ProcessThrottlerClient.h */,
</span><ins>+                                A55BA81B1BA25B1E007CD33D /* RemoteWebInspectorProxy.cpp */,
+                                A55BA8191BA25B1E007CD33D /* RemoteWebInspectorProxy.h */,
+                                A55BA81A1BA25B1E007CD33D /* RemoteWebInspectorProxy.messages.in */,
</ins><span class="cx">                                 BC111B08112F5E3C00337BAB /* ResponsivenessTimer.cpp */,
</span><span class="cx">                                 1A30066C1110F4F70031937C /* ResponsivenessTimer.h */,
</span><span class="cx">                                 51A4D5A816CAC4FF000E615E /* StatisticsRequest.cpp */,
</span><span class="lines">@@ -6127,6 +6165,8 @@
</span><span class="cx">                                 1C8E28331275D73800BC7BD0 /* WebInspectorProxy.cpp */,
</span><span class="cx">                                 1C8E28321275D73800BC7BD0 /* WebInspectorProxy.h */,
</span><span class="cx">                                 1C77C1951288A872006A742F /* WebInspectorProxy.messages.in */,
</span><ins>+                                A55BA8271BA38E1E007CD33D /* WebInspectorUtilities.cpp */,
+                                A55BA8281BA38E1E007CD33D /* WebInspectorUtilities.h */,
</ins><span class="cx">                                 C98C48A31B6FD4C300145103 /* WebMediaSessionFocusManager.cpp */,
</span><span class="cx">                                 C98C48A41B6FD4C300145103 /* WebMediaSessionFocusManager.h */,
</span><span class="cx">                                 C9C183371B73FD6A007036A7 /* WebMediaSessionFocusManagerClient.cpp */,
</span><span class="lines">@@ -6857,6 +6897,7 @@
</span><span class="cx">                                 1AB16ADF1648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.mm */,
</span><span class="cx">                                 1AA3D75A1651B44F008713D0 /* RemoteLayerTreeHost.h */,
</span><span class="cx">                                 1AA3D7591651B44F008713D0 /* RemoteLayerTreeHost.mm */,
</span><ins>+                                A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorProxyMac.mm */,
</ins><span class="cx">                                 E18E6909169B563F009B6670 /* SecItemShimProxy.cpp */,
</span><span class="cx">                                 E18E690A169B563F009B6670 /* SecItemShimProxy.h */,
</span><span class="cx">                                 E18E690D169B57DF009B6670 /* SecItemShimProxy.messages.in */,
</span><span class="lines">@@ -6899,6 +6940,8 @@
</span><span class="cx">                                 0FCB4E5F18BBE3D9000FCFC9 /* WKTextInputWindowController.mm */,
</span><span class="cx">                                 2D28A4951AF965A100F190C9 /* WKViewLayoutStrategy.h */,
</span><span class="cx">                                 2D28A4961AF965A100F190C9 /* WKViewLayoutStrategy.mm */,
</span><ins>+                                A5D350491D752116005124A9 /* WKWebInspectorWKWebView.h */,
+                                A5D3504A1D752116005124A9 /* WKWebInspectorWKWebView.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -7095,6 +7138,9 @@
</span><span class="cx">                                 1AC1338418590C4600F3EC05 /* RemoteObjectRegistryMessages.h */,
</span><span class="cx">                                 0F5947A5187B517600437857 /* RemoteScrollingCoordinatorMessageReceiver.cpp */,
</span><span class="cx">                                 0F5947A6187B517600437857 /* RemoteScrollingCoordinatorMessages.h */,
</span><ins>+                                A55BA8211BA25BB8007CD33D /* RemoteWebInspectorProxyMessageReceiver.cpp */,
+                                A55BA8221BA25BB8007CD33D /* RemoteWebInspectorProxyMessages.h */,
+                                1BBBE49E19B66C53006B7D81 /* RemoteWebInspectorUIMessageReceiver.cpp */,
</ins><span class="cx">                                 E18E6913169B667B009B6670 /* SecItemShimProxyMessageReceiver.cpp */,
</span><span class="cx">                                 E18E6914169B667B009B6670 /* SecItemShimProxyMessages.h */,
</span><span class="cx">                                 2DE6943B18BD2A68005C15E5 /* SmartMagnificationControllerMessageReceiver.cpp */,
</span><span class="lines">@@ -7430,6 +7476,7 @@
</span><span class="cx">                                 1AABFE3A1829C1ED005B070E /* _WKRemoteObjectInterfaceInternal.h in Headers */,
</span><span class="cx">                                 1A9E32891821636900F5D04C /* _WKRemoteObjectRegistry.h in Headers */,
</span><span class="cx">                                 1A9E32A11823018900F5D04C /* _WKRemoteObjectRegistryInternal.h in Headers */,
</span><ins>+                                A55BA8101BA1317E007CD33D /* _WKRemoteWebInspectorViewController.h in Headers */,
</ins><span class="cx">                                 377216B81A4E6BE000DCA718 /* _WKRenderingProgressEvents.h in Headers */,
</span><span class="cx">                                 1F604BAA1889FBB800EE0395 /* _WKRenderingProgressEventsInternal.h in Headers */,
</span><span class="cx">                                 376311FD1A3FB5F7005A2E51 /* _WKSameDocumentNavigationType.h in Headers */,
</span><span class="lines">@@ -7518,8 +7565,6 @@
</span><span class="cx">                                 1AEFD2F711D1807B008219D3 /* ArgumentCoders.h in Headers */,
</span><span class="cx">                                 1AAF0C4A12B16334008E49E2 /* ArgumentCodersCF.h in Headers */,
</span><span class="cx">                                 E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */,
</span><del>-                                BC032DA610F437D10058C15A /* Decoder.h in Headers */,
-                                BC032DA810F437D10058C15A /* Encoder.h in Headers */,
</del><span class="cx">                                 CE1A0BD21A48E6C60054EF74 /* AssertionServicesSPI.h in Headers */,
</span><span class="cx">                                 C59C4A5918B81174007BDCB6 /* AssistedNodeInformation.h in Headers */,
</span><span class="cx">                                 515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
</span><span class="lines">@@ -7565,6 +7610,7 @@
</span><span class="cx">                                 51032F1E180F791700961BB7 /* DatabaseToWebProcessConnectionMessages.h in Headers */,
</span><span class="cx">                                 C55F91711C59676E0029E92D /* DataDetectionResult.h in Headers */,
</span><span class="cx">                                 1AC75380183BE50F0072CB15 /* DataReference.h in Headers */,
</span><ins>+                                BC032DA610F437D10058C15A /* Decoder.h in Headers */,
</ins><span class="cx">                                 83891B6C1A68C30B0030F386 /* DiagnosticLoggingClient.h in Headers */,
</span><span class="cx">                                 5C1427021C23F84C00D41183 /* Download.h in Headers */,
</span><span class="cx">                                 A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */,
</span><span class="lines">@@ -7581,11 +7627,13 @@
</span><span class="cx">                                 1A64230912DD09EB00CAAE2C /* DrawingAreaProxyMessages.h in Headers */,
</span><span class="cx">                                 E105FE5418D7B9DE008F57A8 /* EditingRange.h in Headers */,
</span><span class="cx">                                 1AA41AB512C02EC4002BE67B /* EditorState.h in Headers */,
</span><ins>+                                BC032DA810F437D10058C15A /* Encoder.h in Headers */,
</ins><span class="cx">                                 51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */,
</span><span class="cx">                                 1AA575FB1496B52600A4EE06 /* EventDispatcher.h in Headers */,
</span><span class="cx">                                 00B9661A18E25AE100CE1F88 /* FindClient.h in Headers */,
</span><span class="cx">                                 1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
</span><span class="cx">                                 BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */,
</span><ins>+                                1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */,
</ins><span class="cx">                                 1AE00D611831792100087DD7 /* FrameLoadState.h in Headers */,
</span><span class="cx">                                 515BE1B31D5902DD00DD7C68 /* GamepadData.h in Headers */,
</span><span class="cx">                                 BC17753F118BABF0007D9E9A /* GenericCallback.h in Headers */,
</span><span class="lines">@@ -7697,6 +7745,7 @@
</span><span class="cx">                                 1A2D84A3127F6AD1001EB962 /* NPVariantData.h in Headers */,
</span><span class="cx">                                 3754D5451B3A29FD003A4C7F /* NSInvocationSPI.h in Headers */,
</span><span class="cx">                                 BC8ACA1316670D89004C1941 /* ObjCObjectGraph.h in Headers */,
</span><ins>+                                37B47E2D1D64DB76005F4EFF /* objcSPI.h in Headers */,
</ins><span class="cx">                                 7CF47FFB17275C57008ACB91 /* PageBanner.h in Headers */,
</span><span class="cx">                                 BC6EDAA6111271C600E7678B /* PageClient.h in Headers */,
</span><span class="cx">                                 0FCB4E6218BBE3D9000FCFC9 /* PageClientImpl.h in Headers */,
</span><span class="lines">@@ -7764,6 +7813,9 @@
</span><span class="cx">                                 0F59479B187B3B6000437857 /* RemoteScrollingCoordinatorProxy.h in Headers */,
</span><span class="cx">                                 0F5947A4187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.h in Headers */,
</span><span class="cx">                                 0F59479D187B3B6000437857 /* RemoteScrollingTree.h in Headers */,
</span><ins>+                                A55BA81F1BA25B27007CD33D /* RemoteWebInspectorProxy.h in Headers */,
+                                A55BA8251BA25CFB007CD33D /* RemoteWebInspectorProxyMessages.h in Headers */,
+                                A55BA8171BA23E12007CD33D /* RemoteWebInspectorUI.h in Headers */,
</ins><span class="cx">                                 1A30066E1110F4F70031937C /* ResponsivenessTimer.h in Headers */,
</span><span class="cx">                                 BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */,
</span><span class="cx">                                 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */,
</span><span class="lines">@@ -7818,9 +7870,7 @@
</span><span class="cx">                                 2684054418B85A630022C38B /* VisibleContentRectUpdateInfo.h in Headers */,
</span><span class="cx">                                 1A0F29E4120B44420053D1B9 /* VisitedLinkStore.h in Headers */,
</span><span class="cx">                                 1A60224D18C16B9F00C3E8C9 /* VisitedLinkStoreMessages.h in Headers */,
</span><del>-                                37B47E2D1D64DB76005F4EFF /* objcSPI.h in Headers */,
</del><span class="cx">                                 1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */,
</span><del>-                                375E0E141D66432700EFEC2C /* WKNSNumber.h in Headers */,
</del><span class="cx">                                 1AF4CEF018BC481800BC2D34 /* VisitedLinkTableController.h in Headers */,
</span><span class="cx">                                 1A8E7D3D18C15149005A702A /* VisitedLinkTableControllerMessages.h in Headers */,
</span><span class="cx">                                 1AA9BAE1184FFAC7003B6BC6 /* WeakObjCPtr.h in Headers */,
</span><span class="lines">@@ -7909,6 +7959,7 @@
</span><span class="cx">                                 1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */,
</span><span class="cx">                                 1C891D6619B124FF00BA79DD /* WebInspectorUI.h in Headers */,
</span><span class="cx">                                 1CBBE4A119B66C53006B7D81 /* WebInspectorUIMessages.h in Headers */,
</span><ins>+                                A55BA82B1BA38E61007CD33D /* WebInspectorUtilities.h in Headers */,
</ins><span class="cx">                                 2DA944A01884E4F000ED86DB /* WebIOSEventFactory.h in Headers */,
</span><span class="cx">                                 1A6280C51919949F006AD9F9 /* WebKit.h in Headers */,
</span><span class="cx">                                 BCB63478116BF10600603215 /* WebKit2_C.h in Headers */,
</span><span class="lines">@@ -8176,8 +8227,8 @@
</span><span class="cx">                                 373CEAD6185417AE008C363D /* WKNSData.h in Headers */,
</span><span class="cx">                                 371A19421824D29300F32A5E /* WKNSDictionary.h in Headers */,
</span><span class="cx">                                 372CAF0B1833FD910040AC27 /* WKNSError.h in Headers */,
</span><ins>+                                375E0E141D66432700EFEC2C /* WKNSNumber.h in Headers */,
</ins><span class="cx">                                 378E1A4A18208CD60031007A /* WKNSString.h in Headers */,
</span><del>-                                1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */,
</del><span class="cx">                                 378E1A4E18208D700031007A /* WKNSURL.h in Headers */,
</span><span class="cx">                                 37FC194B18510D6A008CFA47 /* WKNSURLAuthenticationChallenge.h in Headers */,
</span><span class="cx">                                 37183D57182F4E700080C811 /* WKNSURLExtras.h in Headers */,
</span><span class="lines">@@ -8288,6 +8339,7 @@
</span><span class="cx">                                 BFA6179F12F0B99D0033E0CA /* WKViewPrivate.h in Headers */,
</span><span class="cx">                                 C5E1AFE916B20B75006CC1F2 /* WKWebArchive.h in Headers */,
</span><span class="cx">                                 C5E1AFEB16B20B7E006CC1F2 /* WKWebArchiveResource.h in Headers */,
</span><ins>+                                A5D3504B1D752116005124A9 /* WKWebInspectorWKWebView.h in Headers */,
</ins><span class="cx">                                 1AA2E56718D77508003814BD /* WKWebProcessBundleParameters.h in Headers */,
</span><span class="cx">                                 BC989D82161A7E5D000D46D3 /* WKWebProcessPlugIn.h in Headers */,
</span><span class="cx">                                 BC8F2F2B16273A2C005FACB5 /* WKWebProcessPlugInBrowserContextController.h in Headers */,
</span><span class="lines">@@ -8925,6 +8977,7 @@
</span><span class="cx">                                 1A43E829188F3CDC009E4D30 /* _WKProcessPoolConfiguration.mm in Sources */,
</span><span class="cx">                                 1A9E328E182165A900F5D04C /* _WKRemoteObjectInterface.mm in Sources */,
</span><span class="cx">                                 1A9E328A1821636900F5D04C /* _WKRemoteObjectRegistry.mm in Sources */,
</span><ins>+                                A55BA8111BA13181007CD33D /* _WKRemoteWebInspectorViewController.mm in Sources */,
</ins><span class="cx">                                 1A002D45196B338E00B9AD44 /* _WKSessionState.mm in Sources */,
</span><span class="cx">                                 2D6B371C18A967AD0042AE80 /* _WKThumbnailView.mm in Sources */,
</span><span class="cx">                                 7C2413021AACFA7500A58C15 /* _WKUserContentExtensionStore.mm in Sources */,
</span><span class="lines">@@ -8979,8 +9032,6 @@
</span><span class="cx">                                 1A3D610513A7F03A00F95D4E /* ArgumentCoders.cpp in Sources */,
</span><span class="cx">                                 1AAF0C4B12B16334008E49E2 /* ArgumentCodersCF.cpp in Sources */,
</span><span class="cx">                                 E179FD9F134D38250015B883 /* ArgumentCodersMac.mm in Sources */,
</span><del>-                                BC032DA510F437D10058C15A /* Decoder.cpp in Sources */,
-                                BC032DA710F437D10058C15A /* Encoder.cpp in Sources */,
</del><span class="cx">                                 C59C4A5818B81174007BDCB6 /* AssistedNodeInformation.cpp in Sources */,
</span><span class="cx">                                 515E7727183DD6F60007203F /* AsyncRequest.cpp in Sources */,
</span><span class="cx">                                 BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */,
</span><span class="lines">@@ -9028,6 +9079,7 @@
</span><span class="cx">                                 51032F1D180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 C55F91701C595F630029E92D /* DataDetectionResult.mm in Sources */,
</span><span class="cx">                                 1AC7537F183BE50F0072CB15 /* DataReference.cpp in Sources */,
</span><ins>+                                BC032DA510F437D10058C15A /* Decoder.cpp in Sources */,
</ins><span class="cx">                                 2D3494641BCC2EC30064F0BE /* DeprecatedPDFPlugin.mm in Sources */,
</span><span class="cx">                                 83891B6D1A68C30B0030F386 /* DiagnosticLoggingClient.mm in Sources */,
</span><span class="cx">                                 5C1427011C23F84C00D41183 /* Download.cpp in Sources */,
</span><span class="lines">@@ -9044,6 +9096,7 @@
</span><span class="cx">                                 BC2652161182608100243E12 /* DrawingAreaProxy.cpp in Sources */,
</span><span class="cx">                                 1A64230812DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */,
</span><ins>+                                BC032DA710F437D10058C15A /* Encoder.cpp in Sources */,
</ins><span class="cx">                                 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */,
</span><span class="cx">                                 1AA575FA1496B52600A4EE06 /* EventDispatcher.cpp in Sources */,
</span><span class="cx">                                 1AA576021496B97900A4EE06 /* EventDispatcherMessageReceiver.cpp in Sources */,
</span><span class="lines">@@ -9051,6 +9104,7 @@
</span><span class="cx">                                 1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
</span><span class="cx">                                 2DD13BD518F7DADD00E130A1 /* FindControllerIOS.mm in Sources */,
</span><span class="cx">                                 BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */,
</span><ins>+                                1A14F8E11D74C834006CBEC6 /* FrameInfoData.cpp in Sources */,
</ins><span class="cx">                                 1AE00D601831792100087DD7 /* FrameLoadState.cpp in Sources */,
</span><span class="cx">                                 515BE1B21D5902DD00DD7C68 /* GamepadData.cpp in Sources */,
</span><span class="cx">                                 BC06F43012DBB9B6002D78DE /* GeolocationPermissionRequestManager.cpp in Sources */,
</span><span class="lines">@@ -9123,7 +9177,6 @@
</span><span class="cx">                                 E47D1E981B0649FB002676A8 /* NetworkCacheData.cpp in Sources */,
</span><span class="cx">                                 E42E06141AA75B7000B11699 /* NetworkCacheDataCocoa.mm in Sources */,
</span><span class="cx">                                 E489D28D1A0A2DB80078C06A /* NetworkCacheDecoder.cpp in Sources */,
</span><del>-                                1A14F8E11D74C834006CBEC6 /* FrameInfoData.cpp in Sources */,
</del><span class="cx">                                 E489D28F1A0A2DB80078C06A /* NetworkCacheEncoder.cpp in Sources */,
</span><span class="cx">                                 E413F59F1AC1AF9D00345360 /* NetworkCacheEntry.cpp in Sources */,
</span><span class="cx">                                 E4697CCD1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp in Sources */,
</span><span class="lines">@@ -9132,7 +9185,6 @@
</span><span class="cx">                                 831EEBBE1BD85C4300BB64C3 /* NetworkCacheSpeculativeLoad.cpp in Sources */,
</span><span class="cx">                                 832AE2531BE2E8CD00FAAE10 /* NetworkCacheSpeculativeLoadManager.cpp in Sources */,
</span><span class="cx">                                 83BDCCB91AC5FDB6003F6441 /* NetworkCacheStatistics.cpp in Sources */,
</span><del>-                                375E0E131D66432700EFEC2C /* WKNSNumber.mm in Sources */,
</del><span class="cx">                                 E4436ED01A0D040B00EAD204 /* NetworkCacheStorage.cpp in Sources */,
</span><span class="cx">                                 8310428C1BD6B66F00A715E4 /* NetworkCacheSubresourcesEntry.cpp in Sources */,
</span><span class="cx">                                 513A164C1630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp in Sources */,
</span><span class="lines">@@ -9203,7 +9255,6 @@
</span><span class="cx">                                 1A0EC910124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp in Sources */,
</span><span class="cx">                                 1A7865B916CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A2BB6D014117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp in Sources */,
</span><del>-                                51E399061D6F54C7009C8831 /* UIGamepadProviderCocoa.mm in Sources */,
</del><span class="cx">                                 1A2D90D31281C966001EB962 /* PluginProcessCreationParameters.cpp in Sources */,
</span><span class="cx">                                 1AA4792312A59FD9008236C3 /* PluginProcessMac.mm in Sources */,
</span><span class="cx">                                 1A0EC604124A9F2C007EF4A5 /* PluginProcessManager.cpp in Sources */,
</span><span class="lines">@@ -9248,6 +9299,11 @@
</span><span class="cx">                                 0F0C365C18C05CA100F607D7 /* RemoteScrollingCoordinatorProxyIOS.mm in Sources */,
</span><span class="cx">                                 0F5947A3187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp in Sources */,
</span><span class="cx">                                 0F59479C187B3B6000437857 /* RemoteScrollingTree.cpp in Sources */,
</span><ins>+                                A55BA8201BA25B2C007CD33D /* RemoteWebInspectorProxy.cpp in Sources */,
+                                A5D3504E1D78F5B3005124A9 /* RemoteWebInspectorProxyMac.mm in Sources */,
+                                A55BA8261BA25CFD007CD33D /* RemoteWebInspectorProxyMessageReceiver.cpp in Sources */,
+                                A55BA8181BA23E18007CD33D /* RemoteWebInspectorUI.cpp in Sources */,
+                                1BBBE4A019B66C53006B7D81 /* RemoteWebInspectorUIMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 BC111B09112F5E3C00337BAB /* ResponsivenessTimer.cpp in Sources */,
</span><span class="cx">                                 1AAB4AAA1296F1540023952F /* SandboxExtensionMac.mm in Sources */,
</span><span class="cx">                                 E1E552C416AE065F004ED653 /* SandboxInitialiationParametersMac.mm in Sources */,
</span><span class="lines">@@ -9287,6 +9343,8 @@
</span><span class="cx">                                 1AFE436518B6C081009C7A48 /* UIDelegate.mm in Sources */,
</span><span class="cx">                                 515BE1B41D5917FF00DD7C68 /* UIGamepad.cpp in Sources */,
</span><span class="cx">                                 515BE1A81D55293400DD7C68 /* UIGamepadProvider.cpp in Sources */,
</span><ins>+                                51E399061D6F54C7009C8831 /* UIGamepadProviderCocoa.mm in Sources */,
+                                51E949971D76211300EC9EB9 /* UIGamepadProviderIOS.mm in Sources */,
</ins><span class="cx">                                 515BE1B71D5A94FD00DD7C68 /* UIGamepadProviderMac.mm in Sources */,
</span><span class="cx">                                 1A64245F12DE29A100CAAE2C /* UpdateInfo.cpp in Sources */,
</span><span class="cx">                                 1AC1336718565B5700F3EC05 /* UserData.cpp in Sources */,
</span><span class="lines">@@ -9413,10 +9471,12 @@
</span><span class="cx">                                 1C891D6519B124FF00BA79DD /* WebInspectorUI.cpp in Sources */,
</span><span class="cx">                                 1CA8B954127C891500576C2B /* WebInspectorUIMac.mm in Sources */,
</span><span class="cx">                                 1CBBE4A019B66C53006B7D81 /* WebInspectorUIMessageReceiver.cpp in Sources */,
</span><ins>+                                A55BA82C1BA38E64007CD33D /* WebInspectorUtilities.cpp in Sources */,
</ins><span class="cx">                                 2DA944A11884E4F000ED86DB /* WebIOSEventFactory.mm in Sources */,
</span><span class="cx">                                 C0337DD3127A2A0E008FF4F4 /* WebKeyboardEvent.cpp in Sources */,
</span><span class="cx">                                 1A6280F31919982A006AD9F9 /* WebKit.m in Sources */,
</span><span class="cx">                                 BC9BA5041697C45300E44616 /* WebKit2Initialize.cpp in Sources */,
</span><ins>+                                5C79439B1D762D62003102D4 /* WebKit2InitializeCocoa.mm in Sources */,
</ins><span class="cx">                                 51FB08FF1639DE1A00EC324A /* WebLoaderStrategy.cpp in Sources */,
</span><span class="cx">                                 CD003A5219D49B5D005ABCE0 /* WebMediaKeyStorageManager.cpp in Sources */,
</span><span class="cx">                                 C98C48A51B6FD4C300145103 /* WebMediaSessionFocusManager.cpp in Sources */,
</span><span class="lines">@@ -9644,6 +9704,7 @@
</span><span class="cx">                                 373CEAD5185417AE008C363D /* WKNSData.mm in Sources */,
</span><span class="cx">                                 371A19411824D29300F32A5E /* WKNSDictionary.mm in Sources */,
</span><span class="cx">                                 372CAF0C1833FD910040AC27 /* WKNSError.mm in Sources */,
</span><ins>+                                375E0E131D66432700EFEC2C /* WKNSNumber.mm in Sources */,
</ins><span class="cx">                                 378E1A4918208CD60031007A /* WKNSString.mm in Sources */,
</span><span class="cx">                                 378E1A4D18208D700031007A /* WKNSURL.mm in Sources */,
</span><span class="cx">                                 37FC194A18510D6A008CFA47 /* WKNSURLAuthenticationChallenge.mm in Sources */,
</span><span class="lines">@@ -9688,7 +9749,6 @@
</span><span class="cx">                                 BC407605124FF0270068F20A /* WKString.cpp in Sources */,
</span><span class="cx">                                 BC407619124FF0370068F20A /* WKStringCF.mm in Sources */,
</span><span class="cx">                                 26F10BE919187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m in Sources */,
</span><del>-                                5C79439B1D762D62003102D4 /* WebKit2InitializeCocoa.mm in Sources */,
</del><span class="cx">                                 2DD67A361BD861060053B251 /* WKTextFinderClient.mm in Sources */,
</span><span class="cx">                                 0FCB4E6918BBE3D9000FCFC9 /* WKTextInputWindowController.mm in Sources */,
</span><span class="cx">                                 BC407607124FF0270068F20A /* WKType.cpp in Sources */,
</span><span class="lines">@@ -9711,11 +9771,11 @@
</span><span class="cx">                                 2D28A4981AF965A200F190C9 /* WKViewLayoutStrategy.mm in Sources */,
</span><span class="cx">                                 C5E1AFE816B20B67006CC1F2 /* WKWebArchive.cpp in Sources */,
</span><span class="cx">                                 C5E1AFEA16B20B7B006CC1F2 /* WKWebArchiveResource.cpp in Sources */,
</span><ins>+                                A5D3504C1D752116005124A9 /* WKWebInspectorWKWebView.mm in Sources */,
</ins><span class="cx">                                 1AA2E56618D77508003814BD /* WKWebProcessBundleParameters.mm in Sources */,
</span><span class="cx">                                 BC989D81161A7E5D000D46D3 /* WKWebProcessPlugIn.mm in Sources */,
</span><span class="cx">                                 BC8F2F2A16273A2C005FACB5 /* WKWebProcessPlugInBrowserContextController.mm in Sources */,
</span><span class="cx">                                 1F7506AD1859161C00EC0FF7 /* WKWebProcessPlugInFrame.mm in Sources */,
</span><del>-                                51E949971D76211300EC9EB9 /* UIGamepadProviderIOS.mm in Sources */,
</del><span class="cx">                                 1F7506AE1859162200EC0FF7 /* WKWebProcessPlugInHitTestResult.mm in Sources */,
</span><span class="cx">                                 1F7506AF1859162800EC0FF7 /* WKWebProcessPlugInNodeHandle.mm in Sources */,
</span><span class="cx">                                 1FB00AC8185F76460019142E /* WKWebProcessPlugInPageGroup.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="cx"> class Connection;
</span><del>-class MessageDecoder;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageRemoteWebInspectorUIcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.cpp (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.cpp                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+/*
+ * 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 &quot;config.h&quot;
+#include &quot;RemoteWebInspectorUI.h&quot;
+
+#include &quot;RemoteWebInspectorProxyMessages.h&quot;
+#include &quot;RemoteWebInspectorUIMessages.h&quot;
+#include &quot;WebPage.h&quot;
+#include &quot;WebProcess.h&quot;
+#include &lt;WebCore/Chrome.h&gt;
+#include &lt;WebCore/DOMWrapperWorld.h&gt;
+#include &lt;WebCore/InspectorController.h&gt;
+#include &lt;WebCore/ScriptGlobalObject.h&gt;
+#include &lt;WebCore/ScriptState.h&gt;
+
+using namespace WebCore;
+
+namespace WebKit {
+
+Ref&lt;RemoteWebInspectorUI&gt; RemoteWebInspectorUI::create(WebPage&amp; page)
+{
+    return adoptRef(*new RemoteWebInspectorUI(page));
+}
+
+RemoteWebInspectorUI::RemoteWebInspectorUI(WebPage&amp; page)
+    : m_page(page)
+    , m_frontendAPIDispatcher(page)
+{
+}
+
+void RemoteWebInspectorUI::initialize(const String&amp; debuggableType, const String&amp; backendCommandsURL)
+{
+    m_debuggableType = debuggableType;
+    m_backendCommandsURL = backendCommandsURL;
+
+    m_page.corePage()-&gt;inspectorController().setInspectorFrontendClient(this);
+
+    m_frontendAPIDispatcher.reset();
+    m_frontendAPIDispatcher.dispatchCommand(ASCIILiteral(&quot;setDockingUnavailable&quot;), true);
+}
+
+void RemoteWebInspectorUI::didSave(const String&amp; url)
+{
+    m_frontendAPIDispatcher.dispatchCommand(ASCIILiteral(&quot;savedURL&quot;), url);
+}
+
+void RemoteWebInspectorUI::didAppend(const String&amp; url)
+{
+    m_frontendAPIDispatcher.dispatchCommand(ASCIILiteral(&quot;appendedToURL&quot;), url);
+}
+
+void RemoteWebInspectorUI::sendMessageToFrontend(const String&amp; message)
+{
+    m_frontendAPIDispatcher.dispatchMessageAsync(message);
+}
+
+void RemoteWebInspectorUI::sendMessageToBackend(const String&amp; message)
+{
+    WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::RemoteWebInspectorProxy::SendMessageToBackend(message), m_page.pageID());
+}
+
+void RemoteWebInspectorUI::windowObjectCleared()
+{
+    if (m_frontendHost)
+        m_frontendHost-&gt;disconnectClient();
+
+    m_frontendHost = InspectorFrontendHost::create(this, m_page.corePage());
+    ScriptGlobalObject::set(*execStateFromPage(mainThreadNormalWorld(), m_page.corePage()), ASCIILiteral(&quot;InspectorFrontendHost&quot;), *m_frontendHost);
+}
+
+void RemoteWebInspectorUI::frontendLoaded()
+{
+    m_frontendAPIDispatcher.frontendLoaded();
+
+    bringToFront();
+}
+
+void RemoteWebInspectorUI::startWindowDrag()
+{
+    WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::RemoteWebInspectorProxy::StartWindowDrag(), m_page.pageID());
+}
+
+void RemoteWebInspectorUI::moveWindowBy(float x, float y)
+{
+    FloatRect frameRect = m_page.corePage()-&gt;chrome().windowRect();
+    frameRect.move(x, y);
+    m_page.corePage()-&gt;chrome().setWindowRect(frameRect);
+}
+
+void RemoteWebInspectorUI::bringToFront()
+{
+    WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::RemoteWebInspectorProxy::BringToFront(), m_page.pageID());
+}
+
+void RemoteWebInspectorUI::closeWindow()
+{
+    WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::RemoteWebInspectorProxy::FrontendDidClose(), m_page.pageID());
+}
+
+void RemoteWebInspectorUI::openInNewTab(const String&amp; url)
+{
+    WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::RemoteWebInspectorProxy::OpenInNewTab(url), m_page.pageID());
+}
+
+void RemoteWebInspectorUI::save(const String&amp; filename, const String&amp; content, bool base64Encoded, bool forceSaveAs)
+{
+    WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::RemoteWebInspectorProxy::Save(filename, content, base64Encoded, forceSaveAs), m_page.pageID());
+}
+
+void RemoteWebInspectorUI::append(const String&amp; filename, const String&amp; content)
+{
+    WebProcess::singleton().parentProcessConnection()-&gt;send(Messages::RemoteWebInspectorProxy::Append(filename, content), m_page.pageID());
+}
+
+void RemoteWebInspectorUI::inspectedURLChanged(const String&amp; urlString)
+{
+    // Do nothing. The remote side can know if the main resource changed.
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageRemoteWebInspectorUIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.h (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * 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
+
+#include &quot;MessageReceiver.h&quot;
+#include &quot;WebInspectorFrontendAPIDispatcher.h&quot;
+#include &lt;WebCore/InspectorFrontendClient.h&gt;
+#include &lt;WebCore/InspectorFrontendHost.h&gt;
+#include &lt;wtf/Deque.h&gt;
+
+namespace WebKit {
+
+class WebPage;
+
+class RemoteWebInspectorUI final : public RefCounted&lt;RemoteWebInspectorUI&gt;, public IPC::MessageReceiver, public WebCore::InspectorFrontendClient {
+public:
+    static Ref&lt;RemoteWebInspectorUI&gt; create(WebPage&amp;);
+
+    // Implemented in generated RemoteWebInspectorUIMessageReceiver.cpp
+    void didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) override;
+
+    // Called by RemoteWebInspectorUI messages
+    void initialize(const String&amp; debuggableType, const String&amp; backendCommandsURL);
+    void didSave(const String&amp; url);
+    void didAppend(const String&amp; url);
+    void sendMessageToFrontend(const String&amp;);
+
+    // WebCore::InspectorFrontendClient
+    void windowObjectCleared() override;
+    void frontendLoaded() override;
+    void startWindowDrag() override;
+    void moveWindowBy(float x, float y) override;
+
+    String localizedStringsURL() override;
+    String backendCommandsURL() override { return m_backendCommandsURL; }
+    String debuggableType() override { return m_debuggableType; }
+
+    void bringToFront() override;
+    void closeWindow() override;
+
+    void openInNewTab(const String&amp; url) override;
+    void save(const String&amp; url, const String&amp; content, bool base64Encoded, bool forceSaveAs) override;
+    void append(const String&amp; url, const String&amp; content) override;
+    void inspectedURLChanged(const String&amp;) override;
+    void sendMessageToBackend(const String&amp;) override;
+
+    bool canSave() override { return true; }
+    bool isUnderTest() override { return false; }
+    unsigned inspectionLevel() const override { return 1; }
+    void requestSetDockSide(DockSide) override { }
+    void changeAttachedWindowHeight(unsigned) override { }
+    void changeAttachedWindowWidth(unsigned) override { }
+
+private:
+    explicit RemoteWebInspectorUI(WebPage&amp;);
+
+    WebPage&amp; m_page;
+    WebInspectorFrontendAPIDispatcher m_frontendAPIDispatcher;
+    RefPtr&lt;WebCore::InspectorFrontendHost&gt; m_frontendHost;
+    String m_debuggableType;
+    String m_backendCommandsURL;
+};
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageRemoteWebInspectorUImessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.messages.in (0 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.messages.in        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+# 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.
+
+messages -&gt; RemoteWebInspectorUI {
+    Initialize(String debuggableType, String backendCommandsURL)
+
+    DidSave(String url)
+    DidAppend(String url)
+
+    SendMessageToFrontend(String message)
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebInspectorUIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -129,11 +129,6 @@
</span><span class="cx">     bool m_isVisible { false };
</span><span class="cx">     DockSide m_dockSide { DockSide::Undocked };
</span><span class="cx">     unsigned m_inspectionLevel { 1 };
</span><del>-
-#if PLATFORM(COCOA)
-    mutable String m_localizedStringsURL;
-    mutable bool m_hasLocalizedStringsURL { false };
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx"> #include &quot;PluginProxy.h&quot;
</span><span class="cx"> #include &quot;PluginView.h&quot;
</span><span class="cx"> #include &quot;PrintInfo.h&quot;
</span><ins>+#include &quot;RemoteWebInspectorUI.h&quot;
+#include &quot;RemoteWebInspectorUIMessages.h&quot;
</ins><span class="cx"> #include &quot;SessionState.h&quot;
</span><span class="cx"> #include &quot;SessionStateConversion.h&quot;
</span><span class="cx"> #include &quot;SessionTracker.h&quot;
</span><span class="lines">@@ -537,6 +539,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     webProcess.addMessageReceiver(Messages::WebInspector::messageReceiverName(), m_pageID, *this);
</span><span class="cx">     webProcess.addMessageReceiver(Messages::WebInspectorUI::messageReceiverName(), m_pageID, *this);
</span><ins>+    webProcess.addMessageReceiver(Messages::RemoteWebInspectorUI::messageReceiverName(), m_pageID, *this);
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     webProcess.addMessageReceiver(Messages::WebFullScreenManager::messageReceiverName(), m_pageID, *this);
</span><span class="cx"> #endif
</span><span class="lines">@@ -630,6 +633,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     webProcess.removeMessageReceiver(Messages::WebInspector::messageReceiverName(), m_pageID);
</span><span class="cx">     webProcess.removeMessageReceiver(Messages::WebInspectorUI::messageReceiverName(), m_pageID);
</span><ins>+    webProcess.removeMessageReceiver(Messages::RemoteWebInspectorUI::messageReceiverName(), m_pageID);
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     webProcess.removeMessageReceiver(Messages::WebFullScreenManager::messageReceiverName(), m_pageID);
</span><span class="cx"> #endif
</span><span class="lines">@@ -3264,6 +3268,15 @@
</span><span class="cx">     return m_inspectorUI.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RemoteWebInspectorUI* WebPage::remoteInspectorUI()
+{
+    if (m_isClosed)
+        return nullptr;
+    if (!m_remoteInspectorUI)
+        m_remoteInspectorUI = RemoteWebInspectorUI::create(*this);
+    return m_remoteInspectorUI.get();
+}
+
</ins><span class="cx"> #if (PLATFORM(IOS) &amp;&amp; HAVE(AVKIT)) || (PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx"> WebPlaybackSessionManager&amp; WebPage::playbackSessionManager()
</span><span class="cx"> {
</span><span class="lines">@@ -3900,6 +3913,12 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (decoder.messageReceiverName() == Messages::RemoteWebInspectorUI::messageReceiverName()) {
+        if (RemoteWebInspectorUI* remoteInspectorUI = this-&gt;remoteInspectorUI())
+            remoteInspectorUI-&gt;didReceiveMessage(connection, decoder);
+        return;
+    }
+
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     if (decoder.messageReceiverName() == Messages::WebFullScreenManager::messageReceiverName()) {
</span><span class="cx">         fullScreenManager()-&gt;didReceiveMessage(connection, decoder);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -162,6 +162,7 @@
</span><span class="cx"> class PDFPlugin;
</span><span class="cx"> class PageBanner;
</span><span class="cx"> class PluginView;
</span><ins>+class RemoteWebInspectorUI;
</ins><span class="cx"> class VisibleContentRectUpdateInfo;
</span><span class="cx"> class WebColorChooser;
</span><span class="cx"> class WebContextMenu;
</span><span class="lines">@@ -252,7 +253,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebInspector* inspector(LazyCreationPolicy = LazyCreationPolicy::CreateIfNeeded);
</span><span class="cx">     WebInspectorUI* inspectorUI();
</span><del>-    bool isInspectorPage() { return !!m_inspectorUI; }
</del><ins>+    RemoteWebInspectorUI* remoteInspectorUI();
+    bool isInspectorPage() { return !!m_inspectorUI || !!m_remoteInspectorUI; }
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx">     WebPlaybackSessionManager&amp; playbackSessionManager();
</span><span class="lines">@@ -1327,6 +1329,8 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;WebInspector&gt; m_inspector;
</span><span class="cx">     RefPtr&lt;WebInspectorUI&gt; m_inspectorUI;
</span><ins>+    RefPtr&lt;RemoteWebInspectorUI&gt; m_remoteInspectorUI;
+
</ins><span class="cx"> #if (PLATFORM(IOS) &amp;&amp; HAVE(AVKIT)) || (PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx">     RefPtr&lt;WebPlaybackSessionManager&gt; m_playbackSessionManager;
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenManager&gt; m_videoFullscreenManager;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageeflWebInspectorUIEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/efl/WebInspectorUIEfl.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/efl/WebInspectorUIEfl.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebProcess/WebPage/efl/WebInspectorUIEfl.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebInspectorUI.h&quot;
</span><ins>+#include &quot;RemoteWebInspectorUI.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;WebCore/EflInspectorUtilities.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -41,4 +42,9 @@
</span><span class="cx">     return &quot;file://&quot; + WebCore::inspectorResourcePath() + &quot;/localizedStrings.js&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String RemoteWebInspectorUI::localizedStringsURL()
+{
+    return &quot;file://&quot; + WebCore::inspectorResourcePath() + &quot;/localizedStrings.js&quot;;
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagegtkWebInspectorUIGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebInspectorUI.h&quot;
</span><ins>+#include &quot;RemoteWebInspectorUI.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;WebCore/FileSystem.h&gt;
</span><span class="cx"> #include &lt;glib.h&gt;
</span><span class="lines">@@ -43,4 +44,9 @@
</span><span class="cx">     return String(&quot;resource:///org/webkitgtk/inspector/Localizations/en.lproj/localizedStrings.js&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String RemoteWebInspectorUI::localizedStringsURL()
+{
+    return String(&quot;resource:///org/webkitgtk/inspector/Localizations/en.lproj/localizedStrings.js&quot;);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebInspectorUIMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorUIMac.mm (205368 => 205369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorUIMac.mm        2016-09-02 20:49:27 UTC (rev 205368)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebInspectorUIMac.mm        2016-09-02 20:57:51 UTC (rev 205369)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;WebInspectorUI.h&quot;
</span><ins>+#import &quot;RemoteWebInspectorUI.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #import &lt;WebCore/SoftLinking.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -37,21 +38,26 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String WebInspectorUI::localizedStringsURL()
</del><ins>+static String webInspectorUILocalizedStringsURL()
</ins><span class="cx"> {
</span><del>-    if (!m_hasLocalizedStringsURL) {
-        // Call the soft link framework function to dlopen it, then [NSBundle bundleWithIdentifier:] will work.
-        WebInspectorUILibrary();
</del><ins>+    // Call the soft link framework function to dlopen it, then [NSBundle bundleWithIdentifier:] will work.
+    WebInspectorUILibrary();
</ins><span class="cx"> 
</span><del>-        NSString *path = [[NSBundle bundleWithIdentifier:@&quot;com.apple.WebInspectorUI&quot;] pathForResource:@&quot;localizedStrings&quot; ofType:@&quot;js&quot;];
-        if ([path length])
-            m_localizedStringsURL = [[NSURL fileURLWithPath:path] absoluteString];
-        else
-            m_localizedStringsURL = String();
-        m_hasLocalizedStringsURL = true;
-    }
</del><ins>+    NSString *path = [[NSBundle bundleWithIdentifier:@&quot;com.apple.WebInspectorUI&quot;] pathForResource:@&quot;localizedStrings&quot; ofType:@&quot;js&quot;];
+    if (path.length)
+        return [[NSURL fileURLWithPath:path] absoluteString];
</ins><span class="cx"> 
</span><del>-    return m_localizedStringsURL;
</del><ins>+    return String();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebInspectorUI::localizedStringsURL()
+{
+    return webInspectorUILocalizedStringsURL();
+}
+
+String RemoteWebInspectorUI::localizedStringsURL()
+{
+    return webInspectorUILocalizedStringsURL();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>

</body>
</html>