<!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>[215212] trunk</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/215212">215212</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-04-10 17:40:00 -0700 (Mon, 10 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/195479">r195479</a>) First main resource load in new WebProcess bypasses content extensions
https://bugs.webkit.org/show_bug.cgi?id=170707
&lt;rdar://problem/27788755&gt;

Patch by Alex Christensen &lt;achristensen@webkit.org&gt; on 2017-04-10
Reviewed by Tim Horton.

Source/WebKit2:

We fix this by sending the UserContentController with the WebPageCreationParameters
instead of in a IPC message immediately following creation.  By the time the WebPage
receives its second message, it has already started loading the first main resource.

I also changed all instances of calling ChildProcessProxy::connection() to send a message
in favor of calling ChildProcessProxy::send, which does the same thing except if a child
process has not started, it will put the message in a queue and send it when the process
is finished launching.  This was necessary because the UserContentController is now connected
to the process sooner, so there were some API tests that would try to send messages between
initiating a process launch and finishing a process launch, and this change preserves the
existing behavior in those cases.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
(WebKit::DatabaseProcessProxy::didFinishLaunching):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::cancel):
(WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
(WebKit::DownloadProxy::willSendRequest):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
(WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
(WebKit::WebUserContentControllerProxy::addUserScript):
(WebKit::WebUserContentControllerProxy::removeUserScript):
(WebKit::WebUserContentControllerProxy::removeAllUserScripts):
(WebKit::WebUserContentControllerProxy::addUserStyleSheet):
(WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
(WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
(WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
(WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
(WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
(WebKit::WebUserContentControllerProxy::addContentExtension):
(WebKit::WebUserContentControllerProxy::removeContentExtension):
(WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::removeAll):
(WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
(WebKit::VisitedLinkStore::sendTable):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addWebUserContentControllerProxy):
* UIProcess/WebProcessProxy.h:
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_backgroundCPULimit):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm:
(-[ContentExtensionDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST_F):
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(-[ContentBlockingWebsitePoliciesDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(-[ContentBlockingWebsitePoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPageCreationParameterscpp">trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPageCreationParametersh">trunk/Source/WebKit2/Shared/WebPageCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDatabasesDatabaseProcessProxycpp">trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDownloadsDownloadProxycpp">trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp">trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh">trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessVisitedLinkStorecpp">trunk/Source/WebKit2/UIProcess/VisitedLinkStore.cpp</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="#trunkSourceWebKit2UIProcessWebProcessProxyh">trunk/Source/WebKit2/UIProcess/WebProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessUserContentWebUserContentControllerh">trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaWKUserContentExtensionStoremm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaWebsitePoliciesmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/ChangeLog        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -1,5 +1,68 @@
</span><span class="cx"> 2017-04-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions
+        https://bugs.webkit.org/show_bug.cgi?id=170707
+        &lt;rdar://problem/27788755&gt;
+
+        Reviewed by Tim Horton.
+
+        We fix this by sending the UserContentController with the WebPageCreationParameters
+        instead of in a IPC message immediately following creation.  By the time the WebPage
+        receives its second message, it has already started loading the first main resource.
+        
+        I also changed all instances of calling ChildProcessProxy::connection() to send a message
+        in favor of calling ChildProcessProxy::send, which does the same thing except if a child
+        process has not started, it will put the message in a queue and send it when the process
+        is finished launching.  This was necessary because the UserContentController is now connected
+        to the process sooner, so there were some API tests that would try to send messages between
+        initiating a process launch and finishing a process launch, and this change preserves the
+        existing behavior in those cases.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * UIProcess/Databases/DatabaseProcessProxy.cpp:
+        (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
+        (WebKit::DatabaseProcessProxy::didFinishLaunching):
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::cancel):
+        (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
+        (WebKit::DownloadProxy::willSendRequest):
+        (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
+        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
+        (WebKit::WebUserContentControllerProxy::addProcess):
+        (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
+        (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
+        (WebKit::WebUserContentControllerProxy::addUserScript):
+        (WebKit::WebUserContentControllerProxy::removeUserScript):
+        (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
+        (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
+        (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
+        (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
+        (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
+        (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
+        (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
+        (WebKit::WebUserContentControllerProxy::addContentExtension):
+        (WebKit::WebUserContentControllerProxy::removeContentExtension):
+        (WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
+        * UIProcess/UserContent/WebUserContentControllerProxy.h:
+        * UIProcess/VisitedLinkStore.cpp:
+        (WebKit::VisitedLinkStore::removeAll):
+        (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
+        (WebKit::VisitedLinkStore::sendTable):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
+        (WebKit::WebPageProxy::creationParameters):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
+        * UIProcess/WebProcessProxy.h:
+        * WebProcess/UserContent/WebUserContentController.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_backgroundCPULimit):
+
+2017-04-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
</ins><span class="cx">         Add API to get available content extension identifiers in a WKContentExtensionStore
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=170093
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPageCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -101,6 +101,13 @@
</span><span class="cx">     encoder &lt;&lt; enumeratingAllNetworkInterfacesEnabled;
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><ins>+    encoder &lt;&lt; userContentWorlds;
+    encoder &lt;&lt; userScripts;
+    encoder &lt;&lt; userStyleSheets;
+    encoder &lt;&lt; messageHandlers;
+#if ENABLE(CONTENT_EXTENSIONS)
+    encoder &lt;&lt; contentExtensions;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebPageCreationParameters::decode(IPC::Decoder&amp; decoder, WebPageCreationParameters&amp; parameters)
</span><span class="lines">@@ -237,6 +244,18 @@
</span><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><ins>+    if (!decoder.decode(parameters.userContentWorlds))
+        return false;
+    if (!decoder.decode(parameters.userScripts))
+        return false;
+    if (!decoder.decode(parameters.userStyleSheets))
+        return false;
+    if (!decoder.decode(parameters.messageHandlers))
+        return false;
+#if ENABLE(CONTENT_EXTENSIONS)
+    if (!decoder.decode(parameters.contentExtensions))
+        return false;
+#endif
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPageCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -23,15 +23,16 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef WebPageCreationParameters_h
-#define WebPageCreationParameters_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;DrawingAreaInfo.h&quot;
</span><span class="cx"> #include &quot;LayerTreeContext.h&quot;
</span><span class="cx"> #include &quot;SessionState.h&quot;
</span><ins>+#include &quot;WebCompiledContentExtensionData.h&quot;
</ins><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebPageGroupData.h&quot;
</span><span class="cx"> #include &quot;WebPreferencesStore.h&quot;
</span><ins>+#include &quot;WebUserContentControllerDataTypes.h&quot;
</ins><span class="cx"> #include &lt;WebCore/ActivityState.h&gt;
</span><span class="cx"> #include &lt;WebCore/Color.h&gt;
</span><span class="cx"> #include &lt;WebCore/FloatSize.h&gt;
</span><span class="lines">@@ -156,8 +157,15 @@
</span><span class="cx">     bool enumeratingAllNetworkInterfacesEnabled { false };
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><ins>+
+    // UserContentController members
+    Vector&lt;std::pair&lt;uint64_t, String&gt;&gt; userContentWorlds;
+    Vector&lt;WebUserScriptData&gt; userScripts;
+    Vector&lt;WebUserStyleSheetData&gt; userStyleSheets;
+    Vector&lt;WebScriptMessageHandlerData&gt; messageHandlers;
+#if ENABLE(CONTENT_EXTENSIONS)
+    Vector&lt;std::pair&lt;String, WebCompiledContentExtensionData&gt;&gt; contentExtensions;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><del>-
-#endif // WebPageCreationParameters_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDatabasesDatabaseProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    connection()-&gt;send(Messages::DatabaseProcess::CreateDatabaseToWebProcessConnection(), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
</del><ins>+    send(Messages::DatabaseProcess::CreateDatabaseToWebProcessConnection(), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DatabaseProcessProxy::didClose(IPC::Connection&amp;)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; m_numPendingConnectionRequests; ++i)
</span><del>-        connection()-&gt;send(Messages::DatabaseProcess::CreateDatabaseToWebProcessConnection(), 0);
</del><ins>+        send(Messages::DatabaseProcess::CreateDatabaseToWebProcessConnection(), 0);
</ins><span class="cx">     
</span><span class="cx">     m_numPendingConnectionRequests = 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDownloadsDownloadProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (NetworkProcessProxy* networkProcess = m_processPool-&gt;networkProcess())
</span><del>-        networkProcess-&gt;connection()-&gt;send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
</del><ins>+        networkProcess-&gt;send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DownloadProxy::invalidate()
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool result = m_processPool-&gt;downloadClient().canAuthenticateAgainstProtectionSpace(getPtr(WebProtectionSpace::create(protectionSpace)));
</span><span class="cx">     
</span><del>-    networkProcessProxy-&gt;connection()-&gt;send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpaceDownload(m_downloadID, result), 0);
</del><ins>+    networkProcessProxy-&gt;send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpaceDownload(m_downloadID, result), 0);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">         if (!networkProcessProxy)
</span><span class="cx">             return;
</span><span class="cx">         
</span><del>-        networkProcessProxy-&gt;connection()-&gt;send(Messages::NetworkProcess::ContinueWillSendRequest(protectedThis-&gt;m_downloadID, newRequest), 0);
</del><ins>+        networkProcessProxy-&gt;send(Messages::NetworkProcess::ContinueWillSendRequest(protectedThis-&gt;m_downloadID, newRequest), 0);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">         SandboxExtension::createHandle(destination, SandboxExtension::ReadWrite, sandboxExtensionHandle);
</span><span class="cx"> 
</span><span class="cx">     if (NetworkProcessProxy* networkProcess = m_processPool-&gt;networkProcess())
</span><del>-        networkProcess-&gt;connection()-&gt;send(Messages::NetworkProcess::ContinueDecidePendingDownloadDestination(downloadID, destination, sandboxExtensionHandle, allowOverwrite), 0);
</del><ins>+        networkProcess-&gt;send(Messages::NetworkProcess::ContinueDecidePendingDownloadDestination(downloadID, destination, sandboxExtensionHandle, allowOverwrite), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !USE(NETWORK_SESSION)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -67,40 +67,33 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebUserContentControllerProxy::addProcess(WebProcessProxy&amp; webProcessProxy)
</del><ins>+void WebUserContentControllerProxy::addProcess(WebProcessProxy&amp; webProcessProxy, WebPageCreationParameters&amp; parameters)
</ins><span class="cx"> {
</span><del>-    ASSERT(webProcessProxy.state() == WebProcessProxy::State::Running);
-
</del><span class="cx">     if (!m_processes.add(&amp;webProcessProxy).isNewEntry)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     webProcessProxy.addMessageReceiver(Messages::WebUserContentControllerProxy::messageReceiverName(), m_identifier, *this);
</span><span class="cx"> 
</span><del>-    Vector&lt;std::pair&lt;uint64_t, String&gt;&gt; userContentWorlds;
</del><ins>+    ASSERT(parameters.userContentWorlds.isEmpty());
</ins><span class="cx">     for (const auto&amp; world : m_userContentWorlds)
</span><del>-        userContentWorlds.append(std::make_pair(world.key-&gt;identifier(), world.key-&gt;name()));
-    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserContentWorlds(userContentWorlds), m_identifier);
</del><ins>+        parameters.userContentWorlds.append(std::make_pair(world.key-&gt;identifier(), world.key-&gt;name()));
</ins><span class="cx"> 
</span><del>-    Vector&lt;WebUserScriptData&gt; userScripts;
</del><ins>+    ASSERT(parameters.userScripts.isEmpty());
</ins><span class="cx">     for (const auto&amp; userScript : m_userScripts-&gt;elementsOfType&lt;API::UserScript&gt;())
</span><del>-        userScripts.append({ userScript-&gt;identifier(), userScript-&gt;userContentWorld().identifier(), userScript-&gt;userScript() });
-    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserScripts(userScripts), m_identifier);
</del><ins>+        parameters.userScripts.append({ userScript-&gt;identifier(), userScript-&gt;userContentWorld().identifier(), userScript-&gt;userScript() });
</ins><span class="cx"> 
</span><del>-    Vector&lt;WebUserStyleSheetData&gt; userStyleSheets;
</del><ins>+    ASSERT(parameters.userStyleSheets.isEmpty());
</ins><span class="cx">     for (const auto&amp; userStyleSheet : m_userStyleSheets-&gt;elementsOfType&lt;API::UserStyleSheet&gt;())
</span><del>-        userStyleSheets.append({ userStyleSheet-&gt;identifier(), userStyleSheet-&gt;userContentWorld().identifier(), userStyleSheet-&gt;userStyleSheet() });
-    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserStyleSheets(userStyleSheets), m_identifier);
</del><ins>+        parameters.userStyleSheets.append({ userStyleSheet-&gt;identifier(), userStyleSheet-&gt;userContentWorld().identifier(), userStyleSheet-&gt;userStyleSheet() });
</ins><span class="cx"> 
</span><del>-    Vector&lt;WebScriptMessageHandlerData&gt; messageHandlers;
</del><ins>+    ASSERT(parameters.messageHandlers.isEmpty());
</ins><span class="cx">     for (auto&amp; handler : m_scriptMessageHandlers.values())
</span><del>-        messageHandlers.append({ handler-&gt;identifier(), handler-&gt;userContentWorld().identifier(), handler-&gt;name() });
-    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserScriptMessageHandlers(messageHandlers), m_identifier);
</del><ins>+        parameters.messageHandlers.append({ handler-&gt;identifier(), handler-&gt;userContentWorld().identifier(), handler-&gt;name() });
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    Vector&lt;std::pair&lt;String, WebCompiledContentExtensionData&gt;&gt; contentExtensions;
</del><ins>+    ASSERT(parameters.contentExtensions.isEmpty());
</ins><span class="cx">     for (const auto&amp; contentExtension : m_contentExtensions.values())
</span><del>-        contentExtensions.append(std::make_pair(contentExtension-&gt;name(), contentExtension-&gt;compiledExtension().data()));
-    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddContentExtensions(contentExtensions), m_identifier);
</del><ins>+        parameters.contentExtensions.append(std::make_pair(contentExtension-&gt;name(), contentExtension-&gt;compiledExtension().data()));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -120,7 +113,7 @@
</span><span class="cx">     auto addResult = m_userContentWorlds.add(&amp;world);
</span><span class="cx">     if (addResult.isNewEntry) {
</span><span class="cx">         for (WebProcessProxy* process : m_processes)
</span><del>-            process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserContentWorlds({ std::make_pair(world.identifier(), world.name()) }), m_identifier);
</del><ins>+            process-&gt;send(Messages::WebUserContentController::AddUserContentWorlds({ std::make_pair(world.identifier(), world.name()) }), m_identifier);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -144,7 +137,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (shouldSendRemoveUserContentWorldsMessage(world, numberOfUsesToRemove)) {
</span><span class="cx">         for (WebProcessProxy* process : m_processes)
</span><del>-            process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserContentWorlds({ world.identifier() }), m_identifier);
</del><ins>+            process-&gt;send(Messages::WebUserContentController::RemoveUserContentWorlds({ world.identifier() }), m_identifier);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -157,7 +150,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserContentWorlds(worldsToRemove), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveUserContentWorlds(worldsToRemove), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebUserContentControllerProxy::addUserScript(API::UserScript&amp; userScript)
</span><span class="lines">@@ -169,7 +162,7 @@
</span><span class="cx">     m_userScripts-&gt;elements().append(&amp;userScript);
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserScripts({ { userScript.identifier(), world-&gt;identifier(), userScript.userScript() } }), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::AddUserScripts({ { userScript.identifier(), world-&gt;identifier(), userScript.userScript() } }), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebUserContentControllerProxy::removeUserScript(API::UserScript&amp; userScript)
</span><span class="lines">@@ -177,7 +170,7 @@
</span><span class="cx">     Ref&lt;API::UserContentWorld&gt; world = userScript.userContentWorld();
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserScript(world-&gt;identifier(), userScript.identifier()), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveUserScript(world-&gt;identifier(), userScript.identifier()), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">     m_userScripts-&gt;elements().removeAll(&amp;userScript);
</span><span class="cx"> 
</span><span class="lines">@@ -187,7 +180,7 @@
</span><span class="cx"> void WebUserContentControllerProxy::removeAllUserScripts(API::UserContentWorld&amp; world)
</span><span class="cx"> {
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserScripts({ world.identifier() }), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveAllUserScripts({ world.identifier() }), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">     unsigned userScriptsRemoved = m_userScripts-&gt;removeAllOfTypeMatching&lt;API::UserScript&gt;([&amp;](const auto&amp; userScript) {
</span><span class="cx">         return &amp;userScript-&gt;userContentWorld() == &amp;world;
</span><span class="lines">@@ -208,7 +201,7 @@
</span><span class="cx">         worldIdentifiers.uncheckedAppend(worldCountPair.key-&gt;identifier());
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserScripts(worldIdentifiers), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveAllUserScripts(worldIdentifiers), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">     m_userScripts-&gt;elements().clear();
</span><span class="cx"> 
</span><span class="lines">@@ -224,7 +217,7 @@
</span><span class="cx">     m_userStyleSheets-&gt;elements().append(&amp;userStyleSheet);
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserStyleSheets({ { userStyleSheet.identifier(), world-&gt;identifier(), userStyleSheet.userStyleSheet() } }), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::AddUserStyleSheets({ { userStyleSheet.identifier(), world-&gt;identifier(), userStyleSheet.userStyleSheet() } }), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebUserContentControllerProxy::removeUserStyleSheet(API::UserStyleSheet&amp; userStyleSheet)
</span><span class="lines">@@ -232,7 +225,7 @@
</span><span class="cx">     Ref&lt;API::UserContentWorld&gt; world = userStyleSheet.userContentWorld();
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserStyleSheet(world-&gt;identifier(), userStyleSheet.identifier()), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveUserStyleSheet(world-&gt;identifier(), userStyleSheet.identifier()), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">     m_userStyleSheets-&gt;elements().removeAll(&amp;userStyleSheet);
</span><span class="cx"> 
</span><span class="lines">@@ -242,7 +235,7 @@
</span><span class="cx"> void WebUserContentControllerProxy::removeAllUserStyleSheets(API::UserContentWorld&amp; world)
</span><span class="cx"> {
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserStyleSheets({ world.identifier() }), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveAllUserStyleSheets({ world.identifier() }), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">     unsigned userStyleSheetsRemoved = m_userStyleSheets-&gt;removeAllOfTypeMatching&lt;API::UserStyleSheet&gt;([&amp;](const auto&amp; userStyleSheet) {
</span><span class="cx">         return &amp;userStyleSheet-&gt;userContentWorld() == &amp;world;
</span><span class="lines">@@ -263,7 +256,7 @@
</span><span class="cx">         worldIdentifiers.uncheckedAppend(worldCountPair.key-&gt;identifier());
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserStyleSheets(worldIdentifiers), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveAllUserStyleSheets(worldIdentifiers), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">     m_userStyleSheets-&gt;elements().clear();
</span><span class="cx"> 
</span><span class="lines">@@ -284,7 +277,7 @@
</span><span class="cx">     m_scriptMessageHandlers.add(handler.identifier(), &amp;handler);
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserScriptMessageHandlers({ { handler.identifier(), world-&gt;identifier(), handler.name() } }), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::AddUserScriptMessageHandlers({ { handler.identifier(), world-&gt;identifier(), handler.name() } }), m_identifier);
</ins><span class="cx">     
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -294,7 +287,7 @@
</span><span class="cx">     for (auto it = m_scriptMessageHandlers.begin(), end = m_scriptMessageHandlers.end(); it != end; ++it) {
</span><span class="cx">         if (it-&gt;value-&gt;name() == name &amp;&amp; &amp;it-&gt;value-&gt;userContentWorld() == &amp;world) {
</span><span class="cx">             for (WebProcessProxy* process : m_processes)
</span><del>-                process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserScriptMessageHandler(world.identifier(), it-&gt;value-&gt;identifier()), m_identifier);
</del><ins>+                process-&gt;send(Messages::WebUserContentController::RemoveUserScriptMessageHandler(world.identifier(), it-&gt;value-&gt;identifier()), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">             m_scriptMessageHandlers.remove(it);
</span><span class="cx"> 
</span><span class="lines">@@ -307,7 +300,7 @@
</span><span class="cx"> void WebUserContentControllerProxy::removeAllUserMessageHandlers(API::UserContentWorld&amp; world)
</span><span class="cx"> {
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserScriptMessageHandlers({ world.identifier() }), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveAllUserScriptMessageHandlers({ world.identifier() }), m_identifier);
</ins><span class="cx"> 
</span><span class="cx">     unsigned numberRemoved = 0;
</span><span class="cx">     m_scriptMessageHandlers.removeIf([&amp;](auto&amp; entry) {
</span><span class="lines">@@ -345,7 +338,7 @@
</span><span class="cx">     auto pair = std::make_pair(contentExtension.name(), contentExtension.compiledExtension().data());
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddContentExtensions({ pair }), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::AddContentExtensions({ pair }), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebUserContentControllerProxy::removeContentExtension(const String&amp; name)
</span><span class="lines">@@ -353,7 +346,7 @@
</span><span class="cx">     m_contentExtensions.remove(name);
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveContentExtension(name), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveContentExtension(name), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebUserContentControllerProxy::removeAllContentExtensions()
</span><span class="lines">@@ -361,7 +354,7 @@
</span><span class="cx">     m_contentExtensions.clear();
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllContentExtensions(), m_identifier);
</del><ins>+        process-&gt;send(Messages::WebUserContentController::RemoveAllContentExtensions(), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx"> class WebScriptMessageHandler;
</span><span class="cx"> struct FrameInfoData;
</span><ins>+struct WebPageCreationParameters;
</ins><span class="cx"> 
</span><span class="cx"> class WebUserContentControllerProxy : public API::ObjectImpl&lt;API::Object::Type::UserContentController&gt;, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span><span class="lines">@@ -68,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx">     uint64_t identifier() const { return m_identifier; }
</span><span class="cx"> 
</span><del>-    void addProcess(WebProcessProxy&amp;);
</del><ins>+    void addProcess(WebProcessProxy&amp;, WebPageCreationParameters&amp;);
</ins><span class="cx">     void removeProcess(WebProcessProxy&amp;);
</span><span class="cx"> 
</span><span class="cx">     API::Array&amp; userScripts() { return m_userScripts.get(); }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessVisitedLinkStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/VisitedLinkStore.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/VisitedLinkStore.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/VisitedLinkStore.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes) {
</span><span class="cx">         ASSERT(process-&gt;processPool().processes().contains(process));
</span><del>-        process-&gt;connection()-&gt;send(Messages::VisitedLinkTableController::RemoveAllVisitedLinks(), m_identifier);
</del><ins>+        process-&gt;send(Messages::VisitedLinkTableController::RemoveAllVisitedLinks(), m_identifier);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -194,9 +194,9 @@
</span><span class="cx">         ASSERT(process-&gt;processPool().processes().contains(process));
</span><span class="cx"> 
</span><span class="cx">         if (addedVisitedLinks.size() &gt; 20)
</span><del>-            process-&gt;connection()-&gt;send(Messages::VisitedLinkTableController::AllVisitedLinkStateChanged(), m_identifier);
</del><ins>+            process-&gt;send(Messages::VisitedLinkTableController::AllVisitedLinkStateChanged(), m_identifier);
</ins><span class="cx">         else
</span><del>-            process-&gt;connection()-&gt;send(Messages::VisitedLinkTableController::VisitedLinkStateChanged(addedVisitedLinks), m_identifier);
</del><ins>+            process-&gt;send(Messages::VisitedLinkTableController::VisitedLinkStateChanged(addedVisitedLinks), m_identifier);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">     if (!m_table.sharedMemory()-&gt;createHandle(handle, SharedMemory::Protection::ReadOnly))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    process.connection()-&gt;send(Messages::VisitedLinkTableController::SetVisitedLinkTable(handle), m_identifier);
</del><ins>+    process.send(Messages::VisitedLinkTableController::SetVisitedLinkTable(handle), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -824,8 +824,6 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_needsToFinishInitializingWebPageAfterProcessLaunch = false;
</span><del>-
-    m_process-&gt;addWebUserContentControllerProxy(m_userContentController);
</del><span class="cx">     m_process-&gt;addVisitedLinkStore(m_visitedLinkStore);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5595,6 +5593,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    m_process-&gt;addWebUserContentControllerProxy(m_userContentController, parameters);
+
</ins><span class="cx">     return parameters;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -320,10 +320,10 @@
</span><span class="cx">     store.addProcess(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebProcessProxy::addWebUserContentControllerProxy(WebUserContentControllerProxy&amp; proxy)
</del><ins>+void WebProcessProxy::addWebUserContentControllerProxy(WebUserContentControllerProxy&amp; proxy, WebPageCreationParameters&amp; parameters)
</ins><span class="cx"> {
</span><span class="cx">     m_webUserContentControllerProxies.add(&amp;proxy);
</span><del>-    proxy.addProcess(*this);
</del><ins>+    proxy.addProcess(*this, parameters);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcessProxy::didDestroyVisitedLinkStore(VisitedLinkStore&amp; store)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     unsigned visiblePageCount() const { return m_visiblePageCounter.value(); }
</span><span class="cx"> 
</span><span class="cx">     void addVisitedLinkStore(VisitedLinkStore&amp;);
</span><del>-    void addWebUserContentControllerProxy(WebUserContentControllerProxy&amp;);
</del><ins>+    void addWebUserContentControllerProxy(WebUserContentControllerProxy&amp;, WebPageCreationParameters&amp;);
</ins><span class="cx">     void didDestroyVisitedLinkStore(VisitedLinkStore&amp;);
</span><span class="cx">     void didDestroyWebUserContentControllerProxy(WebUserContentControllerProxy&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -62,6 +62,14 @@
</span><span class="cx">     void removeUserStyleSheets(InjectedBundleScriptWorld&amp;);
</span><span class="cx">     void removeAllUserContent();
</span><span class="cx"> 
</span><ins>+    void addUserContentWorlds(const Vector&lt;std::pair&lt;uint64_t, String&gt;&gt;&amp;);
+    void addUserScripts(const Vector&lt;WebUserScriptData&gt;&amp;);
+    void addUserStyleSheets(const Vector&lt;WebUserStyleSheetData&gt;&amp;);
+    void addUserScriptMessageHandlers(const Vector&lt;WebScriptMessageHandlerData&gt;&amp;);
+#if ENABLE(CONTENT_EXTENSIONS)
+    void addContentExtensions(const Vector&lt;std::pair&lt;String, WebCompiledContentExtensionData&gt;&gt;&amp;);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit WebUserContentController(uint64_t identifier);
</span><span class="cx"> 
</span><span class="lines">@@ -78,23 +86,18 @@
</span><span class="cx">     // IPC::MessageReceiver.
</span><span class="cx">     void didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) override;
</span><span class="cx"> 
</span><del>-    void addUserContentWorlds(const Vector&lt;std::pair&lt;uint64_t, String&gt;&gt;&amp;);
</del><span class="cx">     void removeUserContentWorlds(const Vector&lt;uint64_t&gt;&amp;);
</span><span class="cx"> 
</span><del>-    void addUserScripts(const Vector&lt;WebUserScriptData&gt;&amp;);
</del><span class="cx">     void removeUserScript(uint64_t worldIdentifier, uint64_t userScriptIdentifier);
</span><span class="cx">     void removeAllUserScripts(const Vector&lt;uint64_t&gt;&amp;);
</span><span class="cx"> 
</span><del>-    void addUserStyleSheets(const Vector&lt;WebUserStyleSheetData&gt;&amp;);
</del><span class="cx">     void removeUserStyleSheet(uint64_t worldIdentifier, uint64_t userScriptIdentifier);
</span><span class="cx">     void removeAllUserStyleSheets(const Vector&lt;uint64_t&gt;&amp;);
</span><span class="cx"> 
</span><del>-    void addUserScriptMessageHandlers(const Vector&lt;WebScriptMessageHandlerData&gt;&amp;);
</del><span class="cx">     void removeUserScriptMessageHandler(uint64_t worldIdentifier, uint64_t userScriptIdentifier);
</span><span class="cx">     void removeAllUserScriptMessageHandlers(const Vector&lt;uint64_t&gt;&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    void addContentExtensions(const Vector&lt;std::pair&lt;String, WebCompiledContentExtensionData&gt;&gt;&amp;);
</del><span class="cx">     void removeContentExtension(const String&amp; name);
</span><span class="cx">     void removeAllContentExtensions();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -566,6 +566,14 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto iterator : parameters.urlSchemeHandlers)
</span><span class="cx">         registerURLSchemeHandler(iterator.value, iterator.key);
</span><ins>+
+    m_userContentController-&gt;addUserContentWorlds(parameters.userContentWorlds);
+    m_userContentController-&gt;addUserScripts(parameters.userScripts);
+    m_userContentController-&gt;addUserStyleSheets(parameters.userStyleSheets);
+    m_userContentController-&gt;addUserScriptMessageHandlers(parameters.messageHandlers);
+#if ENABLE(CONTENT_EXTENSIONS)
+    m_userContentController-&gt;addContentExtensions(parameters.contentExtensions);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Tools/ChangeLog        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2017-04-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions
+        https://bugs.webkit.org/show_bug.cgi?id=170707
+        &lt;rdar://problem/27788755&gt;
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm:
+        (-[ContentExtensionDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
+        (TEST_F):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
+        (-[ContentBlockingWebsitePoliciesDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
+        (-[ContentBlockingWebsitePoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
+        (TEST):
+
+2017-04-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
</ins><span class="cx">         Add API to get available content extension identifiers in a WKContentExtensionStore
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=170093
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaWKUserContentExtensionStoremm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -307,18 +307,10 @@
</span><span class="cx"> {
</span><span class="cx">     switch (alertCount++) {
</span><span class="cx">     case 0:
</span><del>-        // FIXME: The first content blocker should be enabled here.
-        // ContentExtensionsBackend::addContentExtension isn't being called in the WebProcess
-        // until after the first main resource starts loading, so we need to send a message to the
-        // WebProcess before loading if we have installed content blockers.
-        // See rdar://problem/27788755
-        EXPECT_STREQ(&quot;content blockers disabled&quot;, message.UTF8String);
-        break;
-    case 1:
</del><span class="cx">         // Default behavior.
</span><span class="cx">         EXPECT_STREQ(&quot;content blockers enabled&quot;, message.UTF8String);
</span><span class="cx">         break;
</span><del>-    case 2:
</del><ins>+    case 1:
</ins><span class="cx">         // After having removed the content extension.
</span><span class="cx">         EXPECT_STREQ(&quot;content blockers disabled&quot;, message.UTF8String);
</span><span class="cx">         break;
</span><span class="lines">@@ -360,10 +352,6 @@
</span><span class="cx">     [webView loadRequest:request];
</span><span class="cx">     TestWebKitAPI::Util::run(&amp;receivedAlert);
</span><span class="cx"> 
</span><del>-    receivedAlert = false;
-    [webView reload];
-    TestWebKitAPI::Util::run(&amp;receivedAlert);
-
</del><span class="cx">     [[configuration userContentController] removeContentExtension:extension.get()];
</span><span class="cx"> 
</span><span class="cx">     receivedAlert = false;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaWebsitePoliciesmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm (215211 => 215212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm        2017-04-11 00:24:17 UTC (rev 215211)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm        2017-04-11 00:40:00 UTC (rev 215212)
</span><span class="lines">@@ -71,22 +71,14 @@
</span><span class="cx"> {
</span><span class="cx">     switch (alertCount++) {
</span><span class="cx">     case 0:
</span><del>-        // FIXME: The first content blocker should be enabled here.
-        // ContentExtensionsBackend::addContentExtension isn't being called in the WebProcess
-        // until after the first main resource starts loading, so we need to send a message to the
-        // WebProcess before loading if we have installed content blockers.
-        // See rdar://problem/27788755
-        EXPECT_STREQ(&quot;content blockers disabled&quot;, message.UTF8String);
-        break;
-    case 1:
</del><span class="cx">         // Default behavior.
</span><span class="cx">         EXPECT_STREQ(&quot;content blockers enabled&quot;, message.UTF8String);
</span><span class="cx">         break;
</span><del>-    case 2:
</del><ins>+    case 1:
</ins><span class="cx">         // After having set websitePolicies.contentBlockersEnabled to false.
</span><span class="cx">         EXPECT_STREQ(&quot;content blockers disabled&quot;, message.UTF8String);
</span><span class="cx">         break;
</span><del>-    case 3:
</del><ins>+    case 2:
</ins><span class="cx">         // After having reloaded without content blockers.
</span><span class="cx">         EXPECT_STREQ(&quot;content blockers disabled&quot;, message.UTF8String);
</span><span class="cx">         break;
</span><span class="lines">@@ -102,12 +94,9 @@
</span><span class="cx">     _WKWebsitePolicies *websitePolicies = [[[_WKWebsitePolicies alloc] init] autorelease];
</span><span class="cx">     switch (alertCount) {
</span><span class="cx">     case 0:
</span><del>-        // Verify an existing bug the first time a page is loaded in a new WebProcess.
</del><ins>+        // Verify the content blockers behave correctly with the default behavior.
</ins><span class="cx">         break;
</span><span class="cx">     case 1:
</span><del>-        // Verify the content blockers behave correctly with the default behavior.
-        break;
-    case 2:
</del><span class="cx">         {
</span><span class="cx">             // Verify disabling content blockers works correctly.
</span><span class="cx">             websitePolicies.contentBlockersEnabled = false;
</span><span class="lines">@@ -120,7 +109,7 @@
</span><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx">         return;
</span><del>-    case 3:
</del><ins>+    case 2:
</ins><span class="cx">         // Verify enabling content blockers has no effect when reloading without content blockers.
</span><span class="cx">         websitePolicies.contentBlockersEnabled = true;
</span><span class="cx">         break;
</span><span class="lines">@@ -164,10 +153,6 @@
</span><span class="cx">     TestWebKitAPI::Util::run(&amp;receivedAlert);
</span><span class="cx"> 
</span><span class="cx">     receivedAlert = false;
</span><del>-    [webView reload];
-    TestWebKitAPI::Util::run(&amp;receivedAlert);
-
-    receivedAlert = false;
</del><span class="cx">     [webView _reloadWithoutContentBlockers];
</span><span class="cx">     TestWebKitAPI::Util::run(&amp;receivedAlert);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>