<!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>[197304] 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/197304">197304</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-02-28 16:32:24 -0800 (Sun, 28 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Reimplement WKPageGroup in terms of WKUserContentController
https://bugs.webkit.org/show_bug.cgi?id=154804

Reviewed by Dan Bernstein.

Source/WebKit2:

Instead of having both WebPageGroup and WebUserContentControllerProxy both keep track
of user scripts and user stylesheets, give WebPageGroup a WebUserContentControllerProxy
and let it take care of things. This allows us to remove a ton of duplicate code, and
provides a convenient way for clients currently using PageGroup based user content insertion
to start using UserContentController, since they can now be used at the same time.

When using WKPageConfigurationRef, the rule is:
    - If you don't set a WKUserContentControllerRef, the one from the WKPageGroupRef will be used.
    - If you do set a WKUserContentControllerRef, it will be used, and the one from the WKPageGroupRef
      will do nothing for that web view.

* DerivedSources.make:
Remove WebPageGroupProxy. It no longer is a MessageReceiver.

* Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::encode):
(WebKit::WebPageGroupData::decode):
* Shared/WebPageGroupData.h:
Stop encoding/decoding user content, instead just encode the identifier to the UserContentController.

* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupGetUserContentController):
* UIProcess/API/C/WKPageGroup.h:
Add getter for the underlying WKUserContentControllerRef.

* UIProcess/API/cpp/WKRetainPtr.h:
(WebKit::retainWK):
Add retainWK() helper to match RetainPtr's retainPtr() helper.

* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::WebPageGroup):
(WebKit::WebPageGroup::userContentController):
(WebKit::WebPageGroup::addUserStyleSheet):
(WebKit::WebPageGroup::addUserScript):
(WebKit::WebPageGroup::removeAllUserStyleSheets):
(WebKit::WebPageGroup::removeAllUserScripts):
(WebKit::WebPageGroup::removeAllUserContent):
(WebKit::WebPageGroup::addUserContentExtension):
(WebKit::WebPageGroup::removeUserContentExtension):
(WebKit::WebPageGroup::removeAllUserContentExtensions):
* UIProcess/WebPageGroup.h:
Pass through to the WebUserContentControllerProxy.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
WebPageProxies always have a WebUserContentControllerProxy now, so it can go in a Ref and
a few branches can be removed.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
If a UserContentController is not passed in, use the one from the PageGroup.

* WebKit2.xcodeproj/project.pbxproj:
Remove files.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
Add some #includes that are now needed.

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::getOrCreate):
* WebProcess/UserContent/WebUserContentController.h:
Modernize WebUserContentController::getOrCreate to return a Ref.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::m_shouldDispatchFakeMouseMoveEvents):
(WebKit::WebPage::addUserScript):
(WebKit::WebPage::addUserStyleSheet):
(WebKit::WebPage::removeAllUserContent):
* WebProcess/WebPage/WebPage.h:
Store the WebUserContentController in Ref, remove unnecessary branches/asserts.

* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::WebPageGroupProxy):
(WebKit::WebPageGroupProxy::~WebPageGroupProxy):
(WebKit::WebPageGroupProxy::userContentController):
(WebKit::WebPageGroupProxy::addUserStyleSheet): Deleted.
(WebKit::WebPageGroupProxy::addUserScript): Deleted.
(WebKit::WebPageGroupProxy::removeAllUserStyleSheets): Deleted.
(WebKit::WebPageGroupProxy::removeAllUserScripts): Deleted.
(WebKit::WebPageGroupProxy::removeAllUserContent): Deleted.
(WebKit::WebPageGroupProxy::addUserContentExtension): Deleted.
(WebKit::WebPageGroupProxy::removeUserContentExtension): Deleted.
(WebKit::WebPageGroupProxy::removeAllUserContentExtensions): Deleted.
* WebProcess/WebPage/WebPageGroupProxy.h:
Store a WebUserContentController in a Ref, remove now unnecessary message handling functions.

* WebProcess/WebPage/WebPageGroupProxy.messages.in:
Removed.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
Remove routing to WebPageGroupProxy, which is no longer a MessageReceiver.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/PageGroup.cpp: Added.</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="#trunkSourceWebKit2SharedWebPageGroupDatacpp">trunk/Source/WebKit2/Shared/WebPageGroupData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPageGroupDatah">trunk/Source/WebKit2/Shared/WebPageGroupData.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPageGroupcpp">trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPageGrouph">trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIcppWKRetainPtrh">trunk/Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageGroupcpp">trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageGrouph">trunk/Source/WebKit2/UIProcess/WebPageGroup.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp">trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp</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="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageGroupProxycpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageGroupProxyh">trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2PageGroupcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageGroup.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageGroupProxymessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.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 (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/CMakeLists.txt        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -716,7 +716,6 @@
</span><span class="cx">     WebProcess/WebPage/WebInspector.messages.in
</span><span class="cx">     WebProcess/WebPage/WebInspectorUI.messages.in
</span><span class="cx">     WebProcess/WebPage/WebPage.messages.in
</span><del>-    WebProcess/WebPage/WebPageGroupProxy.messages.in
</del><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> set(WebProcess_LIBRARIES
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/ChangeLog        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -1,5 +1,109 @@
</span><span class="cx"> 2016-02-28  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        Reimplement WKPageGroup in terms of WKUserContentController
+        https://bugs.webkit.org/show_bug.cgi?id=154804
+
+        Reviewed by Dan Bernstein.
+
+        Instead of having both WebPageGroup and WebUserContentControllerProxy both keep track
+        of user scripts and user stylesheets, give WebPageGroup a WebUserContentControllerProxy
+        and let it take care of things. This allows us to remove a ton of duplicate code, and
+        provides a convenient way for clients currently using PageGroup based user content insertion
+        to start using UserContentController, since they can now be used at the same time.
+
+        When using WKPageConfigurationRef, the rule is:
+            - If you don't set a WKUserContentControllerRef, the one from the WKPageGroupRef will be used.
+            - If you do set a WKUserContentControllerRef, it will be used, and the one from the WKPageGroupRef
+              will do nothing for that web view.
+
+        * DerivedSources.make:
+        Remove WebPageGroupProxy. It no longer is a MessageReceiver.
+
+        * Shared/WebPageGroupData.cpp:
+        (WebKit::WebPageGroupData::encode):
+        (WebKit::WebPageGroupData::decode):
+        * Shared/WebPageGroupData.h:
+        Stop encoding/decoding user content, instead just encode the identifier to the UserContentController.
+
+        * UIProcess/API/C/WKPageGroup.cpp:
+        (WKPageGroupGetUserContentController):
+        * UIProcess/API/C/WKPageGroup.h:
+        Add getter for the underlying WKUserContentControllerRef.
+
+        * UIProcess/API/cpp/WKRetainPtr.h:
+        (WebKit::retainWK):
+        Add retainWK() helper to match RetainPtr's retainPtr() helper.
+
+        * UIProcess/WebPageGroup.cpp:
+        (WebKit::WebPageGroup::WebPageGroup):
+        (WebKit::WebPageGroup::userContentController):
+        (WebKit::WebPageGroup::addUserStyleSheet):
+        (WebKit::WebPageGroup::addUserScript):
+        (WebKit::WebPageGroup::removeAllUserStyleSheets):
+        (WebKit::WebPageGroup::removeAllUserScripts):
+        (WebKit::WebPageGroup::removeAllUserContent):
+        (WebKit::WebPageGroup::addUserContentExtension):
+        (WebKit::WebPageGroup::removeUserContentExtension):
+        (WebKit::WebPageGroup::removeAllUserContentExtensions):
+        * UIProcess/WebPageGroup.h:
+        Pass through to the WebUserContentControllerProxy.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
+        (WebKit::WebPageProxy::creationParameters):
+        * UIProcess/WebPageProxy.h:
+        WebPageProxies always have a WebUserContentControllerProxy now, so it can go in a Ref and
+        a few branches can be removed.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::createWebPage):
+        If a UserContentController is not passed in, use the one from the PageGroup.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Remove files.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        Add some #includes that are now needed.
+
+        * WebProcess/UserContent/WebUserContentController.cpp:
+        (WebKit::WebUserContentController::getOrCreate):
+        * WebProcess/UserContent/WebUserContentController.h:
+        Modernize WebUserContentController::getOrCreate to return a Ref.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::m_shouldDispatchFakeMouseMoveEvents):
+        (WebKit::WebPage::addUserScript):
+        (WebKit::WebPage::addUserStyleSheet):
+        (WebKit::WebPage::removeAllUserContent):
+        * WebProcess/WebPage/WebPage.h:
+        Store the WebUserContentController in Ref, remove unnecessary branches/asserts.
+
+        * WebProcess/WebPage/WebPageGroupProxy.cpp:
+        (WebKit::WebPageGroupProxy::WebPageGroupProxy):
+        (WebKit::WebPageGroupProxy::~WebPageGroupProxy):
+        (WebKit::WebPageGroupProxy::userContentController):
+        (WebKit::WebPageGroupProxy::addUserStyleSheet): Deleted.
+        (WebKit::WebPageGroupProxy::addUserScript): Deleted.
+        (WebKit::WebPageGroupProxy::removeAllUserStyleSheets): Deleted.
+        (WebKit::WebPageGroupProxy::removeAllUserScripts): Deleted.
+        (WebKit::WebPageGroupProxy::removeAllUserContent): Deleted.
+        (WebKit::WebPageGroupProxy::addUserContentExtension): Deleted.
+        (WebKit::WebPageGroupProxy::removeUserContentExtension): Deleted.
+        (WebKit::WebPageGroupProxy::removeAllUserContentExtensions): Deleted.
+        * WebProcess/WebPage/WebPageGroupProxy.h:
+        Store a WebUserContentController in a Ref, remove now unnecessary message handling functions.
+
+        * WebProcess/WebPage/WebPageGroupProxy.messages.in:
+        Removed.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didReceiveMessage):
+        Remove routing to WebPageGroupProxy, which is no longer a MessageReceiver.
+
+2016-02-28  Sam Weinig  &lt;sam@webkit.org&gt;
+
</ins><span class="cx">         Bind _WKUserStyleSheets to _WKUserContentWorlds to allow for grouping of user content by associating to a world
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=154798
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/DerivedSources.make        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -124,7 +124,6 @@
</span><span class="cx">     WebInspectorUI \
</span><span class="cx">     WebNotificationManager \
</span><span class="cx">     WebPage \
</span><del>-    WebPageGroupProxy \
</del><span class="cx">     WebPageProxy \
</span><span class="cx">     WebPasteboardProxy \
</span><span class="cx">     WebProcess \
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPageGroupDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPageGroupData.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPageGroupData.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/Shared/WebPageGroupData.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -36,11 +36,7 @@
</span><span class="cx">     encoder &lt;&lt; pageGroupID;
</span><span class="cx">     encoder &lt;&lt; visibleToInjectedBundle;
</span><span class="cx">     encoder &lt;&lt; visibleToHistoryClient;
</span><del>-    encoder &lt;&lt; userStyleSheets;
-    encoder &lt;&lt; userScripts;
-#if ENABLE(CONTENT_EXTENSIONS)
-    encoder &lt;&lt; userContentExtensions;
-#endif
</del><ins>+    encoder &lt;&lt; userContentControllerIdentifier;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebPageGroupData::decode(IPC::ArgumentDecoder&amp; decoder, WebPageGroupData&amp; data)
</span><span class="lines">@@ -53,14 +49,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(data.visibleToHistoryClient))
</span><span class="cx">         return false;
</span><del>-    if (!decoder.decode(data.userStyleSheets))
</del><ins>+    if (!decoder.decode(data.userContentControllerIdentifier))
</ins><span class="cx">         return false;
</span><del>-    if (!decoder.decode(data.userScripts))
-        return false;
-#if ENABLE(CONTENT_EXTENSIONS)
-    if (!decoder.decode(data.userContentExtensions))
-        return false;
-#endif
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPageGroupDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPageGroupData.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPageGroupData.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/Shared/WebPageGroupData.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -26,11 +26,6 @@
</span><span class="cx"> #ifndef WebPageGroupData_h
</span><span class="cx"> #define WebPageGroupData_h
</span><span class="cx"> 
</span><del>-#include &quot;WebCompiledContentExtensionData.h&quot;
-#include &lt;WebCore/UserScript.h&gt;
-#include &lt;WebCore/UserStyleSheet.h&gt;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/text/StringHash.h&gt;
</del><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="lines">@@ -49,12 +44,7 @@
</span><span class="cx">     bool visibleToInjectedBundle;
</span><span class="cx">     bool visibleToHistoryClient;
</span><span class="cx"> 
</span><del>-    Vector&lt;WebCore::UserStyleSheet&gt; userStyleSheets;
-    Vector&lt;WebCore::UserScript&gt; userScripts;
-
-#if ENABLE(CONTENT_EXTENSIONS)
-    HashMap&lt;String, WebCompiledContentExtensionData&gt; userContentExtensions;
-#endif
</del><ins>+    uint64_t userContentControllerIdentifier;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><span class="cx"> #include &quot;WebPageGroup.h&quot;
</span><span class="cx"> #include &quot;WebPreferences.h&quot;
</span><ins>+#include &quot;WebUserContentControllerProxy.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><span class="lines">@@ -59,6 +60,11 @@
</span><span class="cx">     return toAPI(&amp;toImpl(pageGroupRef)-&gt;preferences());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WKUserContentControllerRef WKPageGroupGetUserContentController(WKPageGroupRef pageGroupRef)
+{
+    return toAPI(&amp;toImpl(pageGroupRef)-&gt;userContentController());
+}
+
</ins><span class="cx"> void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames)
</span><span class="cx"> {
</span><span class="cx">     toImpl(pageGroupRef)-&gt;addUserStyleSheet(toWTFString(sourceRef), toWTFString(baseURL), toImpl(whitelistedURLPatterns), toImpl(blacklistedURLPatterns), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPageGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -42,7 +42,9 @@
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKPageGroupSetPreferences(WKPageGroupRef pageGroup, WKPreferencesRef preferences);
</span><span class="cx"> WK_EXPORT WKPreferencesRef WKPageGroupGetPreferences(WKPageGroupRef pageGroup);
</span><del>-    
</del><ins>+
+WK_EXPORT WKUserContentControllerRef WKPageGroupGetUserContentController(WKPageGroupRef pageGroup);
+
</ins><span class="cx"> WK_EXPORT void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroup, WKStringRef source, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames);
</span><span class="cx"> WK_EXPORT void WKPageGroupRemoveAllUserStyleSheets(WKPageGroupRef pageGroup);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIcppWKRetainPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -248,11 +248,17 @@
</span><span class="cx">     return WKRetainPtr&lt;T&gt;(AdoptWK, o);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt; inline WKRetainPtr&lt;T&gt; retainWK(T ptr)
+{
+    return ptr;
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> using WebKit::WKRetainPtr;
</span><span class="cx"> using WebKit::AdoptWK;
</span><span class="cx"> using WebKit::adoptWK;
</span><ins>+using WebKit::retainWK;
</ins><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -28,10 +28,12 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIArray.h&quot;
</span><span class="cx"> #include &quot;APIUserContentExtension.h&quot;
</span><ins>+#include &quot;APIUserScript.h&quot;
+#include &quot;APIUserStyleSheet.h&quot;
</ins><span class="cx"> #include &quot;WebCompiledContentExtension.h&quot;
</span><del>-#include &quot;WebPageGroupProxyMessages.h&quot;
</del><span class="cx"> #include &quot;WebPageProxy.h&quot;
</span><span class="cx"> #include &quot;WebPreferences.h&quot;
</span><ins>+#include &quot;WebUserContentControllerProxy.h&quot;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringConcatenate.h&gt;
</span><span class="lines">@@ -89,7 +91,10 @@
</span><span class="cx"> WebPageGroup::WebPageGroup(const String&amp; identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
</span><span class="cx">     : m_data(pageGroupData(identifier, visibleToInjectedBundle, visibleToHistoryClient))
</span><span class="cx">     , m_preferences(WebPreferences::createWithLegacyDefaults(m_data.identifier, &quot;.WebKit2&quot;, &quot;WebKit2.&quot;))
</span><ins>+    , m_userContentController(WebUserContentControllerProxy::create())
</ins><span class="cx"> {
</span><ins>+    m_data.userContentControllerIdentifier = m_userContentController-&gt;identifier();
+
</ins><span class="cx">     webPageGroupMap().set(m_data.pageGroupID, this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -132,15 +137,18 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WebUserContentControllerProxy&amp; WebPageGroup::userContentController()
+{
+    return *m_userContentController;
+}
+
</ins><span class="cx"> void WebPageGroup::addUserStyleSheet(const String&amp; source, const String&amp; baseURL, API::Array* whitelist, API::Array* blacklist, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserStyleLevel level)
</span><span class="cx"> {
</span><span class="cx">     if (source.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebCore::UserStyleSheet userStyleSheet = WebCore::UserStyleSheet(source, (baseURL.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURL)), whitelist ? whitelist-&gt;toStringVector() : Vector&lt;String&gt;(), blacklist ? blacklist-&gt;toStringVector() : Vector&lt;String&gt;(), injectedFrames, level);
-
-    m_data.userStyleSheets.append(userStyleSheet);
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserStyleSheet(userStyleSheet), m_data.pageGroupID);
</del><ins>+    Ref&lt;API::UserStyleSheet&gt; userStyleSheet = API::UserStyleSheet::create(WebCore::UserStyleSheet { source, (baseURL.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURL)), whitelist ? whitelist-&gt;toStringVector() : Vector&lt;String&gt;(), blacklist ? blacklist-&gt;toStringVector() : Vector&lt;String&gt;(), injectedFrames, level }, API::UserContentWorld::normalWorld());
+    m_userContentController-&gt;addUserStyleSheet(userStyleSheet.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageGroup::addUserScript(const String&amp; source, const String&amp; baseURL, API::Array* whitelist, API::Array* blacklist, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime)
</span><span class="lines">@@ -148,48 +156,40 @@
</span><span class="cx">     if (source.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebCore::UserScript userScript = WebCore::UserScript(source, (baseURL.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURL)), whitelist ? whitelist-&gt;toStringVector() : Vector&lt;String&gt;(), blacklist ? blacklist-&gt;toStringVector() : Vector&lt;String&gt;(), injectionTime, injectedFrames);
-
-    m_data.userScripts.append(userScript);
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserScript(userScript), m_data.pageGroupID);
</del><ins>+    Ref&lt;API::UserScript&gt; userScript = API::UserScript::create(WebCore::UserScript { source, (baseURL.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURL)), whitelist ? whitelist-&gt;toStringVector() : Vector&lt;String&gt;(), blacklist ? blacklist-&gt;toStringVector() : Vector&lt;String&gt;(), injectionTime, injectedFrames }, API::UserContentWorld::normalWorld());
+    m_userContentController-&gt;addUserScript(userScript.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageGroup::removeAllUserStyleSheets()
</span><span class="cx"> {
</span><del>-    m_data.userStyleSheets.clear();
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserStyleSheets(), m_data.pageGroupID);
</del><ins>+    m_userContentController-&gt;removeAllUserStyleSheets();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageGroup::removeAllUserScripts()
</span><span class="cx"> {
</span><del>-    m_data.userScripts.clear();
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserScripts(), m_data.pageGroupID);
</del><ins>+    m_userContentController-&gt;removeAllUserScripts();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageGroup::removeAllUserContent()
</span><span class="cx"> {
</span><del>-    m_data.userStyleSheets.clear();
-    m_data.userScripts.clear();
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserContent(), m_data.pageGroupID);
</del><ins>+    m_userContentController-&gt;removeAllUserStyleSheets();
+    m_userContentController-&gt;removeAllUserScripts();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-void WebPageGroup::addUserContentExtension(const API::UserContentExtension&amp; userContentExtension)
</del><ins>+void WebPageGroup::addUserContentExtension(API::UserContentExtension&amp; userContentExtension)
</ins><span class="cx"> {
</span><del>-    m_data.userContentExtensions.set(userContentExtension.name(), userContentExtension.compiledExtension().data());
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserContentExtension(userContentExtension.name(), userContentExtension.compiledExtension().data()), m_data.pageGroupID);
</del><ins>+    m_userContentController-&gt;addUserContentExtension(userContentExtension);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageGroup::removeUserContentExtension(const String&amp; contentExtensionName)
</span><span class="cx"> {
</span><del>-    m_data.userContentExtensions.remove(contentExtensionName);
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveUserContentExtension(contentExtensionName), m_data.pageGroupID);
</del><ins>+    m_userContentController-&gt;removeUserContentExtension(contentExtensionName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageGroup::removeAllUserContentExtensions()
</span><span class="cx"> {
</span><del>-    m_data.userContentExtensions.clear();
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserContentExtensions(), m_data.pageGroupID);
</del><ins>+    m_userContentController-&gt;removeAllUserContentExtensions();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageGroup.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;WebPageGroupData.h&quot;
</span><span class="cx"> #include &quot;WebPageProxy.h&quot;
</span><span class="cx"> #include &quot;WebProcessProxy.h&quot;
</span><ins>+#include &lt;WebCore/UserStyleSheetTypes.h&gt;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -38,6 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> class WebPreferences;
</span><span class="cx"> class WebPageProxy;
</span><ins>+class WebUserContentControllerProxy;
</ins><span class="cx"> 
</span><span class="cx"> class WebPageGroup : public API::ObjectImpl&lt;API::Object::Type::PageGroup&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -59,7 +61,9 @@
</span><span class="cx">     void setPreferences(WebPreferences*);
</span><span class="cx">     WebPreferences&amp; preferences() const;
</span><span class="cx">     void preferencesDidChange();
</span><del>-    
</del><ins>+
+    WebUserContentControllerProxy&amp; userContentController();
+
</ins><span class="cx">     void addUserStyleSheet(const String&amp; source, const String&amp; baseURL, API::Array* whitelist, API::Array* blacklist, WebCore::UserContentInjectedFrames, WebCore::UserStyleLevel);
</span><span class="cx">     void addUserScript(const String&amp; source, const String&amp; baseURL, API::Array* whitelist, API::Array* blacklist, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
</span><span class="cx">     void removeAllUserStyleSheets();
</span><span class="lines">@@ -67,7 +71,7 @@
</span><span class="cx">     void removeAllUserContent();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    void addUserContentExtension(const API::UserContentExtension&amp;);
</del><ins>+    void addUserContentExtension(API::UserContentExtension&amp;);
</ins><span class="cx">     void removeUserContentExtension(const String&amp;);
</span><span class="cx">     void removeAllUserContentExtensions();
</span><span class="cx"> #endif
</span><span class="lines">@@ -77,6 +81,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebPageGroupData m_data;
</span><span class="cx">     RefPtr&lt;WebPreferences&gt; m_preferences;
</span><ins>+    RefPtr&lt;WebUserContentControllerProxy&gt; m_userContentController;
</ins><span class="cx">     HashSet&lt;WebPageProxy*&gt; m_pages;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx">     , m_process(process)
</span><span class="cx">     , m_pageGroup(*m_configuration-&gt;pageGroup())
</span><span class="cx">     , m_preferences(*m_configuration-&gt;preferences())
</span><del>-    , m_userContentController(m_configuration-&gt;userContentController())
</del><ins>+    , m_userContentController(*m_configuration-&gt;userContentController())
</ins><span class="cx">     , m_visitedLinkStore(*m_configuration-&gt;visitedLinkStore())
</span><span class="cx">     , m_websiteDataStore(m_configuration-&gt;websiteDataStore()-&gt;websiteDataStore())
</span><span class="cx">     , m_mainFrame(nullptr)
</span><span class="lines">@@ -819,8 +819,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_needsToFinishInitializingWebPageAfterProcessLaunch = false;
</span><span class="cx"> 
</span><del>-    if (m_userContentController)
-        m_process-&gt;addWebUserContentControllerProxy(*m_userContentController);
</del><ins>+    m_process-&gt;addWebUserContentControllerProxy(m_userContentController);
</ins><span class="cx">     m_process-&gt;addVisitedLinkStore(m_visitedLinkStore);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5154,7 +5153,7 @@
</span><span class="cx">     parameters.itemStates = m_backForwardList-&gt;itemStates();
</span><span class="cx">     parameters.sessionID = m_sessionID;
</span><span class="cx">     parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
</span><del>-    parameters.userContentControllerID = m_userContentController ? m_userContentController-&gt;identifier() : 0;
</del><ins>+    parameters.userContentControllerID = m_userContentController-&gt;identifier();
</ins><span class="cx">     parameters.visitedLinkTableID = m_visitedLinkStore-&gt;identifier();
</span><span class="cx">     parameters.websiteDataStoreID = m_websiteDataStore-&gt;identifier();
</span><span class="cx">     parameters.canRunBeforeUnloadConfirmPanel = m_uiClient-&gt;canRunBeforeUnloadConfirmPanel();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -1511,7 +1511,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebProcessLifetimeTracker m_webProcessLifetimeTracker { *this };
</span><span class="cx"> 
</span><del>-    const RefPtr&lt;WebUserContentControllerProxy&gt; m_userContentController;
</del><ins>+    Ref&lt;WebUserContentControllerProxy&gt; m_userContentController;
</ins><span class="cx">     Ref&lt;VisitedLinkStore&gt; m_visitedLinkStore;
</span><span class="cx">     Ref&lt;WebsiteDataStore&gt; m_websiteDataStore;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -750,6 +750,8 @@
</span><span class="cx">         pageConfiguration-&gt;setPageGroup(m_defaultPageGroup.ptr());
</span><span class="cx">     if (!pageConfiguration-&gt;preferences())
</span><span class="cx">         pageConfiguration-&gt;setPreferences(&amp;pageConfiguration-&gt;pageGroup()-&gt;preferences());
</span><ins>+    if (!pageConfiguration-&gt;userContentController())
+        pageConfiguration-&gt;setUserContentController(&amp;pageConfiguration-&gt;pageGroup()-&gt;userContentController());
</ins><span class="cx">     if (!pageConfiguration-&gt;visitedLinkStore())
</span><span class="cx">         pageConfiguration-&gt;setVisitedLinkStore(m_visitedLinkStore.ptr());
</span><span class="cx">     if (!pageConfiguration-&gt;websiteDataStore()) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -580,8 +580,6 @@
</span><span class="cx">                 29AD3096164B4C930072DEA9 /* CustomProtocolManagerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29AD3095164B4C930072DEA9 /* CustomProtocolManagerProxyMac.mm */; };
</span><span class="cx">                 29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h */; };
</span><span class="cx">                 29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm */; };
</span><del>-                29D55DF1161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */; };
-                29D55DF2161BF9F10031A2E3 /* WebPageGroupProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */; };
</del><span class="cx">                 2D125C5E1857EA05003BA3CB /* ViewGestureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */; };
</span><span class="cx">                 2D125C5F1857EA05003BA3CB /* ViewGestureControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */; };
</span><span class="cx">                 2D1B5D5D185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */; };
</span><span class="lines">@@ -2538,9 +2536,6 @@
</span><span class="cx">                 29AD3097164B4E210072DEA9 /* CustomProtocolManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CustomProtocolManagerProxy.messages.in; path = CustomProtocols/CustomProtocolManagerProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAccessibilityWebPageObjectBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKAccessibilityWebPageObjectBase.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                29D55DEE161BF8780031A2E3 /* WebPageGroupProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebPageGroupProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
-                29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageGroupProxyMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageGroupProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 2D0035221BC7414800DA8716 /* DeprecatedPDFPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeprecatedPDFPlugin.h; path = PDF/DeprecatedPDFPlugin.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D0035231BC7414800DA8716 /* DeprecatedPDFPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DeprecatedPDFPlugin.mm; path = PDF/DeprecatedPDFPlugin.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5753,7 +5748,6 @@
</span><span class="cx">                                 C0CE72581247E4DA00BC0EC4 /* WebPage.messages.in */,
</span><span class="cx">                                 BC7B621412A4219A00D174A4 /* WebPageGroupProxy.cpp */,
</span><span class="cx">                                 BC7B621312A4219A00D174A4 /* WebPageGroupProxy.h */,
</span><del>-                                29D55DEE161BF8780031A2E3 /* WebPageGroupProxy.messages.in */,
</del><span class="cx">                                 2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */,
</span><span class="cx">                                 2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */,
</span><span class="cx">                                 BCA0EF7E12331E78007D3CFB /* WebUndoStep.cpp */,
</span><span class="lines">@@ -6875,8 +6869,6 @@
</span><span class="cx">                                 1CBBE49F19B66C53006B7D81 /* WebInspectorUIMessages.h */,
</span><span class="cx">                                 31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */,
</span><span class="cx">                                 31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */,
</span><del>-                                29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */,
-                                29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */,
</del><span class="cx">                                 C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */,
</span><span class="cx">                                 C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */,
</span><span class="cx">                                 BCBD3912125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp */,
</span><span class="lines">@@ -7635,7 +7627,6 @@
</span><span class="cx">                                 5C1427071C23F84C00D41183 /* DownloadManager.h in Headers */,
</span><span class="cx">                                 BC7B625212A43C9600D174A4 /* WebPageGroupData.h in Headers */,
</span><span class="cx">                                 BC7B621512A4219A00D174A4 /* WebPageGroupProxy.h in Headers */,
</span><del>-                                29D55DF2161BF9F10031A2E3 /* WebPageGroupProxyMessages.h in Headers */,
</del><span class="cx">                                 2D9EA30F1A96CBFF002D2807 /* WebPageInjectedBundleClient.h in Headers */,
</span><span class="cx">                                 C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */,
</span><span class="cx">                                 2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */,
</span><span class="lines">@@ -9114,7 +9105,6 @@
</span><span class="cx">                                 BC7B6207129A0A6700D174A4 /* WebPageGroup.cpp in Sources */,
</span><span class="cx">                                 BC7B625312A43C9600D174A4 /* WebPageGroupData.cpp in Sources */,
</span><span class="cx">                                 BC7B621612A4219A00D174A4 /* WebPageGroupProxy.cpp in Sources */,
</span><del>-                                29D55DF1161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp in Sources */,
</del><span class="cx">                                 2D9EA3111A96D9EB002D2807 /* WebPageInjectedBundleClient.cpp in Sources */,
</span><span class="cx">                                 5C1426EC1C23F80900D41183 /* NetworkProcessCreationParameters.cpp in Sources */,
</span><span class="cx">                                 2DA944BA1884EA3C00ED86DB /* WebPageIOS.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -72,6 +72,8 @@
</span><span class="cx"> #include &lt;WebCore/Settings.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserContentController.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserGestureIndicator.h&gt;
</span><ins>+#include &lt;WebCore/UserScript.h&gt;
+#include &lt;WebCore/UserStyleSheet.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_REGIONS) || ENABLE(CSS_COMPOSITING)
</span><span class="cx"> #include &lt;WebCore/RuntimeEnabledFeatures.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -66,16 +66,16 @@
</span><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;WebUserContentController&gt; WebUserContentController::getOrCreate(uint64_t identifier)
</del><ins>+Ref&lt;WebUserContentController&gt; WebUserContentController::getOrCreate(uint64_t identifier)
</ins><span class="cx"> {
</span><span class="cx">     auto&amp; userContentControllerPtr = userContentControllers().add(identifier, nullptr).iterator-&gt;value;
</span><span class="cx">     if (userContentControllerPtr)
</span><del>-        return userContentControllerPtr;
</del><ins>+        return *userContentControllerPtr;
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;WebUserContentController&gt; userContentController = adoptRef(new WebUserContentController(identifier));
</span><span class="cx">     userContentControllerPtr = userContentController.get();
</span><span class="cx"> 
</span><del>-    return userContentController.release();
</del><ins>+    return userContentController.releaseNonNull();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebUserContentController::WebUserContentController(uint64_t identifier)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> class WebUserContentController final : public RefCounted&lt;WebUserContentController&gt;, private IPC::MessageReceiver  {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;WebUserContentController&gt; getOrCreate(uint64_t identifier);
</del><ins>+    static Ref&lt;WebUserContentController&gt; getOrCreate(uint64_t identifier);
</ins><span class="cx">     virtual ~WebUserContentController();
</span><span class="cx"> 
</span><span class="cx">     WebCore::UserContentController&amp; userContentController() { return m_userContentController; }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -158,6 +158,8 @@
</span><span class="cx"> #include &lt;WebCore/SubstituteData.h&gt;
</span><span class="cx"> #include &lt;WebCore/TextIterator.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserInputBridge.h&gt;
</span><ins>+#include &lt;WebCore/UserScript.h&gt;
+#include &lt;WebCore/UserStyleSheet.h&gt;
</ins><span class="cx"> #include &lt;WebCore/VisiblePosition.h&gt;
</span><span class="cx"> #include &lt;WebCore/VisibleUnits.h&gt;
</span><span class="cx"> #include &lt;WebCore/markup.h&gt;
</span><span class="lines">@@ -307,7 +309,7 @@
</span><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR)
</span><span class="cx">     , m_activeColorChooser(0)
</span><span class="cx"> #endif
</span><del>-    , m_userContentController(parameters.userContentControllerID ? WebUserContentController::getOrCreate(parameters.userContentControllerID) : nullptr)
</del><ins>+    , m_userContentController(WebUserContentController::getOrCreate(parameters.userContentControllerID))
</ins><span class="cx"> #if ENABLE(GEOLOCATION)
</span><span class="cx">     , m_geolocationPermissionRequestManager(this)
</span><span class="cx"> #endif
</span><span class="lines">@@ -394,7 +396,7 @@
</span><span class="cx"> 
</span><span class="cx">     pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroup-&gt;pageGroupID());
</span><span class="cx">     pageConfiguration.storageNamespaceProvider = WebStorageNamespaceProvider::getOrCreate(m_pageGroup-&gt;pageGroupID());
</span><del>-    pageConfiguration.userContentController = m_userContentController ? &amp;m_userContentController-&gt;userContentController() : &amp;m_pageGroup-&gt;userContentController();
</del><ins>+    pageConfiguration.userContentController = &amp;m_userContentController-&gt;userContentController();
</ins><span class="cx">     pageConfiguration.visitedLinkStore = VisitedLinkTableController::getOrCreate(parameters.visitedLinkTableID);
</span><span class="cx"> 
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="lines">@@ -5182,8 +5184,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::addUserScript(const String&amp; source, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime)
</span><span class="cx"> {
</span><del>-    ASSERT(m_userContentController);
-
</del><span class="cx">     WebCore::UserScript userScript(source, WebCore::blankURL(), Vector&lt;String&gt;(), Vector&lt;String&gt;(), injectionTime, injectedFrames);
</span><span class="cx"> 
</span><span class="cx">     m_userContentController-&gt;userContentController().addUserScript(mainThreadNormalWorld(), std::make_unique&lt;WebCore::UserScript&gt;(userScript));
</span><span class="lines">@@ -5191,8 +5191,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::addUserStyleSheet(const String&amp; source, WebCore::UserContentInjectedFrames injectedFrames)
</span><span class="cx"> {
</span><del>-    ASSERT(m_userContentController);
-
</del><span class="cx">     WebCore::UserStyleSheet userStyleSheet(source, WebCore::blankURL(), Vector&lt;String&gt;(), Vector&lt;String&gt;(), injectedFrames, UserStyleUserLevel);
</span><span class="cx"> 
</span><span class="cx">     m_userContentController-&gt;userContentController().addUserStyleSheet(mainThreadNormalWorld(), std::make_unique&lt;WebCore::UserStyleSheet&gt;(userStyleSheet), InjectInExistingDocuments);
</span><span class="lines">@@ -5200,9 +5198,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::removeAllUserContent()
</span><span class="cx"> {
</span><del>-    if (!m_userContentController)
-        return;
-
</del><span class="cx">     m_userContentController-&gt;userContentController().removeAllUserContent();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -1311,7 +1311,7 @@
</span><span class="cx">     RefPtr&lt;WebOpenPanelResultListener&gt; m_activeOpenPanelResultListener;
</span><span class="cx">     RefPtr&lt;NotificationPermissionRequestManager&gt; m_notificationPermissionRequestManager;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;WebUserContentController&gt; m_userContentController;
</del><ins>+    Ref&lt;WebUserContentController&gt; m_userContentController;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(GEOLOCATION)
</span><span class="cx">     GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx"> #include &quot;WebPageGroupProxy.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InjectedBundle.h&quot;
</span><del>-#include &quot;WebCompiledContentExtension.h&quot;
</del><span class="cx"> #include &quot;WebProcess.h&quot;
</span><ins>+#include &quot;WebUserContentController.h&quot;
</ins><span class="cx"> #include &lt;WebCore/DOMWrapperWorld.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageGroup.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserContentController.h&gt;
</span><span class="lines">@@ -48,16 +48,8 @@
</span><span class="cx"> WebPageGroupProxy::WebPageGroupProxy(const WebPageGroupData&amp; data)
</span><span class="cx">     : m_data(data)
</span><span class="cx">     , m_pageGroup(WebCore::PageGroup::pageGroup(m_data.identifier))
</span><ins>+    , m_userContentController(WebUserContentController::getOrCreate(m_data.userContentControllerIdentifier))
</ins><span class="cx"> {
</span><del>-    for (const auto&amp; userStyleSheet : data.userStyleSheets)
-        addUserStyleSheet(userStyleSheet);
-    for (const auto&amp; userScript : data.userScripts)
-        addUserScript(userScript);
-
-#if ENABLE(CONTENT_EXTENSIONS)
-    for (auto&amp; slot : data.userContentExtensions)
-        addUserContentExtension(slot.key, slot.value);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebPageGroupProxy::~WebPageGroupProxy()
</span><span class="lines">@@ -66,53 +58,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebCore::UserContentController&amp; WebPageGroupProxy::userContentController()
</span><span class="cx"> {
</span><del>-    if (!m_userContentController)
-        m_userContentController = WebCore::UserContentController::create();
-
-    return *m_userContentController;
</del><ins>+    return m_userContentController-&gt;userContentController();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageGroupProxy::addUserStyleSheet(const WebCore::UserStyleSheet&amp; userStyleSheet)
-{
-    userContentController().addUserStyleSheet(WebCore::mainThreadNormalWorld(), std::make_unique&lt;WebCore::UserStyleSheet&gt;(userStyleSheet), WebCore::InjectInExistingDocuments);
-}
-
-void WebPageGroupProxy::addUserScript(const WebCore::UserScript&amp; userScript)
-{
-    userContentController().addUserScript(WebCore::mainThreadNormalWorld(), std::make_unique&lt;WebCore::UserScript&gt;(userScript));
-}
-
-void WebPageGroupProxy::removeAllUserStyleSheets()
-{
-    userContentController().removeUserStyleSheets(WebCore::mainThreadNormalWorld());
-}
-
-void WebPageGroupProxy::removeAllUserScripts()
-{
-    userContentController().removeUserScripts(WebCore::mainThreadNormalWorld());
-}
-
-void WebPageGroupProxy::removeAllUserContent()
-{
-    userContentController().removeAllUserContent();
-}
-
-#if ENABLE(CONTENT_EXTENSIONS)
-void WebPageGroupProxy::addUserContentExtension(const String&amp; name, WebCompiledContentExtensionData contentExtensionData)
-{
-    RefPtr&lt;WebCompiledContentExtension&gt; compiledContentExtension = WebCompiledContentExtension::create(WTFMove(contentExtensionData));
-    userContentController().addUserContentExtension(name, compiledContentExtension);
-}
-
-void WebPageGroupProxy::removeUserContentExtension(const String&amp; name)
-{
-    userContentController().removeUserContentExtension(name);
-}
-
-void WebPageGroupProxy::removeAllUserContentExtensions()
-{
-    userContentController().removeAllUserContentExtensions();    
-}
-#endif
-
</del><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -30,11 +30,6 @@
</span><span class="cx"> #include &quot;WebPageGroupData.h&quot;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> 
</span><del>-namespace IPC {
-class Connection;
-class MessageDecoder;
-}
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> class PageGroup;
</span><span class="cx"> class UserContentController;
</span><span class="lines">@@ -42,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class WebCompiledContentExtensionData;
</del><ins>+class WebUserContentController;
</ins><span class="cx"> 
</span><span class="cx"> class WebPageGroupProxy : public API::ObjectImpl&lt;API::Object::Type::BundlePageGroup&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -57,27 +52,12 @@
</span><span class="cx"> 
</span><span class="cx">     WebCore::UserContentController&amp; userContentController();
</span><span class="cx"> 
</span><del>-    void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
-
-    void addUserStyleSheet(const WebCore::UserStyleSheet&amp;);
-    void addUserScript(const WebCore::UserScript&amp;);
-    void removeAllUserStyleSheets();
-    void removeAllUserScripts();
-    void removeAllUserContent();
-
-#if ENABLE(CONTENT_EXTENSIONS)
-    void addUserContentExtension(const String&amp; name, WebCompiledContentExtensionData);
-    void removeUserContentExtension(const String&amp; name);
-    void removeAllUserContentExtensions();
-#endif
-
</del><span class="cx"> private:
</span><span class="cx">     WebPageGroupProxy(const WebPageGroupData&amp;);
</span><span class="cx"> 
</span><span class="cx">     WebPageGroupData m_data;
</span><span class="cx">     WebCore::PageGroup* m_pageGroup;
</span><del>-
-    RefPtr&lt;WebCore::UserContentController&gt; m_userContentController;
</del><ins>+    Ref&lt;WebUserContentController&gt; m_userContentController;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxymessagesin"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-# Copyright (C) 2012 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; WebPageGroupProxy {
-    AddUserStyleSheet(WebCore::UserStyleSheet userStyleSheet);
-    AddUserScript(WebCore::UserScript userScript);
-    RemoveAllUserStyleSheets();
-    RemoveAllUserScripts();
-    RemoveAllUserContent();
-
-#if ENABLE(CONTENT_EXTENSIONS)
-    AddUserContentExtension(String name, WebKit::WebCompiledContentExtensionData contentExtension);
-    RemoveUserContentExtension(String name);
-    RemoveAllUserContentExtensions();
-#endif
-}
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx"> #include &quot;WebMemorySampler.h&quot;
</span><span class="cx"> #include &quot;WebPage.h&quot;
</span><span class="cx"> #include &quot;WebPageGroupProxy.h&quot;
</span><del>-#include &quot;WebPageGroupProxyMessages.h&quot;
</del><span class="cx"> #include &quot;WebPlatformStrategies.h&quot;
</span><span class="cx"> #include &quot;WebProcessCreationParameters.h&quot;
</span><span class="cx"> #include &quot;WebProcessMessages.h&quot;
</span><span class="lines">@@ -591,19 +590,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (decoder.messageReceiverName() == Messages::WebPageGroupProxy::messageReceiverName()) {
-        uint64_t pageGroupID = decoder.destinationID();
-        if (!pageGroupID)
-            return;
-        
-        WebPageGroupProxy* pageGroupProxy = webPageGroup(pageGroupID);
-        if (!pageGroupProxy)
-            return;
-        
-        pageGroupProxy-&gt;didReceiveMessage(connection, decoder);
-        return;
-    }
-
</del><span class="cx">     if (decoder.messageReceiverName() == Messages::ChildProcess::messageReceiverName()) {
</span><span class="cx">         ChildProcess::didReceiveMessage(connection, decoder);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Tools/ChangeLog        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2016-02-28  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        Reimplement WKPageGroup in terms of WKUserContentController
+        https://bugs.webkit.org/show_bug.cgi?id=154804
+
+        Reviewed by Dan Bernstein.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2/PageGroup.cpp: Added.
+
+2016-02-28  Sam Weinig  &lt;sam@webkit.org&gt;
+
</ins><span class="cx">         Bind _WKUserStyleSheets to WKUserContentWorlds to allow for grouping of user content by associating to a world
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=154798
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (197303 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-02-28 22:21:54 UTC (rev 197303)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -99,6 +99,7 @@
</span><span class="cx">                 7C89D2AC1A69B80D003A5FDE /* WKPageConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2AA1A69B80D003A5FDE /* WKPageConfiguration.cpp */; };
</span><span class="cx">                 7C9ED98B17A19F4B00E4DC33 /* attributedStringStrikethrough.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7C9ED98A17A19D0600E4DC33 /* attributedStringStrikethrough.html */; };
</span><span class="cx">                 7CB184C61AA3F2100066EDFD /* ContentExtensions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CB184C41AA3F2100066EDFD /* ContentExtensions.cpp */; };
</span><ins>+                7CCB4DA91C83AE7300CC6918 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCB4DA71C83AE7300CC6918 /* PageGroup.cpp */; };
</ins><span class="cx">                 7CCE7EA41A4119F300447C4C /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */; };
</span><span class="cx">                 7CCE7EA51A411A0800447C4C /* JavaScriptTestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C081224013FC172400DC39AE /* JavaScriptTestMac.mm */; };
</span><span class="cx">                 7CCE7EA61A411A0F00447C4C /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
</span><span class="lines">@@ -650,6 +651,7 @@
</span><span class="cx">                 7CB184C41AA3F2100066EDFD /* ContentExtensions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CBBA07619BB8A9100BBF025 /* OSObjectPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSObjectPtr.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CC3E1FA197E234100BE6252 /* UserContentController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserContentController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7CCB4DA71C83AE7300CC6918 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7CCE7E8C1A41144E00447C4C /* libTestWebKitAPI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTestWebKitAPI.a; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">                 7CCE7EA31A4115CB00447C4C /* TestWebKitAPILibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TestWebKitAPILibrary.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKUserContentExtensionStore.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1196,6 +1198,7 @@
</span><span class="cx">                                 93AF4ECD1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp */,
</span><span class="cx">                                 93F7E86B14DC8E4D00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames.cpp */,
</span><span class="cx">                                 93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */,
</span><ins>+                                7CCB4DA71C83AE7300CC6918 /* PageGroup.cpp */,
</ins><span class="cx">                                 BC909779125571AB00083756 /* PageLoadBasic.cpp */,
</span><span class="cx">                                 BC2D004812A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp */,
</span><span class="cx">                                 52E5CE4514D21E9D003B2BD8 /* ParentFrame.cpp */,
</span><span class="lines">@@ -1763,6 +1766,7 @@
</span><span class="cx">                                 7CCE7F391A411B8E00447C4C /* MD5.cpp in Sources */,
</span><span class="cx">                                 A14FC5901B8AE36F00D107EB /* TestProtocol.mm in Sources */,
</span><span class="cx">                                 7CCE7F3B1A411B8E00447C4C /* MediaTime.cpp in Sources */,
</span><ins>+                                7CCB4DA91C83AE7300CC6918 /* PageGroup.cpp in Sources */,
</ins><span class="cx">                                 7CCE7EB21A411A5100447C4C /* MemoryCacheAddImageToCacheIOS.mm in Sources */,
</span><span class="cx">                                 7CCE7EC51A411A7E00447C4C /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */,
</span><span class="cx">                                 7CCE7EC61A411A7E00447C4C /* MemoryCachePruneWithinResourceLoadDelegate.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2PageGroupcpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageGroup.cpp (0 => 197304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageGroup.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageGroup.cpp        2016-02-29 00:32:24 UTC (rev 197304)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &lt;WebKit/WKFoundation.h&gt;
+
+#if WK_HAVE_C_SPI
+
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;PlatformWebView.h&quot;
+#import &quot;Test.h&quot;
+#import &lt;WebKit/WKPageGroup.h&gt;
+#import &lt;WebKit/WKUserContentControllerRef.h&gt;
+#import &lt;WebKit/WKPageConfigurationRef.h&gt;
+
+namespace TestWebKitAPI {
+
+TEST(PageGroup, DefaultUserContentController)
+{
+    auto pageConfiguration = adoptWK(WKPageConfigurationCreate());
+    auto context = adoptWK(WKContextCreate());
+    WKPageConfigurationSetContext(pageConfiguration.get(), context.get());
+    auto pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK(&quot;TestPageGroup&quot;).get()));
+    WKPageConfigurationSetPageGroup(pageConfiguration.get(), pageGroup.get());
+
+    auto pageGroupUserContentController = retainWK(WKPageGroupGetUserContentController(pageGroup.get()));
+
+    EXPECT_NULL(WKPageConfigurationGetUserContentController(pageConfiguration.get()));
+
+    PlatformWebView webView(pageConfiguration.get());
+    auto copiedPageConfiguration = adoptWK(WKPageCopyPageConfiguration(webView.page()));
+
+    ASSERT_EQ(pageGroupUserContentController.get(), WKPageConfigurationGetUserContentController(copiedPageConfiguration.get()));
+}
+
+TEST(PageGroup, CustomUserContentController)
+{
+    auto pageConfiguration = adoptWK(WKPageConfigurationCreate());
+    auto context = adoptWK(WKContextCreate());
+    WKPageConfigurationSetContext(pageConfiguration.get(), context.get());
+    auto pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK(&quot;TestPageGroup&quot;).get()));
+    WKPageConfigurationSetPageGroup(pageConfiguration.get(), pageGroup.get());
+    auto userContentController = adoptWK(WKUserContentControllerCreate());
+    WKPageConfigurationSetUserContentController(pageConfiguration.get(), userContentController.get());
+
+    auto pageGroupUserContentController = retainWK(WKPageGroupGetUserContentController(pageGroup.get()));
+
+    EXPECT_EQ(userContentController.get(), WKPageConfigurationGetUserContentController(pageConfiguration.get()));
+
+    PlatformWebView webView(pageConfiguration.get());
+    auto copiedPageConfiguration = adoptWK(WKPageCopyPageConfiguration(webView.page()));
+
+    EXPECT_EQ(userContentController.get(), WKPageConfigurationGetUserContentController(copiedPageConfiguration.get()));
+}
+
+} // namespace TestWebKitAPI
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>