<!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>[197621] trunk/Source/WebKit2</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/197621">197621</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2016-03-05 16:40:09 -0800 (Sat, 05 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement the Automation protocol commands by tracking WebPageProxy objects
that are controlled by automation and assigning them a UUID handle.

https://bugs.webkit.org/show_bug.cgi?id=154953
rdar://problem/24947489

Reviewed by Brian Burg.

* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::didRequestNewWindow):
Return a WebPageProxy instead of void so it can be assigned a UUID handle.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
Return a WKPageRef from _automationSessionDidRequestNewWindow:.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::webPageProxyForHandle):
(WebKit::WebAutomationSession::handleForWebPageProxy):
(WebKit::WebAutomationSession::getBrowsingContexts):
(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::closeBrowsingContext):
(WebKit::WebAutomationSession::switchToBrowsingContext):

* UIProcess/Automation/WebAutomationSession.h:
Added new methods and maps to track pages and handles.

* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::didRequestNewWindow):
Return a WebPageProxy from the WKPageRef.

* UIProcess/WebPageProxy.h: Make setFocus public.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setAutomationSession):
Set the WebProcessPool on the WebAutomationSession so it can be used to find
WebPageProxy objects controlled by automation.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIAutomationSessionClienth">trunk/Source/WebKit2/UIProcess/API/APIAutomationSessionClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKAutomationSessionDelegateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAutomationWebAutomationSessioncpp">trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAutomationWebAutomationSessionh">trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaAutomationSessionClienth">trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaAutomationSessionClientmm">trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -1,5 +1,45 @@
</span><span class="cx"> 2016-03-05  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Implement the Automation protocol commands by tracking WebPageProxy objects
+        that are controlled by automation and assigning them a UUID handle.
+
+        https://bugs.webkit.org/show_bug.cgi?id=154953
+        rdar://problem/24947489
+
+        Reviewed by Brian Burg.
+
+        * UIProcess/API/APIAutomationSessionClient.h:
+        (API::AutomationSessionClient::didRequestNewWindow):
+        Return a WebPageProxy instead of void so it can be assigned a UUID handle.
+
+        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
+        Return a WKPageRef from _automationSessionDidRequestNewWindow:.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::webPageProxyForHandle):
+        (WebKit::WebAutomationSession::handleForWebPageProxy):
+        (WebKit::WebAutomationSession::getBrowsingContexts):
+        (WebKit::WebAutomationSession::createBrowsingContext):
+        (WebKit::WebAutomationSession::closeBrowsingContext):
+        (WebKit::WebAutomationSession::switchToBrowsingContext):
+
+        * UIProcess/Automation/WebAutomationSession.h:
+        Added new methods and maps to track pages and handles.
+
+        * UIProcess/Cocoa/AutomationSessionClient.h:
+        * UIProcess/Cocoa/AutomationSessionClient.mm:
+        (WebKit::AutomationSessionClient::didRequestNewWindow):
+        Return a WebPageProxy from the WKPageRef.
+
+        * UIProcess/WebPageProxy.h: Make setFocus public.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::setAutomationSession):
+        Set the WebProcessPool on the WebAutomationSession so it can be used to find
+        WebPageProxy objects controlled by automation.
+
+2016-03-05  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Rename Automation protocol methods to use &quot;BrowsingContext&quot; instead of &quot;Window&quot;.
</span><span class="cx">         Also flesh out the protocol commands more by adding switchToBrowsingContext
</span><span class="cx">         and return a BrowsingContextHandle for createBrowsingContext.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIAutomationSessionClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIAutomationSessionClient.h (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIAutomationSessionClient.h        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/API/APIAutomationSessionClient.h        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class WebAutomationSession;
</span><ins>+class WebPageProxy;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace API {
</span><span class="lines">@@ -40,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual String sessionIdentifier() const { return String(); }
</span><span class="cx">     virtual void didDisconnectFromRemote(WebKit::WebAutomationSession*) { }
</span><del>-    virtual void didRequestNewWindow(WebKit::WebAutomationSession*) { }
</del><ins>+    virtual WebKit::WebPageProxy* didRequestNewWindow(WebKit::WebAutomationSession*) { return nullptr; }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKAutomationSessionDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -28,12 +28,13 @@
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><span class="cx"> #import &lt;Foundation/Foundation.h&gt;
</span><ins>+#import &lt;WebKit/WKBase.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> @class _WKAutomationSession;
</span><span class="cx"> 
</span><span class="cx"> @protocol _WKAutomationSessionDelegate &lt;NSObject&gt;
</span><span class="cx"> @optional
</span><del>-- (void)_automationSessionDidRequestNewWindow:(_WKAutomationSession *)automationSession;
</del><ins>+- (WKPageRef)_automationSessionDidRequestNewWindow:(_WKAutomationSession *)automationSession;
</ins><span class="cx"> - (void)_automationSessionDidDisconnectFromRemote:(_WKAutomationSession *)automationSession;
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAutomationWebAutomationSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -28,8 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIAutomationSessionClient.h&quot;
</span><span class="cx"> #include &quot;InspectorProtocolObjects.h&quot;
</span><ins>+#include &quot;WebProcessPool.h&quot;
</ins><span class="cx"> #include &lt;JavaScriptCore/InspectorBackendDispatcher.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/InspectorFrontendRouter.h&gt;
</span><ins>+#include &lt;WebCore/UUID.h&gt;
+#include &lt;wtf/HashMap.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace Inspector;
</span><span class="cx"> 
</span><span class="lines">@@ -97,26 +100,92 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(REMOTE_INSPECTOR)
</span><span class="cx"> 
</span><ins>+WebPageProxy* WebAutomationSession::webPageProxyForHandle(const String&amp; handle)
+{
+    auto iter = m_handleWebPageMap.find(handle);
+    if (iter == m_handleWebPageMap.end())
+        return nullptr;
+    return WebProcessProxy::webPage(iter-&gt;value);
+}
+
+String WebAutomationSession::handleForWebPageProxy(WebPageProxy* webPageProxy)
+{
+    auto iter = m_webPageHandleMap.find(webPageProxy-&gt;pageID());
+    if (iter != m_webPageHandleMap.end())
+        return iter-&gt;value;
+
+    String handle = WebCore::createCanonicalUUIDString().convertToASCIIUppercase();
+
+    auto firstAddResult = m_webPageHandleMap.add(webPageProxy-&gt;pageID(), handle);
+    RELEASE_ASSERT(firstAddResult.isNewEntry);
+
+    auto secondAddResult = m_handleWebPageMap.add(handle, webPageProxy-&gt;pageID());
+    RELEASE_ASSERT(secondAddResult.isNewEntry);
+
+    return handle;
+}
+
</ins><span class="cx"> // Inspector::AutomationBackendDispatcherHandler API
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::getBrowsingContexts(Inspector::ErrorString&amp; errorString, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Automation::BrowsingContext&gt;&gt;&amp; contexts)
</span><span class="cx"> {
</span><del>-    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
</del><ins>+    contexts = Inspector::Protocol::Array&lt;Inspector::Protocol::Automation::BrowsingContext&gt;::create();
+
+    for (auto&amp; process : m_processPool-&gt;processes()) {
+        for (auto&amp; page : process-&gt;pages()) {
+            if (!page-&gt;isControlledByAutomation())
+                continue;
+
+            String handle = handleForWebPageProxy(page);
+
+            auto browsingContext = Inspector::Protocol::Automation::BrowsingContext::create()
+                .setHandle(handleForWebPageProxy(page))
+                .setActive(m_activeBrowsingContextHandle == handle)
+                .release();
+
+            contexts-&gt;addItem(browsingContext.copyRef());
+        }
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::createBrowsingContext(Inspector::ErrorString&amp; errorString, String* handle)
</span><span class="cx"> {
</span><del>-    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
</del><ins>+    ASSERT(m_client);
+    if (!m_client)
+        FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InternalError);
+
+    WebPageProxy* page = m_client-&gt;didRequestNewWindow(this);
+    if (!page)
+        FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InternalError);
+
+    m_activeBrowsingContextHandle = *handle = handleForWebPageProxy(page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::closeBrowsingContext(Inspector::ErrorString&amp; errorString, const String&amp; handle)
</span><span class="cx"> {
</span><del>-    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
</del><ins>+    WebPageProxy* page = webPageProxyForHandle(handle);
+    if (!page)
+        FAIL_WITH_PREDEFINED_ERROR_MESSAGE(WindowNotFound);
+
+    if (handle == m_activeBrowsingContextHandle)
+        m_activeBrowsingContextHandle = emptyString();
+
+    // FIXME: Verify this is enough. We still might want to go through the AutomationSessionClient
+    // to get closer to a user pressing the close button.
+    page-&gt;tryClose();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::switchToBrowsingContext(Inspector::ErrorString&amp; errorString, const String&amp; handle)
</span><span class="cx"> {
</span><del>-    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
</del><ins>+    WebPageProxy* page = webPageProxyForHandle(handle);
+    if (!page)
+        FAIL_WITH_PREDEFINED_ERROR_MESSAGE(WindowNotFound);
+
+    m_activeBrowsingContextHandle = handle;
+
+    // FIXME: Verify this is enough. We still might want to go through the AutomationSessionClient
+    // to get closer a user pressing focusing the window / page.
+    page-&gt;setFocus(true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAutomationWebAutomationSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -46,6 +46,8 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class WebAutomationSessionClient;
</span><ins>+class WebPageProxy;
+class WebProcessPool;
</ins><span class="cx"> 
</span><span class="cx"> class WebAutomationSession final : public API::ObjectImpl&lt;API::Object::Type::AutomationSession&gt;
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="lines">@@ -54,6 +56,9 @@
</span><span class="cx">     , public Inspector::AutomationBackendDispatcherHandler
</span><span class="cx"> {
</span><span class="cx"> public:
</span><ins>+    typedef HashMap&lt;uint64_t, String&gt; WebPageHandleMap;
+    typedef HashMap&lt;String, uint64_t&gt; HandleWebPageMap;
+
</ins><span class="cx">     WebAutomationSession();
</span><span class="cx">     ~WebAutomationSession();
</span><span class="cx"> 
</span><span class="lines">@@ -62,6 +67,9 @@
</span><span class="cx">     void setSessionIdentifier(const String&amp; sessionIdentifier) { m_sessionIdentifier = sessionIdentifier; }
</span><span class="cx">     String sessionIdentifier() const { return m_sessionIdentifier; }
</span><span class="cx"> 
</span><ins>+    WebKit::WebProcessPool* processPool() const { return m_processPool; }
+    void setProcessPool(WebKit::WebProcessPool* processPool) { m_processPool = processPool; }
+
</ins><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">     // Inspector::RemoteAutomationTarget API
</span><span class="cx">     String name() const override { return m_sessionIdentifier; }
</span><span class="lines">@@ -77,12 +85,20 @@
</span><span class="cx">     void switchToBrowsingContext(Inspector::ErrorString&amp;, const String&amp;) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    WebKit::WebPageProxy* webPageProxyForHandle(const String&amp;);
+    String handleForWebPageProxy(WebKit::WebPageProxy*);
+
+    WebKit::WebProcessPool* m_processPool { nullptr };
</ins><span class="cx">     std::unique_ptr&lt;API::AutomationSessionClient&gt; m_client;
</span><span class="cx">     String m_sessionIdentifier { ASCIILiteral(&quot;Untitled Session&quot;) };
</span><span class="cx">     Ref&lt;Inspector::FrontendRouter&gt; m_frontendRouter;
</span><span class="cx">     Ref&lt;Inspector::BackendDispatcher&gt; m_backendDispatcher;
</span><span class="cx">     Ref&lt;Inspector::AutomationBackendDispatcher&gt; m_domainDispatcher;
</span><span class="cx"> 
</span><ins>+    WebPageHandleMap m_webPageHandleMap;
+    HandleWebPageMap m_handleWebPageMap;
+    String m_activeBrowsingContextHandle;
+
</ins><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">     Inspector::FrontendChannel* m_remoteChannel { nullptr };
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaAutomationSessionClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.h (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.h        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.h        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // From API::AutomationSessionClient
</span><del>-    void didRequestNewWindow(WebKit::WebAutomationSession*) override;
</del><ins>+    WebPageProxy* didRequestNewWindow(WebKit::WebAutomationSession*) override;
</ins><span class="cx">     void didDisconnectFromRemote(WebKit::WebAutomationSession *) override;
</span><span class="cx"> 
</span><span class="cx">     WeakObjCPtr&lt;id &lt;_WKAutomationSessionDelegate&gt;&gt; m_delegate;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaAutomationSessionClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.mm (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.mm        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/AutomationSessionClient.mm        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -28,7 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><ins>+#import &quot;WKSharedAPICast.h&quot;
</ins><span class="cx"> #import &quot;WebAutomationSession.h&quot;
</span><ins>+#import &quot;WebPageProxy.h&quot;
</ins><span class="cx"> #import &quot;_WKAutomationSessionDelegate.h&quot;
</span><span class="cx"> #import &quot;_WKAutomationSessionInternal.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -41,10 +43,11 @@
</span><span class="cx">     m_delegateMethods.didDisconnectFromRemote = [delegate respondsToSelector:@selector(_automationSessionDidDisconnectFromRemote:)];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AutomationSessionClient::didRequestNewWindow(WebAutomationSession* session)
</del><ins>+WebPageProxy* AutomationSessionClient::didRequestNewWindow(WebAutomationSession* session)
</ins><span class="cx"> {
</span><span class="cx">     if (m_delegateMethods.didRequestNewWindow)
</span><del>-        [m_delegate.get() _automationSessionDidRequestNewWindow:wrapper(*session)];
</del><ins>+        return toImpl([m_delegate.get() _automationSessionDidRequestNewWindow:wrapper(*session)]);
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AutomationSessionClient::didDisconnectFromRemote(WebAutomationSession* session)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -1090,6 +1090,8 @@
</span><span class="cx"> 
</span><span class="cx">     void didRestoreScrollPosition();
</span><span class="cx"> 
</span><ins>+    void setFocus(bool focused);
+
</ins><span class="cx"> private:
</span><span class="cx">     WebPageProxy(PageClient&amp;, WebProcessProxy&amp;, uint64_t pageID, Ref&lt;API::PageConfiguration&gt;&amp;&amp;);
</span><span class="cx">     void platformInitialize();
</span><span class="lines">@@ -1326,7 +1328,6 @@
</span><span class="cx">     void ignoreWord(const String&amp; word);
</span><span class="cx">     void requestCheckingOfString(uint64_t requestID, const WebCore::TextCheckingRequestData&amp;);
</span><span class="cx"> 
</span><del>-    void setFocus(bool focused);
</del><span class="cx">     void takeFocus(uint32_t direction);
</span><span class="cx">     void setToolTip(const String&amp;);
</span><span class="cx">     void setCursor(const WebCore::Cursor&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (197620 => 197621)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-03-06 00:40:01 UTC (rev 197620)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-03-06 00:40:09 UTC (rev 197621)
</span><span class="lines">@@ -1120,8 +1120,10 @@
</span><span class="cx">     m_automationSession = WTFMove(automationSession);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><del>-    if (m_automationSession)
</del><ins>+    if (m_automationSession) {
</ins><span class="cx">         m_automationSession-&gt;init();
</span><ins>+        m_automationSession-&gt;setProcessPool(this);
+    }
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>