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

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

<h3>Log Message</h3>
<pre>Add initial experimental user content filtering API
https://bugs.webkit.org/show_bug.cgi?id=140584

Reviewed by Benjamin Poulain.

Source/WebCore:

Change content extensions to be managed through the UserContentController.

* WebCore.exp.in:
Update exports.

* WebCore.xcodeproj/project.pbxproj:
Update for removed files.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::removeAllRuleLists):
(WebCore::ContentExtensions::ContentExtensionsBackend::sharedInstance): Deleted.
* contentextensions/ContentExtensionsBackend.h:
Remove concept of a shared instance and add a removeAllRuleLists() function.
        
* contentextensions/ContentExtensionsInterface.cpp: Removed.
* contentextensions/ContentExtensionsInterface.h: Removed.
Since there is no shared instance anymore, checking if a URL should be blocked
now has to go directly to the backend.
        
* contentextensions/ContentExtensionsManager.cpp:
(WebCore::ContentExtensions::ExtensionsManager::createRuleList):
(WebCore::ContentExtensions::ExtensionsManager::loadExtension): Deleted.
* contentextensions/ContentExtensionsManager.h:
Update interface to accommodate the lack of a shared instance. Now, all this
file does is take a serialized rule list and outputs the Vector of ContentExtensionRules

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
Check with the UserContentController to see if the URL should be blocked.

* page/UserContentController.cpp:
(WebCore::UserContentController::addUserContentFilter):
(WebCore::UserContentController::removeAllUserContentFilters):
(WebCore::UserContentController::contentFilterBlocksURL):
* page/UserContentController.h:
Add single point of interaction for both the WebKit level to add and remove
content filters and WebCore to check to see if URLs should be blocked.

Source/WebKit2:

Moves content filtering from being per-ProcessPool to per-UserContentController.

* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* UIProcess/API/APIUserContentFilter.cpp: Added.
(API::UserContentFilter::UserContentFilter):
(API::UserContentFilter::~UserContentFilter):
* UIProcess/API/APIUserContentFilter.h: Added.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKUserContentFilterRef.cpp: Added.
(WKUserContentFilterGetTypeID):
(WKUserContentFilterCreate):
* UIProcess/API/C/WKUserContentFilterRef.h: Added.
* UIProcess/API/C/WebKit2_C.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.h: Added.
* UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added.
(WKUserContentControllerAddUserContentFilter):
(WKUserContentControllerRemoveAllUserContentFilters):
(-[_WKUserContentFilter _initWithName:ruleList:]):
* UIProcess/API/Cocoa/_WKUserContentFilterInternal.h: Added.
Add a basic UserContentFilter type and expose it via both the Objective-C API (as _WKUserContentFilter)
and via the C SPI (as WKUserContentFilterRef).

* UIProcess/API/C/WKUserContentControllerRef.h:
* UIProcess/API/C/WKUserContentControllerRef.cpp:
Add C-SPI to set and remove WKUserContentFilterRefs.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _loadContentExtensionWithIdentifier:serializedRules:successCompletionHandler:errorCompletionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching):
(WebKit::WebProcessPool::loadContentExtension): Deleted.
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::loadContentExtension): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
Remove the old SPI for loading content filters that was per-ProcessPool. Content filters now follow
the same pattern as UserScripts and UserStyleSheets as being per-UserContentController.

* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController _addUserContentFilter:]):
(-[WKUserContentController _removeAllUserContentFilters]):
* UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Added.
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addUserContentFilter):
(WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addUserContentFilters):
(WebKit::WebUserContentController::removeAllUserContentFilters):
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:
Pipe user content filters over to all the WebProcesses that the UserContentController is
connected to.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendh">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsManagercpp">trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsManagerh">trunk/Source/WebCore/contentextensions/ContentExtensionsManager.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllercpp">trunk/Source/WebCore/page/UserContentController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllerh">trunk/Source/WebCore/page/UserContentController.h</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIAPIObjecth">trunk/Source/WebKit2/Shared/API/APIObject.h</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIcWKBaseh">trunk/Source/WebKit2/Shared/API/c/WKBase.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKAPICasth">trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKUserContentControllerRefcpp">trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKUserContentControllerRefh">trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWebKit2_Ch">trunk/Source/WebKit2/UIProcess/API/C/WebKit2_C.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllerInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerInternal.h</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="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolh">trunk/Source/WebKit2/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#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="#trunkSourceWebKit2WebProcessUserContentWebUserContentControllermessagesin">trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessmessagesin">trunk/Source/WebKit2/WebProcess/WebProcess.messages.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUserContentFiltercpp">trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUserContentFilterh">trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKUserContentFilterRefcpp">trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKUserContentFilterRefh">trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllerPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFilterh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFiltermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFilterInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsInterfacecpp">trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsInterfaceh">trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/ChangeLog        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2015-01-17  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add initial experimental user content filtering API
+        https://bugs.webkit.org/show_bug.cgi?id=140584
+
+        Reviewed by Benjamin Poulain.
+
+        Change content extensions to be managed through the UserContentController.
+
+        * WebCore.exp.in:
+        Update exports.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Update for removed files.
+
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllRuleLists):
+        (WebCore::ContentExtensions::ContentExtensionsBackend::sharedInstance): Deleted.
+        * contentextensions/ContentExtensionsBackend.h:
+        Remove concept of a shared instance and add a removeAllRuleLists() function.
+        
+        * contentextensions/ContentExtensionsInterface.cpp: Removed.
+        * contentextensions/ContentExtensionsInterface.h: Removed.
+        Since there is no shared instance anymore, checking if a URL should be blocked
+        now has to go directly to the backend.
+        
+        * contentextensions/ContentExtensionsManager.cpp:
+        (WebCore::ContentExtensions::ExtensionsManager::createRuleList):
+        (WebCore::ContentExtensions::ExtensionsManager::loadExtension): Deleted.
+        * contentextensions/ContentExtensionsManager.h:
+        Update interface to accommodate the lack of a shared instance. Now, all this
+        file does is take a serialized rule list and outputs the Vector of ContentExtensionRules
+
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::requestResource):
+        Check with the UserContentController to see if the URL should be blocked.
+
+        * page/UserContentController.cpp:
+        (WebCore::UserContentController::addUserContentFilter):
+        (WebCore::UserContentController::removeAllUserContentFilters):
+        (WebCore::UserContentController::contentFilterBlocksURL):
+        * page/UserContentController.h:
+        Add single point of interaction for both the WebKit level to add and remove
+        content filters and WebCore to check to see if URLs should be blocked.
+
</ins><span class="cx"> 2015-01-18  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r125251): wrapper lifetimes of SVGElementInstance are incorrect
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -3011,7 +3011,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-__ZN7WebCore17ContentExtensions17ExtensionsManager13loadExtensionERKN3WTF6StringES5_
</del><ins>+__ZN7WebCore21UserContentController20addUserContentFilterERKN3WTF6StringES4_
+__ZN7WebCore21UserContentController27removeAllUserContentFiltersEv
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -1045,8 +1045,6 @@
</span><span class="cx">                 26C17A3E1491D2D400D12BA2 /* FileSystemIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C17A3C1491D2D400D12BA2 /* FileSystemIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 26C17A3F1491D2D400D12BA2 /* FileSystemIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26C17A3D1491D2D400D12BA2 /* FileSystemIOS.mm */; };
</span><span class="cx">                 26E98A10130A9FCA008EB7B2 /* TextCodecASCIIFastPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 26E98A0F130A9FCA008EB7B2 /* TextCodecASCIIFastPath.h */; };
</span><del>-                26F0C8921A2D79CB002794F8 /* ContentExtensionsInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F0C8911A2D79CB002794F8 /* ContentExtensionsInterface.h */; };
-                26F0C8941A2D7A76002794F8 /* ContentExtensionsInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F0C8931A2D7A76002794F8 /* ContentExtensionsInterface.cpp */; };
</del><span class="cx">                 26F0C8971A2E724B002794F8 /* ContentExtensionsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F0C8951A2E724B002794F8 /* ContentExtensionsManager.cpp */; };
</span><span class="cx">                 26F0C8981A2E724B002794F8 /* ContentExtensionsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F0C8961A2E724B002794F8 /* ContentExtensionsManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 26F0C89B1A2EC110002794F8 /* ContentExtensionRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F0C8991A2EC110002794F8 /* ContentExtensionRule.cpp */; };
</span><span class="lines">@@ -8049,8 +8047,6 @@
</span><span class="cx">                 26C17A3C1491D2D400D12BA2 /* FileSystemIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemIOS.h; path = ios/FileSystemIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26C17A3D1491D2D400D12BA2 /* FileSystemIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = FileSystemIOS.mm; path = ios/FileSystemIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26E98A0F130A9FCA008EB7B2 /* TextCodecASCIIFastPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecASCIIFastPath.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                26F0C8911A2D79CB002794F8 /* ContentExtensionsInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionsInterface.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                26F0C8931A2D7A76002794F8 /* ContentExtensionsInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionsInterface.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 26F0C8951A2E724B002794F8 /* ContentExtensionsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionsManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26F0C8961A2E724B002794F8 /* ContentExtensionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionsManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26F0C8991A2EC110002794F8 /* ContentExtensionRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionRule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9720,8 +9716,8 @@
</span><span class="cx">                 839AAFEA1A0C0C8D00605F99 /* HTMLWBRElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLWBRElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLWBRElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderConverter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                83C05A581A686212007E5DEA /* StylePropertyShorthandFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; name = StylePropertyShorthandFunctions.cpp; path = StylePropertyShorthandFunctions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                83C05A591A686212007E5DEA /* StylePropertyShorthandFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; name = StylePropertyShorthandFunctions.h; path = StylePropertyShorthandFunctions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                83C05A581A686212007E5DEA /* StylePropertyShorthandFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StylePropertyShorthandFunctions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                83C05A591A686212007E5DEA /* StylePropertyShorthandFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StylePropertyShorthandFunctions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 83C1D413178D5AB400141E68 /* SVGPathSegArcAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegArcAbs.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83C1D414178D5AB400141E68 /* SVGPathSegArcRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegArcRel.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83C1D415178D5AB400141E68 /* SVGPathSegCurvetoCubicAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoCubicAbs.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15328,8 +15324,6 @@
</span><span class="cx">                                 26F0C89D1A2EC3BE002794F8 /* ContentExtensionsBackend.cpp */,
</span><span class="cx">                                 26F0C89E1A2EC3BE002794F8 /* ContentExtensionsBackend.h */,
</span><span class="cx">                                 262391351A648CEE007251A3 /* ContentExtensionsDebugging.h */,
</span><del>-                                26F0C8931A2D7A76002794F8 /* ContentExtensionsInterface.cpp */,
-                                26F0C8911A2D79CB002794F8 /* ContentExtensionsInterface.h */,
</del><span class="cx">                                 26F0C8951A2E724B002794F8 /* ContentExtensionsManager.cpp */,
</span><span class="cx">                                 26F0C8961A2E724B002794F8 /* ContentExtensionsManager.h */,
</span><span class="cx">                                 267725F61A5B3AD9003C24DD /* DFA.cpp */,
</span><span class="lines">@@ -26283,7 +26277,6 @@
</span><span class="cx">                                 8419D2AD120D92FC00141F8F /* SVGPathByteStreamSource.h in Headers */,
</span><span class="cx">                                 8476C9EC11DF6A2900555B02 /* SVGPathConsumer.h in Headers */,
</span><span class="cx">                                 71537A01146BD9D7008BD615 /* SVGPathData.h in Headers */,
</span><del>-                                26F0C8921A2D79CB002794F8 /* ContentExtensionsInterface.h in Headers */,
</del><span class="cx">                                 B2227A590D00BF220071B782 /* SVGPathElement.h in Headers */,
</span><span class="cx">                                 8476C9F011DF6A5800555B02 /* SVGPathParser.h in Headers */,
</span><span class="cx">                                 B2227A5B0D00BF220071B782 /* SVGPathSeg.h in Headers */,
</span><span class="lines">@@ -27471,7 +27464,6 @@
</span><span class="cx">                                 93309DDE099E64920056E581 /* DeleteFromTextNodeCommand.cpp in Sources */,
</span><span class="cx">                                 93309DE0099E64920056E581 /* DeleteSelectionCommand.cpp in Sources */,
</span><span class="cx">                                 A7C9ABF81357A3BF00F5503F /* DetailsMarkerControl.cpp in Sources */,
</span><del>-                                26F0C8941A2D7A76002794F8 /* ContentExtensionsInterface.cpp in Sources */,
</del><span class="cx">                                 CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */,
</span><span class="cx">                                 31EAF97F121435A400E7C1BF /* DeviceMotionClientIOS.mm in Sources */,
</span><span class="cx">                                 31FB1A58120A5D0600DC02A0 /* DeviceMotionController.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -42,12 +42,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><del>-ContentExtensionsBackend&amp; ContentExtensionsBackend::sharedInstance()
-{
-    static NeverDestroyed&lt;ContentExtensionsBackend&gt; instance;
-    return instance;
-}
-
</del><span class="cx"> void ContentExtensionsBackend::setRuleList(const String&amp; identifier, const Vector&lt;ContentExtensionRule&gt;&amp; ruleList)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!identifier.isEmpty());
</span><span class="lines">@@ -112,6 +106,11 @@
</span><span class="cx">     m_ruleLists.remove(identifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ContentExtensionsBackend::removeAllRuleLists()
+{
+    m_ruleLists.clear();
+}
+
</ins><span class="cx"> bool ContentExtensionsBackend::shouldBlockURL(const URL&amp; url)
</span><span class="cx"> {
</span><span class="cx">     const String&amp; urlString = url.string();
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -47,15 +47,13 @@
</span><span class="cx"> // 2) It provides APIs for the WebCore interfaces to use those rules efficiently.
</span><span class="cx"> class ContentExtensionsBackend {
</span><span class="cx"> public:
</span><del>-    static ContentExtensionsBackend&amp; sharedInstance();
-
</del><span class="cx">     // - Rule management interface. This can be used by upper layer.
</span><span class="cx"> 
</span><span class="cx">     // Set a list of rules for a given name. If there were existing rules for the name, they are overriden.
</span><span class="cx">     // The identifier cannot be empty.
</span><span class="cx">     void setRuleList(const String&amp; identifier, const Vector&lt;ContentExtensionRule&gt;&amp;);
</span><del>-
</del><span class="cx">     void removeRuleList(const String&amp; identifier);
</span><ins>+    void removeAllRuleLists();
</ins><span class="cx"> 
</span><span class="cx">     // - Internal WebCore Interface.
</span><span class="cx">     bool shouldBlockURL(const URL&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsInterfacecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;ContentExtensionsInterface.h&quot;
-
-#if ENABLE(CONTENT_EXTENSIONS)
-
-#include &quot;ContentExtensionsBackend.h&quot;
-
-namespace WebCore {
-namespace ContentExtensions {
-
-bool shouldBlockURL(const URL&amp; url)
-{
-    return ContentExtensionsBackend::sharedInstance().shouldBlockURL(url);
-}
-
-} // namespace ContentExtensions
-} // namespace WebCore
-
-#endif // ENABLE(CONTENT_EXTENSIONS)
</del></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsInterfaceh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsInterface.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ContentExtensionsInterface_h
-#define ContentExtensionsInterface_h
-
-#if ENABLE(CONTENT_EXTENSIONS)
-
-namespace WebCore {
-
-class URL;
-
-// This defines the interface by which WebCore interact with Content Extensions.
-namespace ContentExtensions {
-bool shouldBlockURL(const URL&amp;);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(CONTENT_EXTENSIONS)
-
-#endif // ContentExtensionsInterface_h
</del></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsManager.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">     return Vector&lt;ContentExtensionRule&gt;();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void loadExtension(const String&amp; identifier, const String&amp; rules)
</del><ins>+Vector&lt;ContentExtensionRule&gt; createRuleList(const String&amp; rules)
</ins><span class="cx"> {
</span><span class="cx"> #if CONTENT_EXTENSIONS_PERFORMANCE_REPORTING
</span><span class="cx">     double loadExtensionStartTime = monotonicallyIncreasingTime();
</span><span class="lines">@@ -173,17 +173,15 @@
</span><span class="cx"> 
</span><span class="cx">     vm.clear();
</span><span class="cx"> 
</span><del>-    if (ruleList.isEmpty()) {
</del><ins>+    if (ruleList.isEmpty())
</ins><span class="cx">         WTFLogAlways(&quot;Empty extension.&quot;);
</span><del>-        return;
-    }
</del><span class="cx"> 
</span><span class="cx"> #if CONTENT_EXTENSIONS_PERFORMANCE_REPORTING
</span><span class="cx">     double loadExtensionEndTime = monotonicallyIncreasingTime();
</span><span class="cx">     dataLogF(&quot;Time spent loading extension %s: %f\n&quot;, identifier.utf8().data(), (loadExtensionEndTime - loadExtensionStartTime));
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    ContentExtensionsBackend::sharedInstance().setRuleList(identifier, ruleList);
</del><ins>+    return ruleList;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace ExtensionsManager
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsManager.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsManager.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsManager.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -29,15 +29,18 @@
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><ins>+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><ins>+class ContentExtensionRule;
+
</ins><span class="cx"> // The ExtensionsManager loads serialized content extension rules directly into WebCore.
</span><span class="cx"> namespace ExtensionsManager {
</span><span class="cx"> 
</span><del>-void loadExtension(const String&amp; identifier, const String&amp; rules);
</del><ins>+Vector&lt;ContentExtensionRule&gt; createRuleList(const String&amp; rules);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace ExtensionsManager
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -60,13 +60,10 @@
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;SessionID.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><ins>+#include &quot;UserContentController.h&quot;
</ins><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-#include &quot;ContentExtensionsInterface.h&quot;
-#endif
-
</del><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> #include &quot;CachedTextTrack.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -458,7 +455,7 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    if (ContentExtensions::shouldBlockURL(url))
</del><ins>+    if (frame() &amp;&amp; frame()-&gt;page() &amp;&amp; frame()-&gt;page()-&gt;userContentController() &amp;&amp; frame()-&gt;page()-&gt;userContentController()-&gt;contentFilterBlocksURL(url))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/page/UserContentController.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -37,6 +37,11 @@
</span><span class="cx"> #include &quot;UserMessageHandlerDescriptor.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+#include &quot;ContentExtensionsBackend.h&quot;
+#include &quot;ContentExtensionsManager.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;UserContentController&gt; UserContentController::create()
</span><span class="lines">@@ -173,6 +178,33 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+void UserContentController::addUserContentFilter(const String&amp; name, const String&amp; ruleList)
+{
+    if (!m_contentExtensionBackend)
+        m_contentExtensionBackend = std::make_unique&lt;ContentExtensions::ContentExtensionsBackend&gt;();
+    
+    m_contentExtensionBackend-&gt;setRuleList(name, ContentExtensions::ExtensionsManager::createRuleList(ruleList));
+}
+
+void UserContentController::removeAllUserContentFilters()
+{
+    if (!m_contentExtensionBackend)
+        return;
+
+    m_contentExtensionBackend-&gt;removeAllRuleLists();
+}
+
+bool UserContentController::contentFilterBlocksURL(const URL&amp; url)
+{
+    if (!m_contentExtensionBackend)
+        return false;
+
+    return m_contentExtensionBackend-&gt;shouldBlockURL(url);
+}
+
+#endif
+
</ins><span class="cx"> void UserContentController::removeAllUserContent()
</span><span class="cx"> {
</span><span class="cx">     m_userScripts = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebCore/page/UserContentController.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -45,6 +45,10 @@
</span><span class="cx"> class UserStyleSheet;
</span><span class="cx"> class UserMessageHandlerDescriptor;
</span><span class="cx"> 
</span><ins>+namespace ContentExtensions {
+class ContentExtensionsBackend;
+}
+
</ins><span class="cx"> class UserContentController : public RefCounted&lt;UserContentController&gt; {
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static RefPtr&lt;UserContentController&gt; create();
</span><span class="lines">@@ -74,6 +78,15 @@
</span><span class="cx">     WEBCORE_EXPORT void removeUserMessageHandlerDescriptor(UserMessageHandlerDescriptor&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+    // FIXME: This should really take a pointer to a compiled UserContentFilter.
+    WEBCORE_EXPORT void addUserContentFilter(const String&amp; name, const String&amp; ruleList);
+    WEBCORE_EXPORT void removeAllUserContentFilters();
+    
+    // FIXME: Consider putting this (and other future content filter predicates) in its own class.
+    bool contentFilterBlocksURL(const URL&amp;);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     UserContentController();
</span><span class="cx"> 
</span><span class="lines">@@ -86,6 +99,9 @@
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span><span class="cx">     std::unique_ptr&lt;UserMessageHandlerDescriptorMap&gt; m_userMessageHandlerDescriptors;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+    std::unique_ptr&lt;ContentExtensions::ContentExtensionsBackend&gt; m_contentExtensionBackend;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/CMakeLists.txt        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -366,6 +366,7 @@
</span><span class="cx">     UIProcess/API/APINavigation.cpp
</span><span class="cx">     UIProcess/API/APISessionState.cpp
</span><span class="cx">     UIProcess/API/APIWebsiteDataStore.cpp
</span><ins>+    UIProcess/API/APIUserContentFilter.cpp
</ins><span class="cx"> 
</span><span class="cx">     UIProcess/API/C/WKApplicationCacheManager.cpp
</span><span class="cx">     UIProcess/API/C/WKAuthenticationChallenge.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/ChangeLog        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -1,3 +1,73 @@
</span><ins>+2015-01-17  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add initial experimental user content filtering API
+        https://bugs.webkit.org/show_bug.cgi?id=140584
+
+        Reviewed by Benjamin Poulain.
+
+        Moves content filtering from being per-ProcessPool to per-UserContentController.
+
+        * Shared/API/APIObject.h:
+        * Shared/API/c/WKBase.h:
+        * UIProcess/API/APIUserContentFilter.cpp: Added.
+        (API::UserContentFilter::UserContentFilter):
+        (API::UserContentFilter::~UserContentFilter):
+        * UIProcess/API/APIUserContentFilter.h: Added.
+        * UIProcess/API/C/WKAPICast.h:
+        * UIProcess/API/C/WKUserContentFilterRef.cpp: Added.
+        (WKUserContentFilterGetTypeID):
+        (WKUserContentFilterCreate):
+        * UIProcess/API/C/WKUserContentFilterRef.h: Added.
+        * UIProcess/API/C/WebKit2_C.h:
+        * UIProcess/API/Cocoa/_WKUserContentFilter.h: Added.
+        * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added.
+        (WKUserContentControllerAddUserContentFilter):
+        (WKUserContentControllerRemoveAllUserContentFilters):
+        (-[_WKUserContentFilter _initWithName:ruleList:]):
+        * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h: Added.
+        Add a basic UserContentFilter type and expose it via both the Objective-C API (as _WKUserContentFilter)
+        and via the C SPI (as WKUserContentFilterRef).
+
+        * UIProcess/API/C/WKUserContentControllerRef.h:
+        * UIProcess/API/C/WKUserContentControllerRef.cpp:
+        Add C-SPI to set and remove WKUserContentFilterRefs.
+
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (-[WKProcessPool _loadContentExtensionWithIdentifier:serializedRules:successCompletionHandler:errorCompletionHandler:]): Deleted.
+        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::processDidFinishLaunching):
+        (WebKit::WebProcessPool::loadContentExtension): Deleted.
+        * UIProcess/WebProcessPool.h:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::loadContentExtension): Deleted.
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+        Remove the old SPI for loading content filters that was per-ProcessPool. Content filters now follow
+        the same pattern as UserScripts and UserStyleSheets as being per-UserContentController.
+
+        * UIProcess/API/Cocoa/WKUserContentController.mm:
+        (-[WKUserContentController _addUserContentFilter:]):
+        (-[WKUserContentController _removeAllUserContentFilters]):
+        * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
+        * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Added.
+        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
+        (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
+        (WebKit::WebUserContentControllerProxy::addProcess):
+        (WebKit::WebUserContentControllerProxy::addUserContentFilter):
+        (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
+        * UIProcess/UserContent/WebUserContentControllerProxy.h:
+        * WebProcess/UserContent/WebUserContentController.cpp:
+        (WebKit::WebUserContentController::addUserContentFilters):
+        (WebKit::WebUserContentController::removeAllUserContentFilters):
+        * WebProcess/UserContent/WebUserContentController.h:
+        * WebProcess/UserContent/WebUserContentController.messages.in:
+        Pipe user content filters over to all the WebProcesses that the UserContentController is
+        connected to.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
</ins><span class="cx"> 2015-01-17  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2][iOS] Add Cocoa delegate for logging diagnostic messages
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIAPIObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/APIObject.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/APIObject.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/Shared/API/APIObject.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -81,6 +81,7 @@
</span><span class="cx">         URLRequest,
</span><span class="cx">         URLResponse,
</span><span class="cx">         UserContentURLPattern,
</span><ins>+        UserContentFilter,
</ins><span class="cx">         UserScript,
</span><span class="cx">         WebArchive,
</span><span class="cx">         WebArchiveResource,
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIcWKBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/c/WKBase.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/c/WKBase.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/Shared/API/c/WKBase.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -129,6 +129,7 @@
</span><span class="cx"> typedef const struct OpaqueWKSession* WKSessionRef;
</span><span class="cx"> typedef const struct OpaqueWKSessionState* WKSessionStateRef;
</span><span class="cx"> typedef const struct OpaqueWKUserContentController* WKUserContentControllerRef;
</span><ins>+typedef const struct OpaqueWKUserContentFilter* WKUserContentFilterRef;
</ins><span class="cx"> typedef const struct OpaqueWKUserMediaPermissionRequest* WKUserMediaPermissionRequestRef;
</span><span class="cx"> typedef const struct OpaqueWKUserScript* WKUserScriptRef;
</span><span class="cx"> typedef const struct OpaqueWKVibration* WKVibrationRef;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUserContentFiltercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;APIUserContentFilter.h&quot;
+
+namespace API {
+
+UserContentFilter::UserContentFilter(const WTF::String&amp; name, const WTF::String&amp; serializedRules)
+    : m_name(name)
+    , m_serializedRules(serializedRules)
+{
+}
+
+UserContentFilter::~UserContentFilter()
+{
+}
+
+} // namespace API
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUserContentFilterh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef APIUserContentFilter_h
+#define APIUserContentFilter_h
+
+#include &quot;APIObject.h&quot;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace API {
+
+class UserContentFilter final : public ObjectImpl&lt;Object::Type::UserContentFilter&gt; {
+public:
+    static Ref&lt;UserContentFilter&gt; create(const WTF::String&amp; name, const WTF::String&amp; serializedRules)
+    {
+        return adoptRef(*new UserContentFilter(name, serializedRules));
+    }
+
+    UserContentFilter(const WTF::String&amp; name, const WTF::String&amp; serializedRules);
+    ~UserContentFilter();
+
+    const WTF::String&amp; name() const { return m_name; }
+    const WTF::String&amp; serializedRules() const { return m_serializedRules; }
+
+private:
+    WTF::String m_name;
+    WTF::String m_serializedRules;
+};
+
+} // namespace API
+
+#endif // APIUserContentFilter_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKAPICasth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> class PageConfiguration;
</span><span class="cx"> class ProcessPoolConfiguration;
</span><span class="cx"> class SessionState;
</span><ins>+class UserContentFilter;
</ins><span class="cx"> class UserScript;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -152,6 +153,7 @@
</span><span class="cx"> WK_ADD_API_MAPPING(WKSessionStateRef, API::SessionState)
</span><span class="cx"> WK_ADD_API_MAPPING(WKTextCheckerRef, WebTextChecker)
</span><span class="cx"> WK_ADD_API_MAPPING(WKUserContentControllerRef, WebUserContentControllerProxy)
</span><ins>+WK_ADD_API_MAPPING(WKUserContentFilterRef, API::UserContentFilter)
</ins><span class="cx"> WK_ADD_API_MAPPING(WKUserMediaPermissionRequestRef, UserMediaPermissionRequestProxy)
</span><span class="cx"> WK_ADD_API_MAPPING(WKUserScriptRef, API::UserScript)
</span><span class="cx"> WK_ADD_API_MAPPING(WKVibrationRef, WebVibrationProxy)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKUserContentControllerRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -56,3 +56,17 @@
</span><span class="cx"> {
</span><span class="cx">     toImpl(userContentControllerRef)-&gt;removeAllUserScripts();
</span><span class="cx"> }
</span><ins>+
+void WKUserContentControllerAddUserContentFilter(WKUserContentControllerRef userContentControllerRef, WKUserContentFilterRef userContentFilterRef)
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+    toImpl(userContentControllerRef)-&gt;addUserContentFilter(*toImpl(userContentFilterRef));
+#endif
+}
+
+void WKUserContentControllerRemoveAllUserContentFilters(WKUserContentControllerRef userContentControllerRef)
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+    toImpl(userContentControllerRef)-&gt;removeAllUserContentFilters();
+#endif
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKUserContentControllerRefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -40,6 +40,8 @@
</span><span class="cx"> WK_EXPORT void WKUserContentControllerAddUserScript(WKUserContentControllerRef userContentController, WKUserScriptRef userScript);
</span><span class="cx"> WK_EXPORT void WKUserContentControllerRemoveAllUserScripts(WKUserContentControllerRef userContentController);
</span><span class="cx"> 
</span><ins>+WK_EXPORT void WKUserContentControllerAddUserContentFilter(WKUserContentControllerRef userContentController, WKUserContentFilterRef userContentFilter);
+WK_EXPORT void WKUserContentControllerRemoveAllUserContentFilters(WKUserContentControllerRef userContentController);
</ins><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKUserContentFilterRefcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WKUserContentFilterRef.h&quot;
+
+#include &quot;APIUserContentFilter.h&quot;
+#include &quot;WKAPICast.h&quot;
+
+using namespace WebKit;
+
+WKTypeID WKUserContentFilterGetTypeID()
+{
+    return toAPI(API::UserContentFilter::APIType);
+}
+
+WKUserContentFilterRef WKUserContentFilterCreate(WKStringRef nameRef, WKStringRef serializedRulesRef)
+{
+    return toAPI(&amp;API::UserContentFilter::create(toWTFString(nameRef), toWTFString(serializedRulesRef)).leakRef());
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKUserContentFilterRefh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.h (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKUserContentFilterRef_h
+#define WKUserContentFilterRef_h
+
+#include &lt;WebKit/WKBase.h&gt;
+
+#ifdef __cplusplus
+extern &quot;C&quot; {
+#endif
+
+WK_EXPORT WKTypeID WKUserContentFilterGetTypeID();
+
+WK_EXPORT WKUserContentFilterRef WKUserContentFilterCreate(WKStringRef name, WKStringRef serializedRules);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKUserContentFilterRef_h */
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWebKit2_Ch"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WebKit2_C.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WebKit2_C.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/C/WebKit2_C.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> #include &lt;WebKit/WKURLRequest.h&gt;
</span><span class="cx"> #include &lt;WebKit/WKURLResponse.h&gt;
</span><span class="cx"> #include &lt;WebKit/WKUserContentControllerRef.h&gt;
</span><ins>+#include &lt;WebKit/WKUserContentFilterRef.h&gt;
</ins><span class="cx"> #include &lt;WebKit/WKUserMediaPermissionRequest.h&gt;
</span><span class="cx"> #include &lt;WebKit/WKUserScriptRef.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -247,20 +247,6 @@
</span><span class="cx">     _processPool-&gt;sendToAllProcesses(Messages::WebProcess::SetInjectedBundleParameter(parameter, IPC::DataReference(static_cast&lt;const uint8_t*&gt;([data bytes]), [data length])));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_loadContentExtensionWithIdentifier:(NSString *)identifier serializedRules:(NSString *)serializedRules successCompletionHandler:(void (^)(NSDictionary *info))successCompletionHandler errorCompletionHandler:(void (^)(NSError *error))errorCompletionHandler
-{
-#if ENABLE(CONTENT_EXTENSIONS)
-    // For this experimentation, the ContentExtensions are handled by each WebProcess.
-    // Eventually the ContentExtension will have to be handled separately from the WebProcesses and we'll be able
-    // to provide meaningful completion handlers.
-    UNUSED_PARAM(errorCompletionHandler);
-
-    _processPool-&gt;loadContentExtension(identifier, serializedRules);
-
-    successCompletionHandler(nil);
-#endif
-}
-
</del><span class="cx"> - (id &lt;_WKDownloadDelegate&gt;)_downloadDelegate
</span><span class="cx"> {
</span><span class="cx">     return _downloadDelegate.getAutoreleased();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -43,9 +43,6 @@
</span><span class="cx"> - (id)_objectForBundleParameter:(NSString *)parameter;
</span><span class="cx"> - (void)_setObject:(id &lt;NSCopying, NSSecureCoding&gt;)object forBundleParameter:(NSString *)parameter;
</span><span class="cx"> 
</span><del>-// FIXME: move the API to a better place.
-- (void)_loadContentExtensionWithIdentifier:(NSString *)identifier serializedRules:(NSString *)serializedRules successCompletionHandler:(void (^)(NSDictionary *info))successCompletionHandler errorCompletionHandler:(void (^)(NSError *error))errorCompletionHandler WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
-
</del><span class="cx"> @property (nonatomic, weak, setter=_setDownloadDelegate:) id &lt;_WKDownloadDelegate&gt; _downloadDelegate;
</span><span class="cx"> 
</span><span class="cx"> + (NSURL *)_websiteDataURLForContainerWithURL:(NSURL *)containerURL;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #import &quot;WKWebViewInternal.h&quot;
</span><span class="cx"> #import &quot;WebScriptMessageHandler.h&quot;
</span><span class="cx"> #import &quot;WebUserContentControllerProxy.h&quot;
</span><ins>+#import &quot;_WKUserContentFilterInternal.h&quot;
</ins><span class="cx"> #import &lt;JavaScriptCore/JSContext.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/JSValue.h&gt;
</span><span class="cx"> #import &lt;WebCore/SerializedScriptValue.h&gt;
</span><span class="lines">@@ -124,5 +125,23 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+@implementation WKUserContentController (WKPrivate)
+
+- (void)_addUserContentFilter:(_WKUserContentFilter *)userContentFilter
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+    _userContentControllerProxy-&gt;addUserContentFilter(*userContentFilter-&gt;_userContentFilter);
</ins><span class="cx"> #endif
</span><ins>+}
</ins><span class="cx"> 
</span><ins>+- (void)_removeAllUserContentFilters
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+    _userContentControllerProxy-&gt;removeAllUserContentFilters();
+#endif
+}
+
+@end
+
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllerInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerInternal.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerInternal.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerInternal.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#import &quot;WKUserContentController.h&quot;
</del><ins>+#import &quot;WKUserContentControllerPrivate.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllerPrivateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;WebKit/WKUserContentController.h&gt;
+
+#if WK_API_ENABLED
+
+@class _WKUserContentFilter;
+
+@interface WKUserContentController (WKPrivate)
+
+- (void)_addUserContentFilter:(_WKUserContentFilter *)userContentFilter;
+- (void)_removeAllUserContentFilters;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFilterh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.h (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;WebKit/WKFoundation.h&gt;
+
+#if WK_API_ENABLED
+
+WK_CLASS_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA)
+@interface _WKUserContentFilter : NSObject
+
+- (instancetype)_initWithName:(NSString *)name serializedRules:(NSString *)serializedRules;
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFiltermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;_WKUserContentFilterInternal.h&quot;
+
+#if WK_API_ENABLED
+
+@implementation _WKUserContentFilter
+
+- (instancetype)_initWithName:(NSString *)name serializedRules:(NSString *)serializedRules
+{
+    if (!(self = [super init]))
+        return nil;
+
+    API::Object::constructInWrapper&lt;API::UserContentFilter&gt;(self, String(name), String(serializedRules));
+
+    return self;
+}
+
+- (void)dealloc
+{
+    _userContentFilter-&gt;~UserContentFilter();
+
+    [super dealloc];
+}
+
+#pragma mark WKObject protocol implementation
+
+- (API::Object&amp;)_apiObject
+{
+    return *_userContentFilter;
+}
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFilterInternalh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.h (0 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;_WKUserContentFilter.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;APIUserContentFilter.h&quot;
+#import &quot;WKObject.h&quot;
+
+namespace WebKit {
+
+inline _WKUserContentFilter *wrapper(API::UserContentFilter&amp; userContentFilter)
+{
+    ASSERT([userContentFilter.wrapper() isKindOfClass:[_WKUserContentFilter class]]);
+    return (_WKUserContentFilter *)userContentFilter.wrapper();
+}
+
+}
+
+@interface _WKUserContentFilter () &lt;WKObject&gt; {
+@package
+    API::ObjectStorage&lt;API::UserContentFilter&gt; _userContentFilter;
+}
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -35,6 +35,10 @@
</span><span class="cx"> #include &quot;WebUserContentControllerProxyMessages.h&quot;
</span><span class="cx"> #include &lt;WebCore/SerializedScriptValue.h&gt;
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+#include &quot;APIUserContentFilter.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> static uint64_t generateIdentifier()
</span><span class="lines">@@ -47,6 +51,9 @@
</span><span class="cx"> WebUserContentControllerProxy::WebUserContentControllerProxy()
</span><span class="cx">     : m_identifier(generateIdentifier())
</span><span class="cx">     , m_userScripts(*API::Array::create())
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+    , m_userContentFilters(*API::Array::create())
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -76,6 +83,13 @@
</span><span class="cx">     for (auto&amp; handler : m_scriptMessageHandlers.values())
</span><span class="cx">         messageHandlerHandles.append(handler-&gt;handle());
</span><span class="cx">     webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserScriptMessageHandlers(messageHandlerHandles), m_identifier);
</span><ins>+
+#if ENABLE(CONTENT_EXTENSIONS)
+    Vector&lt;std::pair&lt;String, String&gt;&gt; userContentFilters;
+    for (const auto&amp; userContentFilter : m_userContentFilters-&gt;elementsOfType&lt;API::UserContentFilter&gt;())
+        userContentFilters.append(std::make_pair(userContentFilter-&gt;name(), userContentFilter-&gt;serializedRules()));
+    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserContentFilters(userContentFilters), m_identifier);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebUserContentControllerProxy::removeProcess(WebProcessProxy&amp; webProcessProxy)
</span><span class="lines">@@ -169,4 +183,25 @@
</span><span class="cx">     handler-&gt;client().didPostMessage(*page, *frame, *value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+#if ENABLE(CONTENT_EXTENSIONS)
+void WebUserContentControllerProxy::addUserContentFilter(API::UserContentFilter&amp; userContentFilter)
+{
+    m_userContentFilters-&gt;elements().append(&amp;userContentFilter);
+
+    auto pair = std::make_pair(userContentFilter.name(), userContentFilter.serializedRules());
+
+    for (WebProcessProxy* process : m_processes)
+        process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserContentFilters({ pair }), m_identifier);
+}
+
+void WebUserContentControllerProxy::removeAllUserContentFilters()
+{
+    m_userContentFilters-&gt;elements().clear();
+
+    for (WebProcessProxy* process : m_processes)
+        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserContentFilters(), m_identifier);
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace API {
</span><span class="cx"> class Array;
</span><ins>+class UserContentFilter;
</ins><span class="cx"> class UserScript;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -80,6 +81,11 @@
</span><span class="cx">     bool addUserScriptMessageHandler(WebScriptMessageHandler*);
</span><span class="cx">     void removeUserMessageHandlerForName(const String&amp;);
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+    void addUserContentFilter(API::UserContentFilter&amp;);
+    void removeAllUserContentFilters();
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     // IPC::MessageReceiver.
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</span><span class="lines">@@ -91,6 +97,10 @@
</span><span class="cx">     Ref&lt;API::Array&gt; m_userScripts;
</span><span class="cx">     Vector&lt;WebCore::UserStyleSheet&gt; m_userStyleSheets;
</span><span class="cx">     HashMap&lt;uint64_t, RefPtr&lt;WebScriptMessageHandler&gt;&gt; m_scriptMessageHandlers;
</span><ins>+
+#if ENABLE(CONTENT_EXTENSIONS)
+    Ref&lt;API::Array&gt; m_userContentFilters;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -799,11 +799,6 @@
</span><span class="cx">         process-&gt;send(Messages::WebProcess::StartMemorySampler(sampleLogSandboxHandle, sampleLogFilePath, m_memorySamplerInterval), 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-    for (const auto&amp; slot : m_encodedContentExtensions)
-        process-&gt;send(Messages::WebProcess::LoadContentExtension(slot.key, slot.value), 0);
-#endif
-
</del><span class="cx">     m_connectionClient.didCreateConnection(this, process-&gt;webConnection());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1425,12 +1420,4 @@
</span><span class="cx">     sendToAllProcesses(Messages::WebProcess::SetMemoryCacheDisabled(disabled));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-void WebProcessPool::loadContentExtension(const String&amp; identifier, const String&amp; serializedRules)
-{
-    m_encodedContentExtensions.set(identifier, serializedRules);
-    sendToAllProcesses(Messages::WebProcess::LoadContentExtension(identifier, serializedRules));
-}
-#endif
-
</del><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -355,10 +355,6 @@
</span><span class="cx">         return m_processSuppressionDisabledForPageCounter.token&lt;ProcessSuppressionDisabledTokenType&gt;();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-    void loadContentExtension(const String&amp; identifier, const String&amp; serializedRules);
-#endif
-
</del><span class="cx"> private:
</span><span class="cx">     void platformInitialize();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -1079,6 +1079,14 @@
</span><span class="cx">                 7C89D2A31A678875003A5FDE /* WKUserScriptRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2A11A678875003A5FDE /* WKUserScriptRef.cpp */; };
</span><span class="cx">                 7C89D2A41A678875003A5FDE /* WKUserScriptRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2A21A678875003A5FDE /* WKUserScriptRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C89D2A61A6789EA003A5FDE /* APIUserScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2A51A6789EA003A5FDE /* APIUserScript.cpp */; };
</span><ins>+                7C89D2B31A6B068C003A5FDE /* APIUserContentFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2B11A6B068C003A5FDE /* APIUserContentFilter.cpp */; };
+                7C89D2B41A6B068C003A5FDE /* APIUserContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2B21A6B068C003A5FDE /* APIUserContentFilter.h */; };
+                7C89D2B61A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2B51A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                7C89D2B91A6B0F2C003A5FDE /* _WKUserContentFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2B71A6B0F2C003A5FDE /* _WKUserContentFilter.mm */; };
+                7C89D2BA1A6B0F2C003A5FDE /* _WKUserContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2B81A6B0F2C003A5FDE /* _WKUserContentFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                7C89D2BC1A6B0F5B003A5FDE /* _WKUserContentFilterInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2BB1A6B0F5B003A5FDE /* _WKUserContentFilterInternal.h */; };
+                7C89D2BF1A6B11EF003A5FDE /* WKUserContentFilterRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2BD1A6B11EF003A5FDE /* WKUserContentFilterRef.cpp */; };
+                7C89D2C01A6B11EF003A5FDE /* WKUserContentFilterRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2BE1A6B11EF003A5FDE /* WKUserContentFilterRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 7C8EB11718DB6A19007917C2 /* WKPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C8EB11618DB6A19007917C2 /* WKPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C9D1537184584DA009D3918 /* WKBrowsingContextGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9D1536184584DA009D3918 /* WKBrowsingContextGroupInternal.h */; };
</span><span class="cx">                 7CA254EB182993CE00FC8A41 /* WKBrowsingContextPolicyDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CA254EA182993CE00FC8A41 /* WKBrowsingContextPolicyDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3204,6 +3212,14 @@
</span><span class="cx">                 7C89D2A11A678875003A5FDE /* WKUserScriptRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserScriptRef.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C89D2A21A678875003A5FDE /* WKUserScriptRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserScriptRef.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C89D2A51A6789EA003A5FDE /* APIUserScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIUserScript.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C89D2B11A6B068C003A5FDE /* APIUserContentFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIUserContentFilter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2B21A6B068C003A5FDE /* APIUserContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIUserContentFilter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2B51A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserContentControllerPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2B71A6B0F2C003A5FDE /* _WKUserContentFilter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKUserContentFilter.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2B81A6B0F2C003A5FDE /* _WKUserContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKUserContentFilter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2BB1A6B0F5B003A5FDE /* _WKUserContentFilterInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKUserContentFilterInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2BD1A6B11EF003A5FDE /* WKUserContentFilterRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserContentFilterRef.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2BE1A6B11EF003A5FDE /* WKUserContentFilterRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserContentFilterRef.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C8EB11618DB6A19007917C2 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C9D1536184584DA009D3918 /* WKBrowsingContextGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextGroupInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CA254EA182993CE00FC8A41 /* WKBrowsingContextPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextPolicyDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5165,6 +5181,9 @@
</span><span class="cx">                                 2D6B371918A967AD0042AE80 /* _WKThumbnailView.h */,
</span><span class="cx">                                 2D6B371A18A967AD0042AE80 /* _WKThumbnailView.mm */,
</span><span class="cx">                                 2DACE64D18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h */,
</span><ins>+                                7C89D2B81A6B0F2C003A5FDE /* _WKUserContentFilter.h */,
+                                7C89D2B71A6B0F2C003A5FDE /* _WKUserContentFilter.mm */,
+                                7C89D2BB1A6B0F5B003A5FDE /* _WKUserContentFilterInternal.h */,
</ins><span class="cx">                                 1A81B37F18BD66AD0007FDAC /* _WKVisitedLinkProvider.h */,
</span><span class="cx">                                 1A81B37E18BD66AD0007FDAC /* _WKVisitedLinkProvider.mm */,
</span><span class="cx">                                 1A81B38418BD673A0007FDAC /* _WKVisitedLinkProviderInternal.h */,
</span><span class="lines">@@ -5219,6 +5238,7 @@
</span><span class="cx">                                 1AFA3AC718E61C61003CCBAE /* WKUserContentController.h */,
</span><span class="cx">                                 1AFA3AC618E61C61003CCBAE /* WKUserContentController.mm */,
</span><span class="cx">                                 1AAF08A3192682DA00B6390C /* WKUserContentControllerInternal.h */,
</span><ins>+                                7C89D2B51A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h */,
</ins><span class="cx">                                 1AAF089919267EE500B6390C /* WKUserScript.h */,
</span><span class="cx">                                 1AAF089819267EE500B6390C /* WKUserScript.mm */,
</span><span class="cx">                                 1AAF089C19267FC800B6390C /* WKUserScriptInternal.h */,
</span><span class="lines">@@ -6100,6 +6120,8 @@
</span><span class="cx">                                 1AFDE65F1954E9B100C48FFA /* APISessionState.cpp */,
</span><span class="cx">                                 1AFDE6601954E9B100C48FFA /* APISessionState.h */,
</span><span class="cx">                                 1A4D664718A2D91A00D82E21 /* APIUIClient.h */,
</span><ins>+                                7C89D2B11A6B068C003A5FDE /* APIUserContentFilter.cpp */,
+                                7C89D2B21A6B068C003A5FDE /* APIUserContentFilter.h */,
</ins><span class="cx">                                 7C89D2A51A6789EA003A5FDE /* APIUserScript.cpp */,
</span><span class="cx">                                 7C89D2921A67122F003A5FDE /* APIUserScript.h */,
</span><span class="cx">                                 1A3635A71A3144A300ED6197 /* APIWebsiteDataStore.cpp */,
</span><span class="lines">@@ -6217,6 +6239,8 @@
</span><span class="cx">                                 7C89D29E1A678554003A5FDE /* WKUserContentControllerRef.h */,
</span><span class="cx">                                 7C89D2A11A678875003A5FDE /* WKUserScriptRef.cpp */,
</span><span class="cx">                                 7C89D2A21A678875003A5FDE /* WKUserScriptRef.h */,
</span><ins>+                                7C89D2BD1A6B11EF003A5FDE /* WKUserContentFilterRef.cpp */,
+                                7C89D2BE1A6B11EF003A5FDE /* WKUserContentFilterRef.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = C;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -7359,6 +7383,7 @@
</span><span class="cx">                                 0F174AA3142A4CB70039250F /* APIGeometry.h in Headers */,
</span><span class="cx">                                 3769079E18F340A2001DFF04 /* APIInjectedBundleFormClient.h in Headers */,
</span><span class="cx">                                 3769079A18F31CB2001DFF04 /* APIInjectedBundlePageUIClient.h in Headers */,
</span><ins>+                                7C89D2B61A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h in Headers */,
</ins><span class="cx">                                 7CE4D2071A46776100C7F152 /* APILegacyContextHistoryClient.h in Headers */,
</span><span class="cx">                                 1A2464F31891E45100234C5B /* APILoaderClient.h in Headers */,
</span><span class="cx">                                 7CD3A4831A5D02FA009623B8 /* APINavigation.h in Headers */,
</span><span class="lines">@@ -7438,6 +7463,7 @@
</span><span class="cx">                                 C517388112DF8F4F00EE3F47 /* DragControllerAction.h in Headers */,
</span><span class="cx">                                 BC8452A81162C80900CAB9B5 /* DrawingArea.h in Headers */,
</span><span class="cx">                                 0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */,
</span><ins>+                                7C89D2C01A6B11EF003A5FDE /* WKUserContentFilterRef.h in Headers */,
</ins><span class="cx">                                 1A64229A12DD029200CAAE2C /* DrawingAreaMessages.h in Headers */,
</span><span class="cx">                                 BC2652171182608100243E12 /* DrawingAreaProxy.h in Headers */,
</span><span class="cx">                                 1A64230912DD09EB00CAAE2C /* DrawingAreaProxyMessages.h in Headers */,
</span><span class="lines">@@ -7572,6 +7598,7 @@
</span><span class="cx">                                 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
</span><span class="cx">                                 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
</span><span class="cx">                                 7C3F8C91173AF52D007B7F39 /* PluginInformation.h in Headers */,
</span><ins>+                                7C89D2B41A6B068C003A5FDE /* APIUserContentFilter.h in Headers */,
</ins><span class="cx">                                 1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */,
</span><span class="cx">                                 1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
</span><span class="cx">                                 1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */,
</span><span class="lines">@@ -7905,6 +7932,7 @@
</span><span class="cx">                                 8372DB2F1A677D4A00C697C5 /* WKDiagnosticLoggingResultType.h in Headers */,
</span><span class="cx">                                 1AB474E4184D44980051B622 /* WKBundlePageContextMenuClient.h in Headers */,
</span><span class="cx">                                 1AB474E8184D44D00051B622 /* WKBundlePageDiagnosticLoggingClient.h in Headers */,
</span><ins>+                                7C89D2BC1A6B0F5B003A5FDE /* _WKUserContentFilterInternal.h in Headers */,
</ins><span class="cx">                                 1AB474E0184D446A0051B622 /* WKBundlePageEditorClient.h in Headers */,
</span><span class="cx">                                 1AB474E2184D44800051B622 /* WKBundlePageFormClient.h in Headers */,
</span><span class="cx">                                 1AB474E6184D44B40051B622 /* WKBundlePageFullScreenClient.h in Headers */,
</span><span class="lines">@@ -7995,6 +8023,7 @@
</span><span class="cx">                                 51A9E10B1315CD18009E7031 /* WKKeyValueStorageManager.h in Headers */,
</span><span class="cx">                                 33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */,
</span><span class="cx">                                 BC4075FE124FF0270068F20A /* WKMutableArray.h in Headers */,
</span><ins>+                                7C89D2BA1A6B0F2C003A5FDE /* _WKUserContentFilter.h in Headers */,
</ins><span class="cx">                                 BC407600124FF0270068F20A /* WKMutableDictionary.h in Headers */,
</span><span class="cx">                                 C09AE5E9125257C20025825D /* WKNativeEvent.h in Headers */,
</span><span class="cx">                                 83891B631A68B3420030F386 /* APIDiagnosticLoggingClient.h in Headers */,
</span><span class="lines">@@ -9227,6 +9256,7 @@
</span><span class="cx">                                 E4436ECD1A0D040B00EAD204 /* NetworkCacheKey.cpp in Sources */,
</span><span class="cx">                                 E4436ED01A0D040B00EAD204 /* NetworkCacheStorageCocoa.mm in Sources */,
</span><span class="cx">                                 513A164C1630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp in Sources */,
</span><ins>+                                7C89D2B91A6B0F2C003A5FDE /* _WKUserContentFilter.mm in Sources */,
</ins><span class="cx">                                 51DD9F2816367DA2001578E9 /* NetworkConnectionToWebProcessMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 5167EEA1170377BF007681CA /* NetworkDiskCacheMonitor.mm in Sources */,
</span><span class="cx">                                 51795568162876CF00FA43B6 /* NetworkProcess.cpp in Sources */,
</span><span class="lines">@@ -9494,6 +9524,7 @@
</span><span class="cx">                                 51C96118183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 BCCF6ABC12C91EF9008F9C35 /* WebImage.cpp in Sources */,
</span><span class="cx">                                 1C8E28211275D15400BC7BD0 /* WebInspector.cpp in Sources */,
</span><ins>+                                7C89D2B31A6B068C003A5FDE /* APIUserContentFilter.cpp in Sources */,
</ins><span class="cx">                                 BC111A60112F4FBB00337BAB /* WebInspectorClient.cpp in Sources */,
</span><span class="cx">                                 1C8E2A351277852400BC7BD0 /* WebInspectorMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1C8E28351275D73800BC7BD0 /* WebInspectorProxy.cpp in Sources */,
</span><span class="lines">@@ -9671,6 +9702,7 @@
</span><span class="cx">                                 BC017D2016263308007054F5 /* WKDOMTextIterator.mm in Sources */,
</span><span class="cx">                                 1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */,
</span><span class="cx">                                 1AF4592E19464B2000F9D4A2 /* WKError.mm in Sources */,
</span><ins>+                                7C89D2BF1A6B11EF003A5FDE /* WKUserContentFilterRef.cpp in Sources */,
</ins><span class="cx">                                 BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */,
</span><span class="cx">                                 BC4075FB124FF0270068F20A /* WKErrorRef.cpp in Sources */,
</span><span class="cx">                                 7C89D2A31A678875003A5FDE /* WKUserScriptRef.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -180,4 +180,17 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+void WebUserContentController::addUserContentFilters(const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp; userContentFilters)
+{
+    for (const auto&amp; userContentFilter : userContentFilters)
+        m_userContentController-&gt;addUserContentFilter(userContentFilter.first, userContentFilter.second);
+}
+
+void WebUserContentController::removeAllUserContentFilters()
+{
+    m_userContentController-&gt;removeAllUserContentFilters();
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -51,15 +51,20 @@
</span><span class="cx">     // IPC::MessageReceiver.
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</span><span class="cx"> 
</span><del>-    void addUserScripts(const Vector&lt;WebCore::UserScript&gt;&amp; userScripts);
</del><ins>+    void addUserScripts(const Vector&lt;WebCore::UserScript&gt;&amp;);
</ins><span class="cx">     void removeAllUserScripts();
</span><span class="cx"> 
</span><del>-    void addUserStyleSheets(const Vector&lt;WebCore::UserStyleSheet&gt;&amp; userStyleSheets);
</del><ins>+    void addUserStyleSheets(const Vector&lt;WebCore::UserStyleSheet&gt;&amp;);
</ins><span class="cx">     void removeAllUserStyleSheets();
</span><span class="cx"> 
</span><del>-    void addUserScriptMessageHandlers(const Vector&lt;WebScriptMessageHandlerHandle&gt;&amp; scriptMessageHandlers);
</del><ins>+    void addUserScriptMessageHandlers(const Vector&lt;WebScriptMessageHandlerHandle&gt;&amp;);
</ins><span class="cx">     void removeUserScriptMessageHandler(uint64_t);
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+    void addUserContentFilters(const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp;);
+    void removeAllUserContentFilters();
+#endif
+
</ins><span class="cx">     uint64_t m_identifier;
</span><span class="cx">     Ref&lt;WebCore::UserContentController&gt; m_userContentController;
</span><span class="cx"> #if ENABLE(USER_MESSAGE_HANDLERS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllermessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -25,11 +25,16 @@
</span><span class="cx"> 
</span><span class="cx"> messages -&gt; WebUserContentController {
</span><span class="cx">     AddUserScripts(Vector&lt;WebCore::UserScript&gt; userScripts);
</span><del>-    RemoveAllUserScripts()
</del><ins>+    RemoveAllUserScripts();
</ins><span class="cx"> 
</span><del>-    AddUserStyleSheets(Vector&lt;WebCore::UserStyleSheet&gt; userStyleShhets);
-    RemoveAllUserStyleSheets()
</del><ins>+    AddUserStyleSheets(Vector&lt;WebCore::UserStyleSheet&gt; userStyleSheets);
+    RemoveAllUserStyleSheets();
</ins><span class="cx"> 
</span><span class="cx">     AddUserScriptMessageHandlers(Vector&lt;WebKit::WebScriptMessageHandlerHandle&gt; scriptMessageHandlers);
</span><del>-    RemoveUserScriptMessageHandler(uint64_t identifier)
</del><ins>+    RemoveUserScriptMessageHandler(uint64_t identifier);
+
+#if ENABLE(CONTENT_EXTENSIONS)
+    AddUserContentFilters(Vector&lt;std::pair&lt;String, String&gt;&gt; userContentFilters);
+    RemoveAllUserContentFilters();
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -104,10 +104,6 @@
</span><span class="cx"> #include &quot;NetworkProcessConnection.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-#include &lt;WebCore/ContentExtensionsManager.h&gt;
-#endif
-
</del><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><span class="cx"> #include &quot;SecItemShim.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -1319,13 +1315,6 @@
</span><span class="cx">     return UserData::transform(object, Transformer());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-void WebProcess::loadContentExtension(const String&amp; identifier, const String&amp; serializedRules)
-{
-    ContentExtensions::ExtensionsManager::loadExtension(identifier, serializedRules);
-}
-#endif
-
</del><span class="cx"> void WebProcess::setMemoryCacheDisabled(bool disabled)
</span><span class="cx"> {
</span><span class="cx">     if (memoryCache().disabled() != disabled)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -202,10 +202,6 @@
</span><span class="cx">     bool hasRichContentServices() const { return m_hasRichContentServices; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-    void loadContentExtension(const String&amp; identifier, const String&amp; serializedRules);
-#endif
-
</del><span class="cx"> private:
</span><span class="cx">     WebProcess();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (178633 => 178634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2015-01-18 20:57:26 UTC (rev 178633)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2015-01-18 21:54:12 UTC (rev 178634)
</span><span class="lines">@@ -93,10 +93,6 @@
</span><span class="cx">     SetEnabledServices(bool hasImageServices, bool hasSelectionServices, bool hasRichContentServices)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-    LoadContentExtension(String identifier, String serializedRules)
-#endif
-
</del><span class="cx">     ProcessWillSuspend()
</span><span class="cx">     CancelProcessWillSuspend()
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>