<!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>[198736] 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/198736">198736</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2016-03-28 08:56:53 -0700 (Mon, 28 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add WebAutomationSessionProxy for WebProcess side automation tasks

https://bugs.webkit.org/show_bug.cgi?id=155221
rdar://problem/25054868

Reviewed by Joseph Pecoraro.

* CMakeLists.txt: Add build step to build-in WebAutomationSessionProxy.js.
* DerivedSources.make: Ditto.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::~WebAutomationSession):
(WebKit::WebAutomationSession::setProcessPool): Add / remove message receiver.
* UIProcess/Automation/WebAutomationSession.h:

* UIProcess/Automation/WebAutomationSession.messages.in: Added.
Test message to get things to build.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeMessageReceiver):
(WebKit::WebProcessPool::setAutomationSession):
* UIProcess/WebProcessPool.h:

* WebKit2.xcodeproj/project.pbxproj: Added new files.

* WebProcess/Automation/WebAutomationSessionProxy.cpp: Added.
(WebKit::toJSString):
(WebKit::toJSValue):
(WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy):
(WebKit::WebAutomationSessionProxy::~WebAutomationSessionProxy):
(WebKit::evaluate):
(WebKit::createUUID):
(WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
(WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
Create a script object per frame that is evaluated from WebAutomationSessionProxy.js.
Clear the script object when the window object is cleared.

* WebProcess/Automation/WebAutomationSessionProxy.h: Added.
(WebKit::WebAutomationSessionProxy::test):
Added test message to let the messages files build.

* WebProcess/Automation/WebAutomationSessionProxy.js: Added.

* WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
Call WebAutomationSessionProxy::didClearWindowObjectForFrame to clear the script object.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureAutomationSessionProxy):
(WebKit::WebProcess::destroyAutomationSessionProxy):
Creates and destroys the WebAutomationSessionProxy when the UIProcess WebAutomationSession
is set or removed on the WebProcessPool.

* WebProcess/WebProcess.h:
(WebKit::WebProcess::automationSessionProxy): Added.

* WebProcess/WebProcess.messages.in: Added. Test message to get things to build.</pre>

<h3>Modified Paths</h3>
<ul>
<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="#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="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolh">trunk/Source/WebKit2/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessmessagesin">trunk/Source/WebKit2/WebProcess/WebProcess.messages.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAutomationWebAutomationSessionmessagesin">trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.messages.in</a></li>
<li>trunk/Source/WebKit2/WebProcess/Automation/</li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxycpp">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxyh">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxyjs">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js</a></li>
<li><a href="#trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxymessagesin">trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/CMakeLists.txt        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx">     &quot;${WEBKIT2_DIR}/UIProcess/WebsiteData&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/WebProcess&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/WebProcess/ApplicationCache&quot;
</span><ins>+    &quot;${WEBKIT2_DIR}/WebProcess/Automation&quot;
</ins><span class="cx">     &quot;${WEBKIT2_DIR}/WebProcess/Battery&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/WebProcess/Cookies&quot;
</span><span class="cx">     &quot;${WEBKIT2_DIR}/WebProcess/Databases&quot;
</span><span class="lines">@@ -502,6 +503,8 @@
</span><span class="cx">     WebProcess/WebConnectionToUIProcess.cpp
</span><span class="cx">     WebProcess/WebProcess.cpp
</span><span class="cx"> 
</span><ins>+    WebProcess/Automation/WebAutomationSessionProxy.cpp
+
</ins><span class="cx">     WebProcess/Battery/WebBatteryManager.cpp
</span><span class="cx"> 
</span><span class="cx">     WebProcess/Cookies/WebCookieManager.cpp
</span><span class="lines">@@ -673,6 +676,8 @@
</span><span class="cx">     UIProcess/WebResourceLoadStatisticsStore.messages.in
</span><span class="cx">     UIProcess/WebVibrationProxy.messages.in
</span><span class="cx"> 
</span><ins>+    UIProcess/Automation/WebAutomationSession.messages.in
+
</ins><span class="cx">     UIProcess/Databases/DatabaseProcessProxy.messages.in
</span><span class="cx"> 
</span><span class="cx">     UIProcess/Downloads/DownloadProxy.messages.in
</span><span class="lines">@@ -689,6 +694,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebProcess/WebProcess.messages.in
</span><span class="cx"> 
</span><ins>+    WebProcess/Automation/WebAutomationSessionProxy.messages.in
+
</ins><span class="cx">     WebProcess/Battery/WebBatteryManager.messages.in
</span><span class="cx"> 
</span><span class="cx">     WebProcess/Cookies/WebCookieManager.messages.in
</span><span class="lines">@@ -798,6 +805,19 @@
</span><span class="cx">     ${DERIVED_SOURCES_WEBKIT2_DIR}/AutomationProtocolObjects.cpp
</span><span class="cx"> )
</span><span class="cx"> 
</span><ins>+add_custom_command(
+    OUTPUT ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxyScriptSource.h ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js
+    MAIN_DEPENDENCY ${WEBKIT2_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js
+    DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
+    COMMAND ${CMAKE_COMMAND} -E echo &quot;//# sourceURL=__WebAutomationInjectedScript__&quot; &gt; ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js
+    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py &lt; ${WEBKIT2_DIR}/WebProcess/Automation/WebAutomationSessionProxy.js &gt;&gt; ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js
+    COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl WebAutomationSessionProxyScriptSource ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxy.min.js ${DERIVED_SOURCES_WEBKIT2_DIR}/WebAutomationSessionProxyScriptSource.h
+    VERBATIM)
+
+list(APPEND WebKit2_HEADERS
+    ${DERIVED_SOURCES_WEBKIT2_DIR}/WebauotmationSessionProxyScriptSource.h
+)
+
</ins><span class="cx"> WEBKIT_FRAMEWORK(WebKit2)
</span><span class="cx"> add_dependencies(WebKit2 WebCore ${WEBKIT2_EXTRA_DEPENDENCIES})
</span><span class="cx"> add_webkit2_prefix_header(WebKit2)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2016-03-14  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Add WebAutomationSessionProxy for WebProcess side automation tasks
+
+        https://bugs.webkit.org/show_bug.cgi?id=155221
+        rdar://problem/25054868
+
+        Reviewed by Joseph Pecoraro.
+
+        * CMakeLists.txt: Add build step to build-in WebAutomationSessionProxy.js.
+        * DerivedSources.make: Ditto.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::~WebAutomationSession):
+        (WebKit::WebAutomationSession::setProcessPool): Add / remove message receiver.
+        * UIProcess/Automation/WebAutomationSession.h:
+
+        * UIProcess/Automation/WebAutomationSession.messages.in: Added.
+        Test message to get things to build.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::removeMessageReceiver):
+        (WebKit::WebProcessPool::setAutomationSession):
+        * UIProcess/WebProcessPool.h:
+
+        * WebKit2.xcodeproj/project.pbxproj: Added new files.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp: Added.
+        (WebKit::toJSString):
+        (WebKit::toJSValue):
+        (WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy):
+        (WebKit::WebAutomationSessionProxy::~WebAutomationSessionProxy):
+        (WebKit::evaluate):
+        (WebKit::createUUID):
+        (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
+        (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
+        Create a script object per frame that is evaluated from WebAutomationSessionProxy.js.
+        Clear the script object when the window object is cleared.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.h: Added.
+        (WebKit::WebAutomationSessionProxy::test):
+        Added test message to let the messages files build.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.js: Added.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
+        Call WebAutomationSessionProxy::didClearWindowObjectForFrame to clear the script object.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::ensureAutomationSessionProxy):
+        (WebKit::WebProcess::destroyAutomationSessionProxy):
+        Creates and destroys the WebAutomationSessionProxy when the UIProcess WebAutomationSession
+        is set or removed on the WebProcessPool.
+
+        * WebProcess/WebProcess.h:
+        (WebKit::WebProcess::automationSessionProxy): Added.
+
+        * WebProcess/WebProcess.messages.in: Added. Test message to get things to build.
+
</ins><span class="cx"> 2016-03-28  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Tried to fix the build after r198728.
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/DerivedSources.make        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     $(WebKit2)/Shared/Authentication \
</span><span class="cx">     $(WebKit2)/Shared/mac \
</span><span class="cx">     $(WebKit2)/WebProcess/ApplicationCache \
</span><ins>+    $(WebKit2)/WebProcess/Automation \
</ins><span class="cx">     $(WebKit2)/WebProcess/Cookies \
</span><span class="cx">     $(WebKit2)/WebProcess/Databases/IndexedDB \
</span><span class="cx">     $(WebKit2)/WebProcess/FullScreen \
</span><span class="lines">@@ -71,6 +72,15 @@
</span><span class="cx">     $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) \
</span><span class="cx"> #
</span><span class="cx"> 
</span><ins>+PYTHON = python
+PERL = perl
+
+ifeq ($(OS),Windows_NT)
+    DELETE = cmd //C del
+else
+    DELETE = rm -f
+endif
+
</ins><span class="cx"> MESSAGE_RECEIVERS = \
</span><span class="cx">     AuthenticationManager \
</span><span class="cx">     ChildProcess \
</span><span class="lines">@@ -108,6 +118,8 @@
</span><span class="cx">     ViewUpdateDispatcher \
</span><span class="cx">     VisitedLinkStore \
</span><span class="cx">     VisitedLinkTableController \
</span><ins>+    WebAutomationSession \
+    WebAutomationSessionProxy \
</ins><span class="cx">     WebConnection \
</span><span class="cx">     WebCookieManager \
</span><span class="cx">     WebCookieManagerProxy \
</span><span class="lines">@@ -219,3 +231,11 @@
</span><span class="cx">         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-inspector-protocol-bindings.py --framework WebKit --backend --outputDir . $(AUTOMATION_PROTOCOL_INPUT_FILES)
</span><span class="cx"> 
</span><span class="cx"> all : $(firstword $(AUTOMATION_PROTOCOL_OUTPUT_FILES))
</span><ins>+
+%ScriptSource.h : %.js $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl
+        echo &quot;//# sourceURL=__WebAutomationInjectedScript__&quot; &gt; $(basename $(notdir $&lt;)).min.js
+        $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py &lt; $&lt; &gt;&gt; $(basename $(notdir $&lt;)).min.js
+        $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl $(basename $(notdir $&lt;))ScriptSource $(basename $(notdir $&lt;)).min.js $@
+        $(DELETE) $(basename $(notdir $&lt;)).min.js
+
+all : WebAutomationSessionProxyScriptSource.h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAutomationWebAutomationSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIAutomationSessionClient.h&quot;
</span><span class="cx"> #include &quot;AutomationProtocolObjects.h&quot;
</span><ins>+#include &quot;WebAutomationSessionMessages.h&quot;
+#include &quot;WebAutomationSessionProxyMessages.h&quot;
</ins><span class="cx"> #include &quot;WebProcessPool.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/InspectorBackendDispatcher.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/InspectorFrontendRouter.h&gt;
</span><span class="lines">@@ -57,6 +59,9 @@
</span><span class="cx"> WebAutomationSession::~WebAutomationSession()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_client);
</span><ins>+
+    if (m_processPool)
+        m_processPool-&gt;removeMessageReceiver(Messages::WebAutomationSession::messageReceiverName());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebAutomationSession::setClient(std::unique_ptr&lt;API::AutomationSessionClient&gt; client)
</span><span class="lines">@@ -64,6 +69,17 @@
</span><span class="cx">     m_client = WTFMove(client);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebAutomationSession::setProcessPool(WebKit::WebProcessPool* processPool)
+{
+    if (m_processPool)
+        m_processPool-&gt;removeMessageReceiver(Messages::WebAutomationSession::messageReceiverName());
+
+    m_processPool = processPool;
+
+    if (m_processPool)
+        m_processPool-&gt;addMessageReceiver(Messages::WebAutomationSession::messageReceiverName(), *this);
+}
+
</ins><span class="cx"> // NOTE: this class could be split at some point to support local and remote automation sessions.
</span><span class="cx"> // For now, it only works with a remote automation driver over a RemoteInspector connection.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAutomationWebAutomationSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIObject.h&quot;
</span><span class="cx"> #include &quot;AutomationBackendDispatchers.h&quot;
</span><ins>+#include &quot;Connection.h&quot;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="lines">@@ -49,7 +50,7 @@
</span><span class="cx"> class WebPageProxy;
</span><span class="cx"> class WebProcessPool;
</span><span class="cx"> 
</span><del>-class WebAutomationSession final : public API::ObjectImpl&lt;API::Object::Type::AutomationSession&gt;
</del><ins>+class WebAutomationSession final : public API::ObjectImpl&lt;API::Object::Type::AutomationSession&gt;, public IPC::MessageReceiver
</ins><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">     , public Inspector::RemoteAutomationTarget
</span><span class="cx"> #endif
</span><span class="lines">@@ -68,7 +69,7 @@
</span><span class="cx">     String sessionIdentifier() const { return m_sessionIdentifier; }
</span><span class="cx"> 
</span><span class="cx">     WebKit::WebProcessPool* processPool() const { return m_processPool; }
</span><del>-    void setProcessPool(WebKit::WebProcessPool* processPool) { m_processPool = processPool; }
</del><ins>+    void setProcessPool(WebKit::WebProcessPool*);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">     // Inspector::RemoteAutomationTarget API
</span><span class="lines">@@ -93,6 +94,13 @@
</span><span class="cx">     WebKit::WebPageProxy* webPageProxyForHandle(const String&amp;);
</span><span class="cx">     String handleForWebPageProxy(WebKit::WebPageProxy*);
</span><span class="cx"> 
</span><ins>+    // Implemented in generated WebAutomationSessionMessageReceiver.cpp
+    void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
+
+    // Called by WebAutomationSession messages
+    // FIXME: Add message functions here.
+    void test() { };
+
</ins><span class="cx">     WebKit::WebProcessPool* m_processPool { nullptr };
</span><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></pre></div>
<a id="trunkSourceWebKit2UIProcessAutomationWebAutomationSessionmessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.messages.in (0 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.messages.in        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -0,0 +1,26 @@
</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; WebAutomationSession {
+    // FIXME: Add messages here.
+    Test()
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -647,6 +647,9 @@
</span><span class="cx">     if (WebPreferences::anyPagesAreUsingPrivateBrowsing())
</span><span class="cx">         process-&gt;send(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0);
</span><span class="cx"> 
</span><ins>+    if (m_automationSession)
+        process-&gt;send(Messages::WebProcess::EnsureAutomationSessionProxy(m_automationSession-&gt;sessionIdentifier()), 0);
+
</ins><span class="cx">     m_processes.append(process.ptr());
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_messagesToInjectedBundlePostedToEmptyContext.isEmpty());
</span><span class="lines">@@ -992,6 +995,11 @@
</span><span class="cx">     m_messageReceiverMap.addMessageReceiver(messageReceiverName, destinationID, messageReceiver);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebProcessPool::removeMessageReceiver(IPC::StringReference messageReceiverName)
+{
+    m_messageReceiverMap.removeMessageReceiver(messageReceiverName);
+}
+
</ins><span class="cx"> void WebProcessPool::removeMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID)
</span><span class="cx"> {
</span><span class="cx">     m_messageReceiverMap.removeMessageReceiver(messageReceiverName, destinationID);
</span><span class="lines">@@ -1127,7 +1135,10 @@
</span><span class="cx">     if (m_automationSession) {
</span><span class="cx">         m_automationSession-&gt;init();
</span><span class="cx">         m_automationSession-&gt;setProcessPool(this);
</span><del>-    }
</del><ins>+
+        sendToAllProcesses(Messages::WebProcess::EnsureAutomationSessionProxy(m_automationSession-&gt;sessionIdentifier()));
+    } else
+        sendToAllProcesses(Messages::WebProcess::DestroyAutomationSessionProxy());
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -126,6 +126,7 @@
</span><span class="cx"> 
</span><span class="cx">     void addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver&amp;);
</span><span class="cx">     void addMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID, IPC::MessageReceiver&amp;);
</span><ins>+    void removeMessageReceiver(IPC::StringReference messageReceiverName);
</ins><span class="cx">     void removeMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID);
</span><span class="cx"> 
</span><span class="cx">     bool dispatchMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -517,6 +517,13 @@
</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>+                1C0A19461C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */; };
+                1C0A19471C8FF1A800FE0EBB /* WebAutomationSessionProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */; };
+                1C0A19531C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */; };
+                1C0A19541C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A19521C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h */; };
+                1C0A19571C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0A19551C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp */; };
+                1C0A19581C90068F00FE0EBB /* WebAutomationSessionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A19561C90068F00FE0EBB /* WebAutomationSessionMessages.h */; };
+                1C0A195C1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0A195B1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h */; };
</ins><span class="cx">                 1C891D6519B124FF00BA79DD /* WebInspectorUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C891D6219B124FF00BA79DD /* WebInspectorUI.cpp */; };
</span><span class="cx">                 1C891D6619B124FF00BA79DD /* WebInspectorUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C891D6319B124FF00BA79DD /* WebInspectorUI.h */; };
</span><span class="cx">                 1C8E28201275D15400BC7BD0 /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8E281E1275D15400BC7BD0 /* WebInspector.h */; };
</span><span class="lines">@@ -2476,6 +2483,16 @@
</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>+                1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAutomationSessionProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A19481C8FF30E00FE0EBB /* WebAutomationSessionProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebAutomationSessionProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAutomationSessionProxyMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A19521C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A19551C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAutomationSessionMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A19561C90068F00FE0EBB /* WebAutomationSessionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A19591C9006EA00FE0EBB /* WebAutomationSession.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebAutomationSession.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A195A1C91669500FE0EBB /* WebAutomationSessionProxy.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = WebAutomationSessionProxy.js; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1C0A195B1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutomationSessionProxyScriptSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1C77C1951288A872006A742F /* WebInspectorProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebInspectorProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C891D6219B124FF00BA79DD /* WebInspectorUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorUI.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C891D6319B124FF00BA79DD /* WebInspectorUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorUI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4709,6 +4726,17 @@
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                1C0A19431C8FF1A800FE0EBB /* Automation */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1C0A19441C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp */,
+                                1C0A19451C8FF1A800FE0EBB /* WebAutomationSessionProxy.h */,
+                                1C0A195A1C91669500FE0EBB /* WebAutomationSessionProxy.js */,
+                                1C0A19481C8FF30E00FE0EBB /* WebAutomationSessionProxy.messages.in */,
+                        );
+                        path = Automation;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 1F0181681858DC1500F92884 /* Cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -5595,6 +5623,7 @@
</span><span class="cx">                                 9955A6E91C7980BB00EB6A93 /* Automation.json */,
</span><span class="cx">                                 9955A6EA1C7980BB00EB6A93 /* WebAutomationSession.cpp */,
</span><span class="cx">                                 9955A6EB1C7980BB00EB6A93 /* WebAutomationSession.h */,
</span><ins>+                                1C0A19591C9006EA00FE0EBB /* WebAutomationSession.messages.in */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = Automation;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -5654,6 +5683,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 7C6E70F818B2D47E00F24E2E /* cocoa */,
</span><ins>+                                1C0A19431C8FF1A800FE0EBB /* Automation */,
</ins><span class="cx">                                 3309344B1315B93A0097A7BC /* Cookies */,
</span><span class="cx">                                 512A9754180DF9270039A149 /* Databases */,
</span><span class="cx">                                 BCACC43B16B24C5D00B6E092 /* EntryPoint */,
</span><span class="lines">@@ -6875,6 +6905,11 @@
</span><span class="cx">                                 1A60224B18C16B9F00C3E8C9 /* VisitedLinkStoreMessages.h */,
</span><span class="cx">                                 1A8E7D3A18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp */,
</span><span class="cx">                                 1A8E7D3B18C15149005A702A /* VisitedLinkTableControllerMessages.h */,
</span><ins>+                                1C0A19551C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp */,
+                                1C0A19561C90068F00FE0EBB /* WebAutomationSessionMessages.h */,
+                                1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */,
+                                1C0A19521C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h */,
+                                1C0A195B1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h */,
</ins><span class="cx">                                 1A1FEC1A1627B45600700F6D /* WebConnectionMessageReceiver.cpp */,
</span><span class="cx">                                 1A1FEC1B1627B45700700F6D /* WebConnectionMessages.h */,
</span><span class="cx">                                 330934431315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp */,
</span><span class="lines">@@ -7348,6 +7383,7 @@
</span><span class="cx">                                 BC8147A912F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h in Headers */,
</span><span class="cx">                                 BCA8C6B011E3C08700812FB7 /* InjectedBundlePageUIClient.h in Headers */,
</span><span class="cx">                                 9955A6F71C7986E500EB6A93 /* AutomationProtocolObjects.h in Headers */,
</span><ins>+                                1C0A19581C90068F00FE0EBB /* WebAutomationSessionMessages.h in Headers */,
</ins><span class="cx">                                 BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
</span><span class="cx">                                 BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
</span><span class="cx">                                 C58CDF2A1887548B00871536 /* InteractionInformationAtPosition.h in Headers */,
</span><span class="lines">@@ -7364,6 +7400,7 @@
</span><span class="cx">                                 1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */,
</span><span class="cx">                                 CE1A0BD51A48E6C60054EF74 /* ManagedConfigurationSPI.h in Headers */,
</span><span class="cx">                                 51933DEF1965EB31008AC3EA /* MenuUtilities.h in Headers */,
</span><ins>+                                1C0A195C1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h in Headers */,
</ins><span class="cx">                                 1A232903162C867300D82F7A /* MessageDecoder.h in Headers */,
</span><span class="cx">                                 1A2328FF162C866A00D82F7A /* MessageEncoder.h in Headers */,
</span><span class="cx">                                 1AC4C82916B876A90069DCCD /* MessageFlags.h in Headers */,
</span><span class="lines">@@ -7427,6 +7464,7 @@
</span><span class="cx">                                 1A2D843A127F65D5001EB962 /* NPObjectMessageReceiverMessages.h in Headers */,
</span><span class="cx">                                 1A2D82A7127F4EAB001EB962 /* NPObjectProxy.h in Headers */,
</span><span class="cx">                                 1A2D82A9127F4EAB001EB962 /* NPRemoteObjectMap.h in Headers */,
</span><ins>+                                1C0A19471C8FF1A800FE0EBB /* WebAutomationSessionProxy.h in Headers */,
</ins><span class="cx">                                 1A2161B011F37664008AD0F5 /* NPRuntimeObjectMap.h in Headers */,
</span><span class="cx">                                 1A2162B111F38971008AD0F5 /* NPRuntimeUtilities.h in Headers */,
</span><span class="cx">                                 1A2D84A3127F6AD1001EB962 /* NPVariantData.h in Headers */,
</span><span class="lines">@@ -7455,6 +7493,7 @@
</span><span class="cx">                                 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
</span><span class="cx">                                 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
</span><span class="cx">                                 7C3F8C91173AF52D007B7F39 /* PluginInformation.h in Headers */,
</span><ins>+                                1C0A19541C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h in Headers */,
</ins><span class="cx">                                 1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */,
</span><span class="cx">                                 1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
</span><span class="cx">                                 1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */,
</span><span class="lines">@@ -8876,6 +8915,7 @@
</span><span class="cx">                                 1A2D82A4127F4EAB001EB962 /* NPObjectMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A2D8439127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A2D82A6127F4EAB001EB962 /* NPObjectProxy.cpp in Sources */,
</span><ins>+                                1C0A19531C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 1A2D82A8127F4EAB001EB962 /* NPRemoteObjectMap.cpp in Sources */,
</span><span class="cx">                                 1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */,
</span><span class="cx">                                 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */,
</span><span class="lines">@@ -9117,6 +9157,7 @@
</span><span class="cx">                                 1CA8B945127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1C891D6519B124FF00BA79DD /* WebInspectorUI.cpp in Sources */,
</span><span class="cx">                                 1CA8B954127C891500576C2B /* WebInspectorUIMac.mm in Sources */,
</span><ins>+                                1C0A19571C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 1CBBE4A019B66C53006B7D81 /* WebInspectorUIMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 2DA944A11884E4F000ED86DB /* WebIOSEventFactory.mm in Sources */,
</span><span class="cx">                                 C0337DD3127A2A0E008FF4F4 /* WebKeyboardEvent.cpp in Sources */,
</span><span class="lines">@@ -9212,6 +9253,7 @@
</span><span class="cx">                                 1A52C0F71A38CDC70016160A /* WebStorageNamespaceProvider.cpp in Sources */,
</span><span class="cx">                                 BCC5715C115ADAEF001CCAF9 /* WebSystemInterface.mm in Sources */,
</span><span class="cx">                                 51032F18180F73BB00961BB7 /* WebToDatabaseProcessConnection.cpp in Sources */,
</span><ins>+                                1C0A19461C8FF1A800FE0EBB /* WebAutomationSessionProxy.cpp in Sources */,
</ins><span class="cx">                                 C0337DD8127A51B6008FF4F4 /* WebTouchEvent.cpp in Sources */,
</span><span class="cx">                                 2DA944A31884E4F000ED86DB /* WebTouchEventIOS.cpp in Sources */,
</span><span class="cx">                                 BCA0EF8012331E78007D3CFB /* WebUndoStep.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp (0 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -0,0 +1,113 @@
</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;WebAutomationSessionProxy.h&quot;
+
+#include &quot;WebAutomationSessionMessages.h&quot;
+#include &quot;WebAutomationSessionProxyMessages.h&quot;
+#include &quot;WebAutomationSessionProxyScriptSource.h&quot;
+#include &quot;WebFrame.h&quot;
+#include &quot;WebPage.h&quot;
+#include &quot;WebProcess.h&quot;
+#include &lt;JavaScriptCore/JSRetainPtr.h&gt;
+#include &lt;JavaScriptCore/JSStringRefPrivate.h&gt;
+#include &lt;JavaScriptCore/OpaqueJSString.h&gt;
+#include &lt;WebCore/UUID.h&gt;
+
+namespace WebKit {
+
+static inline JSRetainPtr&lt;JSStringRef&gt; toJSString(const String&amp; string)
+{
+    return JSRetainPtr&lt;JSStringRef&gt;(Adopt, OpaqueJSString::create(string).leakRef());
+}
+
+static inline JSValueRef toJSValue(JSContextRef context, const String&amp; string)
+{
+    return JSValueMakeString(context, toJSString(string).get());
+}
+
+WebAutomationSessionProxy::WebAutomationSessionProxy(const String&amp; sessionIdentifier)
+    : m_sessionIdentifier(sessionIdentifier)
+{
+    WebProcess::singleton().addMessageReceiver(Messages::WebAutomationSessionProxy::messageReceiverName(), *this);
+}
+
+WebAutomationSessionProxy::~WebAutomationSessionProxy()
+{
+    WebProcess::singleton().removeMessageReceiver(Messages::WebAutomationSessionProxy::messageReceiverName());
+}
+
+static JSValueRef evaluate(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    ASSERT_ARG(argumentCount, argumentCount == 1);
+    ASSERT_ARG(arguments, JSValueIsString(context, arguments[0]));
+
+    if (argumentCount != 1)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr&lt;JSStringRef&gt; script(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    return JSEvaluateScript(context, script.get(), nullptr, nullptr, 0, exception);
+}
+
+static JSValueRef createUUID(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    return toJSValue(context, WebCore::createCanonicalUUIDString().convertToASCIIUppercase());
+}
+
+JSObjectRef WebAutomationSessionProxy::scriptObjectForFrame(WebFrame&amp; frame)
+{
+    if (JSObjectRef scriptObject = m_webFrameScriptObjectMap.get(frame.frameID()))
+        return scriptObject;
+
+    JSValueRef exception = nullptr;
+    JSGlobalContextRef context = frame.jsContext();
+
+    JSValueRef sessionIdentifier = toJSValue(context, m_sessionIdentifier);
+    JSObjectRef evaluateFunction = JSObjectMakeFunctionWithCallback(context, nullptr, evaluate);
+    JSObjectRef createUUIDFunction = JSObjectMakeFunctionWithCallback(context, nullptr, createUUID);
+
+    String script = StringImpl::createWithoutCopying(WebAutomationSessionProxyScriptSource, sizeof(WebAutomationSessionProxyScriptSource));
+
+    JSObjectRef scriptObjectFunction = const_cast&lt;JSObjectRef&gt;(JSEvaluateScript(context, toJSString(script).get(), nullptr, nullptr, 0, &amp;exception));
+    ASSERT(JSValueIsObject(context, scriptObjectFunction));
+
+    JSValueRef arguments[] = { sessionIdentifier, evaluateFunction, createUUIDFunction };
+    JSObjectRef scriptObject = const_cast&lt;JSObjectRef&gt;(JSObjectCallAsFunction(context, scriptObjectFunction, nullptr, WTF_ARRAY_LENGTH(arguments), arguments, &amp;exception));
+    ASSERT(JSValueIsObject(context, scriptObject));
+
+    JSValueProtect(context, scriptObject);
+    m_webFrameScriptObjectMap.add(frame.frameID(), scriptObject);
+
+    return scriptObject;
+}
+
+void WebAutomationSessionProxy::didClearWindowObjectForFrame(WebFrame&amp; frame)
+{
+    if (JSObjectRef scriptObject = m_webFrameScriptObjectMap.take(frame.frameID()))
+        JSValueUnprotect(frame.jsContext(), scriptObject);
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxyh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h (0 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.h        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -0,0 +1,64 @@
</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.
+ */
+
+#ifndef WebAutomationSessionProxy_h
+#define WebAutomationSessionProxy_h
+
+#include &quot;Connection.h&quot;
+#include &lt;JavaScriptCore/JSBase.h&gt;
+
+namespace WebKit {
+
+class WebFrame;
+class WebPage;
+
+class WebAutomationSessionProxy : public IPC::MessageReceiver {
+public:
+    WebAutomationSessionProxy(const String&amp; sessionIdentifier);
+    ~WebAutomationSessionProxy();
+
+    String sessionIdentifier() const { return m_sessionIdentifier; }
+
+    void didClearWindowObjectForFrame(WebFrame&amp;);
+
+private:
+    JSObjectRef scriptObjectForFrame(WebFrame&amp;);
+
+    // Implemented in generated WebAutomationSessionProxyMessageReceiver.cpp
+    void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
+
+    // Called by WebAutomationSessionProxy messages
+    // FIXME: Add message functions here.
+    void test() { };
+
+    String m_sessionIdentifier;
+
+    typedef HashMap&lt;uint64_t, JSObjectRef&gt; WebFrameScriptObjectMap;
+    WebFrameScriptObjectMap m_webFrameScriptObjectMap;
+};
+
+} // namespace WebKit
+
+#endif // WebAutomationSessionProxy_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxyjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js (0 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -0,0 +1,42 @@
</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.
+ */
+
+//# sourceURL=__WebAutomationInjectedScript__
+
+(function (sessionIdentifier, evaluate, createUUID) {
+
+// Protect against Object overwritten by the page.
+let Object = {}.constructor;
+
+let AutomationSessionProxy = class AutomationSessionProxy
+{
+    // Public
+
+    // FIXME: Add functions here.
+};
+
+return new AutomationSessionProxy;
+
+})
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessAutomationWebAutomationSessionProxymessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in (0 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.messages.in        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -0,0 +1,26 @@
</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; WebAutomationSessionProxy {
+    // FIXME: Add messages here.
+    Test()
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;PluginView.h&quot;
</span><span class="cx"> #include &quot;UserData.h&quot;
</span><span class="cx"> #include &quot;WKBundleAPICast.h&quot;
</span><ins>+#include &quot;WebAutomationSessionProxy.h&quot;
</ins><span class="cx"> #include &quot;WebBackForwardListProxy.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebDocumentLoader.h&quot;
</span><span class="lines">@@ -1579,6 +1580,9 @@
</span><span class="cx"> 
</span><span class="cx">     webPage-&gt;injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world);
</span><span class="cx"> 
</span><ins>+    if (auto automationSessionProxy = WebProcess::singleton().automationSessionProxy())
+        automationSessionProxy-&gt;didClearWindowObjectForFrame(*m_frame);
+
</ins><span class="cx"> #if HAVE(ACCESSIBILITY) &amp;&amp; (PLATFORM(GTK) || PLATFORM(EFL))
</span><span class="cx">     // Ensure the accessibility hierarchy is updated.
</span><span class="cx">     webPage-&gt;updateAccessibilityTree();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &quot;SessionTracker.h&quot;
</span><span class="cx"> #include &quot;StatisticsData.h&quot;
</span><span class="cx"> #include &quot;UserData.h&quot;
</span><ins>+#include &quot;WebAutomationSessionProxy.h&quot;
</ins><span class="cx"> #include &quot;WebConnectionToUIProcess.h&quot;
</span><span class="cx"> #include &quot;WebCookieManager.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="lines">@@ -1438,6 +1439,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void WebProcess::ensureAutomationSessionProxy(const String&amp; sessionIdentifier)
+{
+    m_automationSessionProxy = std::make_unique&lt;WebAutomationSessionProxy&gt;(sessionIdentifier);
+}
+
+void WebProcess::destroyAutomationSessionProxy()
+{
+    m_automationSessionProxy = nullptr;
+}
+
</ins><span class="cx"> void WebProcess::prefetchDNS(const String&amp; hostname)
</span><span class="cx"> {
</span><span class="cx">     if (hostname.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx"> class NetworkProcessConnection;
</span><span class="cx"> class ObjCObjectGraph;
</span><span class="cx"> class UserData;
</span><ins>+class WebAutomationSessionProxy;
</ins><span class="cx"> class WebConnectionToUIProcess;
</span><span class="cx"> class WebFrame;
</span><span class="cx"> class WebIconDatabaseProxy;
</span><span class="lines">@@ -210,6 +211,8 @@
</span><span class="cx"> 
</span><span class="cx">     void prefetchDNS(const String&amp;);
</span><span class="cx"> 
</span><ins>+    WebAutomationSessionProxy* automationSessionProxy() { return m_automationSessionProxy.get(); }
+
</ins><span class="cx"> private:
</span><span class="cx">     WebProcess();
</span><span class="cx">     ~WebProcess();
</span><span class="lines">@@ -284,6 +287,9 @@
</span><span class="cx">     enum class ShouldAcknowledgeWhenReadyToSuspend { No, Yes };
</span><span class="cx">     void actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend);
</span><span class="cx"> 
</span><ins>+    void ensureAutomationSessionProxy(const String&amp; sessionIdentifier);
+    void destroyAutomationSessionProxy();
+
</ins><span class="cx">     // ChildProcess
</span><span class="cx">     void initializeProcess(const ChildProcessInitializationParameters&amp;) override;
</span><span class="cx">     void initializeProcessName(const ChildProcessInitializationParameters&amp;) override;
</span><span class="lines">@@ -353,6 +359,8 @@
</span><span class="cx">     HashSet&lt;String&gt; m_dnsPrefetchedHosts;
</span><span class="cx">     WebCore::HysteresisActivity m_dnsPrefetchHystereris;
</span><span class="cx"> 
</span><ins>+    std::unique_ptr&lt;WebAutomationSessionProxy&gt; m_automationSessionProxy;
+
</ins><span class="cx"> #if ENABLE(DATABASE_PROCESS)
</span><span class="cx">     void ensureWebToDatabaseProcessConnection();
</span><span class="cx">     RefPtr&lt;WebToDatabaseProcessConnection&gt; m_webToDatabaseProcessConnection;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (198735 => 198736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2016-03-28 15:23:01 UTC (rev 198735)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2016-03-28 15:56:53 UTC (rev 198736)
</span><span class="lines">@@ -92,6 +92,9 @@
</span><span class="cx">     SetEnabledServices(bool hasImageServices, bool hasSelectionServices, bool hasRichContentServices)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    EnsureAutomationSessionProxy(String sessionIdentifier)
+    DestroyAutomationSessionProxy()
+
</ins><span class="cx">     ProcessWillSuspendImminently() -&gt; (bool handled)
</span><span class="cx">     PrepareToSuspend()
</span><span class="cx">     CancelPrepareToSuspend()
</span></span></pre>
</div>
</div>

</body>
</html>